Sign in to follow this  

On Geometry Shaders & Cube Mapping, etc

This topic is 3627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Suppose you have a mesh rendered with a geometry shader, such as tessellated terrain; you also want to employ single pass cube map generation via a geometry shader too. Naturally you can't have the cube map geometry shader active and the terrain tessellator active at the same time; so getting the terrain to render into the cube map is somewhat non-trivial (this is, unless I'm missing something?) So what would be the best solution to this? The first one that springs to mind is writing a third shader that combines both effects, but it doesn't seem like the best answer (though it might be). If there were a lot of different geometry shader effects in the scene this would result in an explosion of new shaders just for cube mapping. Another idea is to render the terrain into an imposter quad and render the imposter into the cubemap. A third idea is to somehow use the new stream-out feature, I've no experience with this, it sounds promising though. Any others? I'm not actually stuck with this problem, it's just something that occured to me earlier and I have yet to think up a solution that I'm totally comfortable with. There might be some enginuitive new D3D10.x / GL3.0 tricks that could be applied here maybe...

Share this post


Link to post
Share on other sites
Have you ever actually seen a speed improvement from using the GS to render to all faces of a cubemap at once, compared to just rendering six times and doing some decent culling? I'm extremely dubious that the speed hit from running a GS is less than the cost of submitting a few more render calls.

Share this post


Link to post
Share on other sites
I wrote a test application testing the speed of rendering to a cubemap in the geometry shader in DX10, and rendering the 6 faces individually in DX9, and DX9 won hands down, by quite a considerable margin. However, this could just be due to DX10 being not that optimised yet at the driver level. I really should modify my DX10 version to render 6 individual faces and then we'd know for sure. The only thing that I do know is that using geometry shaders is incredibly slow on current hardware.

Share this post


Link to post
Share on other sites
With current implementations using geometry shaders is very slow and rendering the scene 4+1 times to generate and render a conventional cube map with any half decent D3D9 implementation will certainly beat the single pass technique.
I can see that as hardware and drivers mature for D3D10 then we will see the GS take the reigns more and more.

As for my initial question I think the answer lies with the stream-out feature. The terrain can be rendered in one pass with its tessellating GS to a buffer attached to the stream out, presumably then this buffer acts like any other(?) and in a subsequent pass all geometry including this buffer can be submitted (with the cube-map generating GS attached to the pipeline) and rendered to the cubemap in a single pass.

I don't know how effecient the stream-out feature will turn out to be (now and in the future) which raises the new question of how well this idea scales up once there are many objects that need to be rendereed into the cubemap that also have their own GS.

Share this post


Link to post
Share on other sites

This topic is 3627 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this