Jump to content
  • Advertisement
Sign in to follow this  
jrmcv

Deferred Shading - need some advice for G buffer formats

This topic is 3665 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 trying to come up with some formats for my G-Buffer but having problems trying to limit the G-buffer to 4 x 32 bit render targets. I know lighting buffers are usually included as part of the G-buffer but I have these as a seperate 2 render targets. My format so far is: G-Buffer: 0: 32 bit Depth 1: 24 bit Albedo, 8 bit Specular Level 2: 30 bit Normal, 2 bit light model ID 3: 16 bit specular power, 16 bit unused Light Accumulation Buffers: 30 bit Diffuse, 2 bit unused 30 bit specular, 2 bit unused I know theres some wasted space but I also need to include an ambient RGB colour in the G-buffer building stage. I know I could write this directly to the diffuse render target but that would mean I need 5 render targets which I think is pushing it on some hardware. I dont want to split this in to 2 passes for G-buffer creation either if I can help it. I have also tried with 8 bit specular powers and they seem to give too little precision over a wide range of shinyness. Also, is 30 bit for Diffuse and specular (10 bit each RGB channel, 2 bit alpha ignored) going to be enough for HDR lighting? Doesn't have to be perfect. Any advice or comments would be much appreciated. Thanks a lot EDIT: I am using Direct3D

Share this post


Link to post
Share on other sites
Advertisement
Just do a full-screen ambient pass after you've rendered out your g-buffer, and write out the result to your diffuse accumulation buffer. The just render all of your lights on top of that.

As for using R10B10G10A2 for HDR...I'm not at all an HDR expert but I'm not sure that's going to cut it. You might want to look at some alternate encodings like RGBE (used in the HDRFormats sample in the SDK) or NAO32 if you want to avoid floating-point formats.

[Edited by - MJP on June 11, 2008 10:37:15 AM]

Share this post


Link to post
Share on other sites
How do you handle multiple render to textures with a deferred renderer?

eg. If you have cameras in your scene that link to monitors (render-to-textures), These Render-to-textures need a G-buffer with a resolution close to the output texture resolution. I could create a seperate G-buffer for each type of render target but that seems a little wasteful. I thought about rendering to a small section of the G-buffer or rendering to the whole G-buffer and then downsampling (again, seems wasteful) but nothing seems like a clear solution. Has anyone else had this problem or thought about it much?

Thanks again

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!