Jump to content
  • Advertisement
Sign in to follow this  
Mawww

render to texture shader question.

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

Hi, i'm currently designing a system to render shadows maps (and other effects needing a render to texture). I'm inspiring from the 'Engine-Shadow Integration Question' thread First a definition so there is no confusion : What I call a Shader is a C++ object that defines the appearance of the shaded object, it owns a HardwareProgram which is a set of HardwareShader linked together. the HardwareProgram is what runs on the 3D card. Here is the problem : When I render my shadow map, I do not care about lighting and all that, so I do not want to have a complex normal mapping HardwareProgram running. I could just force a specific HardwareProgram, but it would not work for any shader that change the depth or that discard the fragment. My idea is to add to a Shader a new, optional, HardwareProgram that is used to render the object with a uniform-given color. That way if a Shader have the optional HardwareProgram, when I render a shadow map, I use it, if not I use a default one. The question i'm asking is : is that generic enough ? I cannot think of an effect that requires rendering to texture and that needs another shader than the normal one (for reflection/refraction rendering) or the plain color one (for shadow mapping). I thought that adding a uniform to tell the color we want to render into permit effects like detecting the object edges (by rendering each object with a unique color and applying a edge detection filter on that) Do anyone have an idea of an effect I cannot get with this architecture ? Any comment ? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
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!