Fixed bug in color when rendering other object in front of atm.

This commit is contained in:
Jonathas Costa
2017-06-23 13:37:52 -04:00
parent bded8360e9
commit 4ddf98472a
2 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ return {
"lodglobes/earth",
--"lodglobes/mars",
--"lodglobes/moon",
"lodglobes/moon",
--"toyvolume",
--"earth",
@@ -558,7 +558,7 @@ void main() {
vec4 meanNormal = vec4(0.0);
vec4 meanPosition = vec4(0.0);
vec4 meanOtherData = vec4(0.0);
/*
//vec4 positionArray[nAaSamples];
//vec4 positionArray[8];
float maxAlpha = -1.0;
@@ -580,13 +580,14 @@ void main() {
//mainDepth /= nAaSamples;
meanColor.a = maxAlpha;
*/
/*
// Temporary:
meanNormal += texelFetch(mainNormalTexture, ivec2(gl_FragCoord), 0);
meanColor += texelFetch(mainColorTexture, ivec2(gl_FragCoord), 0);;
meanPosition += texelFetch(mainPositionTexture, ivec2(gl_FragCoord), 0);
meanOtherData += texelFetch(otherDataTexture, ivec2(gl_FragCoord), 0);
*/
// Ray in object space
dRay ray;
dvec4 planetPositionObjectCoords = dvec4(0.0);
@@ -633,7 +634,7 @@ void main() {
// when using their positions later, one must convert them to the planet's coords
if ((pixelDepth > 0.0) && pixelDepth < offset) {
renderTarget = vec4(HDR(meanColor.xyz), meanColor.a);
renderTarget = vec4(HDR(meanColor.xyz * backgroundExposure), meanColor.a);
} else {
// Following paper nomenclature
double t = offset;
@@ -747,7 +748,7 @@ void main() {
fragObjectCoords.xyz /= 1000.0;
if (meanPosition.xyz != vec3(0.0) && (pixelDepth < offset)) {
renderTarget = vec4(HDR(meanColor.xyz), meanColor.a);
renderTarget = vec4(HDR(meanColor.xyz * backgroundExposure), meanColor.a);
} else {
// Following paper nomenclature
double t = offset;