perf: reduce cloud shadow samples
This commit is contained in:
1 parent
99ca1b069c
commit
96161b1f9e
1 file changed
+3
-2
Vendored
+3
-2
@@ -1053,10 +1053,11 @@ var TERRAIN_FRAG_SRC = [
|
||||
'if (tBot > 1e8) { tBot = 0.0; tTop = 14.0; }',
|
||||
'if (tTop > 0.0 && tTop > tBot && tTop < 90.0) {',
|
||||
'float dens = 0.0;',
|
||||
'for (int ci = 0; ci < 5; ci++) {',
|
||||
'float tt = mix(tBot, tTop, (float(ci) + 0.5) / 5.0);',
|
||||
'for (int ci = 0; ci < 3; ci++) {',
|
||||
'float tt = mix(tBot, tTop, (float(ci) + 0.5) / 3.0);',
|
||||
'dens += cloudDensity(vWorld + uSunDir * tt, baseTh, smoothstep(4.0, 18.0, tt));',
|
||||
'}',
|
||||
'dens *= 5.0 / 3.0;',
|
||||
'cShadow = mix(uCloudShadowFloor, 1.0,',
|
||||
' exp(-dens * uCloudShadowDensity));',
|
||||
'}',
|
||||
|
||||
Reference in new issue
Block a user