Get the latest tech news
Dissecting "Tiny Clouds" shadertoy (2017)
There is an amazing shadertoy called "Tiny Clouds" by stubbe (twitter: @Stubbesaurus) which flies you through nearly photorealistic clouds in only 10 lines of code / 280 characters (2 old sized tweets or 1 new larger sized tweet). The code is a bit dense, so I wanted to take some time to understand it and…
At every ray step, it samples FBM data (fractal brownian motion) to figure out if the current position is below the surface of the cloud or above it. Note that c.w is used to calculate O.w (O.a) but that the alpha channel of the output pixel value is currently ignored by shadertoy, so this is a meaningless by product of the code, not a desired feature. It’s worth noting that to get proper results you need to discretize your noise function into a grid and use bilinear interpolation between the values – mimicing what the texture read does.
Or read this on Hacker News