Jump to content
  • Advertisement
Sign in to follow this  

Deferred Shading and Materials

This topic is 3429 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 implementing a deferred shader and plan to handle different materials using material indices as described here in section 9.4.3. The problem is that I don't understand why they use a 3D texture here instead of 2 2D textures (N.L, material) and (N.H, material) as diffuse and specular lights are independent. I assume that L8A8 is for diffuse and specular intensity.

Share this post


Link to post
Share on other sites
Advertisement
you store an index in the G-Buffer and then you use that index value to switch between several if statements in the shader. On most recent high-end hardware this might be faster than fetching textures and gives you more variety.
The other option is to store an index value in the G-Buffer as above and then use several different 2D textures (maybe a cube map?), to look up material values. I wouldn't use a 3D texure because it is easy to trash the texture cash with it when you do not take care. Rule of thumb was 32x32x32 for a while but this might have changed.
If you need more material variety than this, you might check out the Light Pre-Pass renderer.

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!