Sign in to follow this  
Funkymunky

OpenGL render to slice of 3D texture

Recommended Posts

When rendering to a single slice in a 3D texture (specifically with OpenGL), is it better to:

 

  • Attach a single layer to a framebuffer and do the rendering

 

  • Attach the whole 3D texture, then upload a value to pass to a geometry shader to indicate which layer to output to

 

This is for a process where I will probably need to render to multiple layers of the texture in succession, so I would be attaching several layers to the framebuffer back-to-back.

Share this post


Link to post
Share on other sites

It's hard to say for sure, but most of the time it is faster to skip the geometry shader unless you are already using it for something else (at least is D3D11 it is this way, I assume it is the same in OpenGL).  For something like this, you are better off spending a few hours setting up some basic test code to do what you want and then profile it to see if there is a big difference going one way or the other.  Since every situation is different, you almost always have to profile a particular case to see what works and what doesn't.

Share this post


Link to post
Share on other sites

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