G-buffer Linear Depth.XDepth's sign = Normal Z's sign
[Sign] Integer . Fractional
G-buffer Depth.Y3 values in 1 channel
Rim : 0,1
Specular Glossiness : 1 ~ 100
Specular Level : 0 ~ 0.99
A : Mask
G-buffer Diffuse.RGB
Decal
Screen Space Decal
vProjcoord = mul( vPos, mxViewToDecal)
Image : Effects Techniques Used in Uncharted 3, GDC12
G-buffer Diffuse.A
Normal Depth /Specular
Diffuse /Mask
Light Buffer
Merge
Post Effect
Opacity
AdditiveLight Pass
Reconstructing Position from depth
for Lighting
G-Depth
Image :killzone2 Code: GPU Gems3
// Get the depth buffer value at this pixel. float zOverW = tex2D(depthTexture, texCoord); // H is the viewport position at this pixel in the range -1 to 1. float4 H = float4(texCoord.x*2-1, (1-texCoord.y)*2-1,zOverW, 1); // Transform by the view-projection inverse. float4 D = mul(H, g_ViewProjectionInverseMatrix); // Divide by w to get the world position. float4 worldPos = D / D.w;
matt pettineo, dawn studio
G-Depth ( 0~1)
vPos = ray * depth;
float3 ray = FarTopRight;ray.xy = lerp(-FarTopRight.xy, FarTopRight.xy, scrUV);float depth = tex2D(DepthBuffer, scrUV);float3 PosInView = ray * depth;