Important comments for development.

This commit is contained in:
Jonathas Costa
2017-08-16 15:27:05 -04:00
parent 2b814a9704
commit d4cf4a5f22
3 changed files with 9 additions and 4 deletions
@@ -514,11 +514,12 @@ void main() {
//vec4 positionArray[8];
float maxAlpha = -1.0;
for (int i = 0; i < nAaSamples; i++) {
meanNormal += texelFetch(mainNormalTexture, ivec2(gl_FragCoord), i);
meanNormal += texelFetch(mainNormalTexture, ivec2(gl_FragCoord), i);
vec4 color = texelFetch(mainColorTexture, ivec2(gl_FragCoord), i);
if ( color.a > maxAlpha )
maxAlpha = color.a;
meanColor += color;
// Data in the mainPositionTexture are written in view space (view plus camera rig)
meanPosition += texelFetch(mainPositionTexture, ivec2(gl_FragCoord), i);
meanOtherData += texelFetch(otherDataTexture, ivec2(gl_FragCoord), i);
//positionArray[i] = texelFetch(mainPositionTexture, ivec2(gl_FragCoord), i);
@@ -110,7 +110,7 @@ void main() {
// Add the height in the direction of the normal
pair.position += pair.normal * height;
vec4 positionClippingSpace =
modelViewProjectionTransform * vec4(pair.position, 1);
modelViewProjectionTransform * vec4(pair.position, 1.0);
// Write output
fs_uv = in_uv;
@@ -118,5 +118,5 @@ void main() {
gl_Position = fs_position;
ellipsoidNormalCameraSpace = mat3(modelViewTransform) * pair.normal;
fs_normal = pair.normal;
positionCameraSpace = vec3(modelViewTransform * vec4(pair.position, 1));
positionCameraSpace = vec3(modelViewTransform * vec4(pair.position, 1.0));
}
@@ -206,11 +206,15 @@ Fragment getTileFragment() {
// Other data
#if USE_WATERMASK
// Water reflectance is added to the G-Buffer.
frag.gOtherData = vec4(waterReflectance, waterReflectance, waterReflectance, 1.0);
#else
frag.gOtherData = vec4(0.0, 0.0, 0.0, 1.0);
#endif
// Normal is written in Camera Rig (OS Eye) Space
// Normal is written Object Space.
// Right now the only renderable using this info is the atm and,
// because all calculation for light interactions are done in Object
// Space, we avoid a new computation saving the normals in Object Space.
frag.gNormal = vec4(normalModelSpace, 1.0);
frag.gPosition = vec4(positionCameraSpace, 1.0); // in Camera Rig Space