Hello! I'm working on a deferred rendering engine ( lighting ) for my game. The approach is really simple :
- Set up multiple render targets for color,specular,depth etc.. (GBuffer)
- Draw geometry
- Resolve render targets ( GBuffer)
- Draw lights
I'm drawing the geometry with the GBuffer shader whose pixel shader returns the different render target values, but what if i wanted to use "custom" shaders for the geometry that don't return the values for the multiple render targets : the "normal" shaders.
My idea would be :
- Draw geometry with "normal" shaders to a render target
- Set up multiple render targets (GBuffer)
- Draw the previously rendered scene once again
- Resolve render targets (GBuffer)
- Draw lights
This approach shouldn't be very memory expensive and seems quite simple, but i'm interested in knowing how other people tackled this problem and if there are "better" solutions. If my idea is completely wrong please tell me!
Thank you for your time and happy coding!