Geometry shader for LOD?

Started by
4 comments, last by Krohm 15 years, 8 months ago
I don't really know what a geometry shader is but I think it could be used for LOD kinda like tessellation, am I right? If so would it be fast enough for terrain LOD?
This is your life, and it's ending one minute at a time. - Fight club
Advertisement
A geometry shader executes before the vertex shader stage. In the GS, you can create triangles, lines, points. Yes, I guess you can do LOD with it but I have zero experience.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
No, countrary to the popular belief you cannot do LOD with geometry shaders.

You cannot do it efficiently on current NV hardware, possibly not even in the next generation. Ati claims to have a better performance on paper, this doesn't imply it's enough.

You cannot do it with GS alone: you'll need at least to mess up with the stream-out (xform feedback) mechanism which, as far as I've been told, it's still not as robust, fast and flexible we would like to. I don't think this is going to be a win performance wise regardless of the hardware used since it degenerates the command stream in a sequential one.

Most examples about GS lod run on multiple frames and on non-generic meshes. You'll see terrains, metaballs and such but not generic architecture.

Good LODders are not trivial.

Previously "Krohm"

Quote:Original post by Krohm
No, countrary to the popular belief you cannot do LOD with geometry shaders.

You cannot do it efficiently on current NV hardware, possibly not even in the next generation. Ati claims to have a better performance on paper, this doesn't imply it's enough.

You cannot do it with GS alone: you'll need at least to mess up with the stream-out (xform feedback) mechanism which, as far as I've been told, it's still not as robust, fast and flexible we would like to. I don't think this is going to be a win performance wise regardless of the hardware used since it degenerates the command stream in a sequential one.

Most examples about GS lod run on multiple frames and on non-generic meshes. You'll see terrains, metaballs and such but not generic architecture.

Good LODders are not trivial.


Thanks that's what I needed to know but this also leaves me with another question. Is there any real reason with current hardware to use a geometry shader?
This is your life, and it's ending one minute at a time. - Fight club
Quote:Original post by EmptyVoidThanks that's what I needed to know but this also leaves me with another question. Is there any real reason with current hardware to use a geometry shader?
Yes, it can be useful for some effects. The geometry shader is especially slow if it outputs a lot of extra geometry. If that is not the case, it's still not as fast as you would like, but more or less acceptable.

For example you can use it to extrude fins at silhouettes for fur rendering. You could of course do that in the vertex shader too, but at the cost of submitting a lot of degenerate triangles.
Speaking of degenerate triangles, drawing shadow volumes from silhouettes comes to mind, too. I'm not aware of any real implementation that does this, but in theory it might work ok, not much worse than most other algorithms, anyway.

Rendering the 6 faces of a cube map in one pass is an example where both geometry shaders and transform feedback have been used successfully, although GS didn't prove to be terribly much faster than separate passes on current hardware.
Quote:Original post by samoth
Quote:Original post by EmptyVoidThanks that's what I needed to know but this also leaves me with another question. Is there any real reason with current hardware to use a geometry shader?
Yes, it can be useful for some effects. The geometry shader is especially slow if it outputs a lot of extra geometry. If that is not the case, it's still not as fast as you would like, but more or less acceptable.

For example you can use it to extrude fins at silhouettes for fur rendering. You could of course do that in the vertex shader too, but at the cost of submitting a lot of degenerate triangles.
Speaking of degenerate triangles, drawing shadow volumes from silhouettes comes to mind, too. I'm not aware of any real implementation that does this, but in theory it might work ok, not much worse than most other algorithms, anyway.

Rendering the 6 faces of a cube map in one pass is an example where both geometry shaders and transform feedback have been used successfully, although GS didn't prove to be terribly much faster than separate passes on current hardware.


I could see the shadow thing being kinda useful but I think I'll ignore that part of the DirectX 10 features for now.
This is your life, and it's ending one minute at a time. - Fight club
Quote:Original post by samoth
Quote:Original post by EmptyVoidThanks that's what I needed to know but this also leaves me with another question. Is there any real reason with current hardware to use a geometry shader?
Yes, it can be useful for some effects. The geometry shader is especially slow if it outputs a lot of extra geometry. If that is not the case, it's still not as fast as you would like, but more or less acceptable.

For example you can use it to extrude fins at silhouettes for fur rendering. You could of course do that in the vertex shader too, but at the cost of submitting a lot of degenerate triangles.
Speaking of degenerate triangles, drawing shadow volumes from silhouettes comes to mind, too. I'm not aware of any real implementation that does this, but in theory it might work ok, not much worse than most other algorithms, anyway.

Rendering the 6 faces of a cube map in one pass is an example where both geometry shaders and transform feedback have been used successfully, although GS didn't prove to be terribly much faster than separate passes on current hardware.
I agree. Those are good examples (not exactly LOD as intended in conventional wisdom however). Besides having point->particles expansion, I'm generally not impressed (oh look, I can do shadow extrusions! Too bad I use shadowmaps!).

Previously "Krohm"

This topic is closed to new replies.

Advertisement