Skip to content

Commit

Permalink
Merge pull request #56 from ux3d/fix/toy_car_shadow
Browse files Browse the repository at this point in the history
apply ambient occlusion to all ibl light
  • Loading branch information
UX3D-labode authored Jan 13, 2021
2 parents efea3d3 + 42ddb3b commit 7e68c00
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Renderer/shaders/pbr.frag
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ void main()
#ifdef HAS_OCCLUSION_MAP
ao = texture(u_OcclusionSampler, getOcclusionUV()).r;
f_diffuse = mix(f_diffuse, f_diffuse * ao, u_OcclusionStrength);
// apply ambient occlusion too all lighting that is not punctual
f_specular = mix(f_specular, f_specular * ao, u_OcclusionStrength);
f_sheen = mix(f_sheen, f_sheen * ao, u_OcclusionStrength);
f_clearcoat = mix(f_clearcoat, f_clearcoat * ao, u_OcclusionStrength);
#endif

#ifdef USE_PUNCTUAL
Expand Down

0 comments on commit 7e68c00

Please sign in to comment.