The cloud shader can cause performance issues on low-end devices. Here's an idea for optimizing it:
For any octaves, suppose the accumulated density is d, and the cut-off threshold is c. If d + \Sum_{k=0}^{\infty} {\frac{1}{2}}^k = d + \frac{1}{1-\frac{1}{2}} < c holds, then we immediately know that the density can never reach the threshold and therefore we can exit the loop early. Likewise, suppose the amplification factor is a, and if ad \geq 1 then we immediately know that any further accumulation will not affect the density.
The cloud shader can cause performance issues on low-end devices. Here's an idea for optimizing it:
For any octaves, suppose the accumulated density is
d
, and the cut-off threshold isc
. Ifd + \Sum_{k=0}^{\infty} {\frac{1}{2}}^k = d + \frac{1}{1-\frac{1}{2}} < c
holds, then we immediately know that the density can never reach the threshold and therefore we can exit the loop early. Likewise, suppose the amplification factor isa
, and ifad \geq 1
then we immediately know that any further accumulation will not affect the density.