Hello, I have some trouble understanding how the basic structure of a deferred rendering solution should be.
So this is pretty much where I am.
I have one shader with 3 Targets
struct PSOutput
{
float4 Color : SV_Target0;
float3 Normal : SV_Target1;
float3 Specular : SV_Target2;
};
I feel them with stuff. (I can see the different targets in my program as textures and they all look fine).
output.Color = diffuse*txDiffuse.Sample(samLinear, input.texcoord);
output.Normal = input.normal;
output.Specular = specular;
But now the tricky part. If i have understand this correctly I need to send this values in to another shader that does the "deferred lighting calculation", I dont really care about the "calculation" part right now, Im mainly interested in how to structure this. How do I use/transfer this Targets in to the "light calculation shader". And do I need render the scene twice, first with basic shader above and then a second time with the "light calculation shader"?
Im using Directx11 so any sample in dx11 is much appreciated.