gl_FrontFacing (in GLSL)
Specifies in the shader whether the triangle being shaded is facing towards the camera or away from the camera.

Legal values and what they do:
true - the triangle faces towards the camera
false - the triangle faces away from the camera

Set in G3D by: N/A


backside (in shaders)
A variable in the shader meant to determine If the triangles is meant to be facing towards or away from the camera.

Legal values and what they do:
1 - meant to specify that the triangle's direction is to be used as it was passed in.
-1 - meant to specify the triangle's direction is to inverted.


Set in G3D by:
float backside = (gl_FrontFacing == InvertY) ? 1 : -1;

RenderDevice::invertY
A flag in RenderDevice to invert the Y axis of a scene. It is also repsonsible for switching the cull face and the winding direction of the triangles.

Legal values and what they do:
true - inverts the y axis of the scene by applying the inverty Y-axis matrix to the projection matrix. This matrix also switches the winding direction of the triangles.
false - when specified to be false it swaps the direction of the cull face swapped.

Set in G3D by:
set initial to be true when initializing new renderstate. Is then set by the function RenderDevice::setInvertY.

RenderDevice::cullFace
A gl_Flag that specifies whether front or back facing polygons are culled.

Legal values and what they do:
Front - front faces are culled during rendering
Back - back faces are culled during rendering
None - no faces are culled during rendering

Set in G3D by:
RenderDevice::setCullFace

glGet({GL_FRONT_FACE})
a gl flag that specifies whether triangle that wind clockwise or counter clock wise are considered front facing.

Legal values and what they do:
CCW - triangles that have a counter clockwise winding are considered front facing.
CW - triangles that have a clockwise winding are considered front facing

Set in G3D by:
glFrontFace(GLCW / GLCCW)

--------------------

This is what the G-buffer pass in Deferred Shading sample currently sets these values to:
gl_frontFacing - Not set by G3D but for all normal shading passes it returns false
backside - 1.0
InvertY - at the time of shading this is always false
CullFace - at render time is always set to cull back
Gl_FrontFace - CW

This is what the G-buffer pass does with our current cube map rendering:
gl_frontFacing - Not set by G3D but for the cube map pass it returns true
backside - -1.0
InvertY - at the time of shading this is always false
CullFace - at render time is always set to cull back.
Gl_FrontFace - CCW

Last edited Jul 20, 2015 at 4:39 PM by evangelakosd, version 8