Browse Source

Fix bug with 2nd bounce

Panagiotis Christopoulos Charitos 6 years ago
parent
commit
f578e7479e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      shaders/IrradianceDice.glslp

+ 2 - 2
shaders/IrradianceDice.glslp

@@ -14,7 +14,7 @@
 #include <shaders/LightFunctions.glsl>
 
 #define DEBUG_MODE 0 // 0: disable, 1: different color per dice face, 2: different color per cell
-#define SECOND_BOUNCE 0
+#define SECOND_BOUNCE 1
 
 layout(local_size_x = INPUT_TEXTURES_HEIGHT, local_size_y = INPUT_TEXTURES_HEIGHT, local_size_z = 1) in;
 
@@ -129,7 +129,7 @@ void main()
 		// Compute 2nd bounce
 		const Vec3 lightShading = textureLod(u_lightShadingTex, u_nearestAnyClampSampler, uv, 0.0).rgb;
 		const Vec3 irradiance =
-			firstBounceIrradiance + lightShading * lambert * cubeCoordSolidAngle(ndc, INPUT_TEXTURES_HEIGHT_F);
+			(firstBounceIrradiance + lightShading * lambert) * cubeCoordSolidAngle(ndc, INPUT_TEXTURES_HEIGHT_F);
 
 		// Store
 		u_integrationResults[f][gl_LocalInvocationID.y * INPUT_TEXTURES_HEIGHT + gl_LocalInvocationID.x] =