Question

I've noticed that in my program when I look away from my tessellated mesh, the frame time goes way down, suggesting that no tessellation is happening on meshes that aren't on screen. (I have no custom culling code)

But for my purposes I need access in the geometry shader to the tessellated vertices whether they are on screen or not.

Are these tessellated triangles making it to the geometry shader stage? Or are they being culled before they even make it to the tessellation evaluator stage.

Was it helpful?

Solution

when I look away from my tessellated mesh, the frame time goes way down, suggesting that no tessellation is happening on meshes that aren't on screen.

Well there's your problem; the belief that faster speed means lack of tessellation.

There are many reasons why off-screen polygons will be faster than on-screen ones. For example, you could be partially or entirely fragment-shader and/or pixel-bound in terms of speed. Thus, once those fragments are culled by being entirely off-screen, your rendering time goes down.

In short, everything's fine. Neither OpenGL nor D3D allows the tessellation stage to discard geometry arbitrarily. Remember: you don't have to tessellate in clip-space, so there's no way for the system to even know if a triangle is "off-screen". Your GS is allowed to potentially bring off-screen triangles on-screen. So there's not enough information at that point to decide what is and is not off-screen.

In all likelihood, what's happening is that your renderer's performance was bound to the rasterizer/fragment shader, rather than to vertex processing. So even though the vertices are still being processed, the expensive per-fragment operations aren't being done because the triangles are off-screen. Thus, a performance improvement.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top