Jump to content
  • Advertisement
Sign in to follow this  

Ubershader/Scene Sorting

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

I'm having a little bit of a design dilemma in regards to setting up a ubershader and sorting my scene. Currently I have a SceneGraph which contains Renderable nodes. Each frame any renderable nodes have their virtual AddPasses() function called. Its purpose is to fill in a structure containing all information to perform a single rendering pass. It basically contains a Mesh and Material pointer and some other info for rendering the object. These Passes are then stored in render queues (opaque, transparent, gui, etc) and sorted before rendering. Sorting for opaque at the moment is done based on Shader, Technique, Mesh, and Texture. Now with that said, I'm trying to efficiently setup a ubershader and a Light Pre-Pass renderer. The problem I'm facing is that meshes can be static or skinned/animated, or the mesh could be user defined and therefore require a different technique or shader pass to render each type and because I'm doing Light Pre-Pass I have certain passes that all techniques need to have. I'm trying to work out if I should now only sort by Technique (and maybe texture?) and then put all render pass objects into a hashmap, based on Technique and then that way for each Technique I can perform the passes it requires. This would minmise changing technique and cut down BeginPass/EndPass calls. The other idea was to maybe have one UberTechnique and then have a heap of different passes in there to do different things, including the ones for LPP. But then I'd need a way of specifying what shader passes are required for each render pass object. Sorry for the big post but I figured I'd best give more info than less. What are your thoughts on the topic? Thanks!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!