Browse Source

Fix irradiance

Panagiotis Christopoulos Charitos 7 years ago
parent
commit
d45ba77b69
2 changed files with 8 additions and 1 deletions
  1. 5 0
      programs/GBufferPost.ankiprog
  2. 3 1
      programs/Irradiance.ankiprog

+ 5 - 0
programs/GBufferPost.ankiprog

@@ -87,6 +87,11 @@ void main()
 
 
 	// Process decals
 	// Process decals
 	uint count = u_lightIndices[idxOffset++];
 	uint count = u_lightIndices[idxOffset++];
+	if(count == 0)
+	{
+		discard;
+	}
+
 	while(count-- != 0)
 	while(count-- != 0)
 	{
 	{
 		Decal decal = u_decals[u_lightIndices[idxOffset++]];
 		Decal decal = u_decals[u_lightIndices[idxOffset++]];

+ 3 - 1
programs/Irradiance.ankiprog

@@ -20,6 +20,8 @@ http://www.anki3d.org/LICENSE
 
 
 			<source><![CDATA[
 			<source><![CDATA[
 // Compute the irradiance given an environment map
 // Compute the irradiance given an environment map
+// It's almost the same as http://www.codinglabs.net/article_physically_based_rendering.aspx
+// It's more bright though
 
 
 #include "shaders/Functions.glsl"
 #include "shaders/Functions.glsl"
 
 
@@ -69,7 +71,7 @@ void main()
 		}
 		}
 	}
 	}
 
 
-	out_color = outCol / weight * (2.0 * PI);
+	out_color = outCol / weight * PI;
 }
 }
 			]]></source>
 			]]></source>
 		</shader>
 		</shader>