fix(draw): avoid zero division
This commit is contained in:
parent
98da38e1da
commit
b7ee51167f
@ -59,7 +59,7 @@ vec3 Radiosity_Map(float detailAmbientOcclusion, float ssao) {
|
||||
|
||||
// ambient occlusion
|
||||
vec2 ambTexVal = texture3D(ambientShadowTexture, ambientShadowTextureCoord).xy;
|
||||
float amb = ambTexVal.x / ambTexVal.y;
|
||||
float amb = ambTexVal.x / (ambTexVal.y + 1.0e-12);
|
||||
amb = max(amb, 0.); // for some reason, mainTexture value becomes negative
|
||||
|
||||
// mix ambient occlusion values generated by two different methods somehow
|
||||
|
@ -60,7 +60,7 @@ vec3 Radiosity_Map(float detailAmbientOcclusion, float ssao) {
|
||||
|
||||
// ambient occlusion
|
||||
vec2 ambTexVal = texture3D(ambientShadowTexture, ambientShadowTextureCoord).xy;
|
||||
float amb = ambTexVal.x / ambTexVal.y;
|
||||
float amb = ambTexVal.x / (ambTexVal.y + 1.0e-12);
|
||||
amb = max(amb, 0.); // by some reason, mainTexture value becomes negative
|
||||
|
||||
// mix ambient occlusion values generated by two different methods somehow
|
||||
|
Loading…
x
Reference in New Issue
Block a user