1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-13 16:44:50 +02:00

#15 WebGL NVIDIA workaround

This commit is contained in:
XProger
2018-03-04 14:43:01 +03:00
parent 639702ba28
commit 6c4c66c024

View File

@@ -165,7 +165,7 @@ uniform sampler2D sNormal;
vec4 caustics() {
float rOldArea = length(dFdx(vOldPos.xyz)) * length(dFdy(vOldPos.xyz));
float rNewArea = length(dFdx(vNewPos.xyz)) * length(dFdy(vNewPos.xyz));
rNewArea = max(rNewArea, 0.00002);
rNewArea = max(rNewArea, 0.00002); // WebGL NVIDIA workaround >_<
float value = clamp(rOldArea / rNewArea * 0.2, 0.0, 1.0) * vOldPos.w;
return vec4(value, 0.0, 0.0, 0.0);
}