File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/apps/ch11_voxel/ch11_voxel/resources/shaders Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ void main(void)
370370 // TODO: Address this expensive calculation. Should everything happen in world space?
371371 vec3 shadingNormal_world = mat3 (ub_cameraToWorld) * shadingNormal_view;
372372
373- float voxelAoFactor;
373+ float voxelAoFactor = 1 ;
374374
375375 LightContributions indirect =
376376 applyIndirectLight_pbr(position_aabb,
@@ -389,11 +389,12 @@ void main(void)
389389 * u_LightingFactors.w
390390 ;
391391
392-
393392 // Sum contributions
394393 // Note: the ambient term is a quick hack, to be removed when IBL is in place
395394 // We multiply it by the diffuse color, so metals do not have ambient terms, and dielectrics have their tint.
396- vec3 ambient = ub_AmbientColor.rgb * material.ambientColor.rgb * pbrParameters.diffuseColor;
395+ vec3 ambient = ub_AmbientColor.rgb * material.ambientColor.rgb
396+ * pbrParameters.diffuseColor
397+ * voxelAoFactor;
397398 vec3 diffuse = diffuseAccum * material.diffuseColor.rgb;
398399 vec3 specular = specularAccum * material.specularColor.rgb;
399400
You can’t perform that action at this time.
0 commit comments