Skip to content

Instantly share code, notes, and snippets.

@stoyannk
Created October 18, 2012 12:53
Show Gist options
  • Save stoyannk/3911618 to your computer and use it in GitHub Desktop.
Save stoyannk/3911618 to your computer and use it in GitHub Desktop.
Simple enhanced gbuffer pixel shader
polymorphic MakeDepth
{
CalculateProjectionDepth
}
polymorphic GetWorldNormal
{
NormalFromInput,
NormalFromMap
}
pixel_shader float4 PS(PS_INPUT input) : SV_Target needs VERTEX_COLOR
{
context.depth_p = MakeDepth();
context.normal_w = GetWorldNormal();
return float4(context.normal_w.x
, context.normal_w.y
, context.normal_w.z
, context.depth_p);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment