Project Rembrandt: Difference between revisions

Line 56: Line 56:
== Guidelines for shader writers ==
== Guidelines for shader writers ==
=== Predefined uniforms ===
=== Predefined uniforms ===
{|border="1" cellspacing="0" cellpadding="2"
!Name
!Type
!Purpose
|-
|planes
|vec3
|Used to convert the value of the depth buffer to a depth that can be used to compute the eye space position of the fragment
|-
|bufferSize
|vec2
|Dimensions of the buffer, used to convert gl_FragCoord into the range [0..1][0..1]
|}
=== Geometry Stage ===
=== Geometry Stage ===
The Geometry Stage is there to fill the G-buffer. Shading doesn't occur at this stage, so light or fog computation should not be part of the shader. The required operation in the Fragment Shader is to fill every individual buffer with sensible value :
The Geometry Stage is there to fill the G-buffer. Shading doesn't occur at this stage, so light or fog computation should not be part of the shader. The required operation in the Fragment Shader is to fill every individual buffer with sensible value :
269

edits