Jump to content
  • Advertisement
Sign in to follow this  
Funkymunky

OpenGL render to slice of 3D texture

This topic is 1811 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

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
Advertisement

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!