8. Depth / Diffuse /
G - pass Normal
Specular Mask
L - pass Light Buffer
Merge
Additive
M - pass
Opacity
Post Effect
9. Depth / Diffuse /
Normal
Specular Mask
Light Buffer
Merge
Geometry Pass
Additive
Opacity
Post Effect
10. Usage Format R G B A
Nromal R16FG16F Normal X Normal Y
Depth, R16FG16F Linear Specular.
Specular Depth Rim
Diffuse, R8G8B8A8 Diffuse R Diffuse G Diffuse B Mask
Mask
25. // 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;
Image :killzone2 Code: GPU Gems3
26. vPos =
ray * depth;
(0 ~1)
epth
G-D
matt pettineo, dawn studio