Ich beschäftige mich zur Zeit mit der Deferred Lightning Technik und hab dazu ein paar Artikel/Tutorials durchgelesen. Ich fand dieses (http://www.ziggyware.com/readarticle.ph ... rowstart=1) ziemlich gut verständlich und hab dazu eine Frage
In dem Tutorial steht das man vorm Rendern der Szene ind en einzelnen render Targets ersteinmal den G-Buffer clearen soll
dazu gab es diesen code
Code: Alles auswählen
struct VertexShaderInput
{
float3 Position : POSITION0;
};
struct VertexShaderOutput
{
float4 Position : POSITION0;
};
VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
VertexShaderOutput output;
output.Position = float4(input.Position,1);
return output;
}
struct PixelShaderOutput
{
float4 Color : COLOR0;
float4 Normal : COLOR1;
float4 Depth : COLOR2;
};
PixelShaderOutput PixelShaderFunction(VertexShaderOutput input)
{
PixelShaderOutput output;
//black color
output.Color = 0.0f;
output.Color.a = 0.0f;
//when transforming 0.5f into [-1,1], we will get 0.0f
output.Normal.rgb = 0.5f;
//no specular power
output.Normal.a = 0.0f;
//max depth
output.Depth = 1.0f;
return output;
}
Ist das irgendwie möglich?