Confusion about the Deferred Rendering

Nov 13, 2012 at 2:16 PM
Edited Nov 13, 2012 at 3:19 PM

I'm kinda confused - the GBuffer is an array and there's one for each possible mode/AA setting and they all get computed each frame,is this intended?1 more thing I wonder - so the material GBufferEffect should be used for every object in the scene,right?I mean except for the transparent ones,but the rest use this material to get drawn with the deferred shader inside it?I'm trying to understand it,cause I want to add a compute shader to it that is called once at the end of the frame and does the lighting calculations in the end.

Nov 14, 2012 at 3:12 AM

The GBuffer's for each mode/AA setting are not all computed every frame - only the currently selected one is.  Can you clarify which portion of the code you are looking at that indicates that they are all being updated every frame?  This would help me to clear up anything that might be not be obvious in the code...

Regarding the GBufferEffect, it all depends on which render view is being processed.  Each view has a unique ID, and the material allows for different effects to be used for different render views.  For example, if a view is generating a normal vector based gbuffer, you will use a different effect than if you are generating a depth map.  So it all depends on which render view you are talking about.

Nov 14, 2012 at 5:31 PM
Edited Nov 14, 2012 at 5:32 PM

Yeah I think I got it - I make an Effect and set it's ComputeShader to my light shader,then encapsulate it in a ###View structure,like your ViewLights?