VEX 3D Texture Cloud shader

This surface shader uses a 3D texture image to generate clouds.

This surface shader uses a 3D texture image to generate clouds. This is done by ray-marching through the 3D texture, computing the illumination at each point and adding up the cloud density to come up with a final surface opacity. The ray-marching is controlled by the stepsize and maximum steps parameters. Smaller step sizes will result in higher quality clouds. Larger step sizes will render faster. When computing illumination, turning on object shadows will cause other objects in the scene to cast shadows onto the clouds. Self shadowing will cause the cloud to shadow itself. The appearance of the cloud is controlled by the color, ambient color, density and shadow density parameters. Adaptive step sampling will cause the step-size to be based on the density of the 3d texture map. For sparse areas of the texture, the step size will be larger, while for denser areas of the map, the step size will be smaller. This means that smaller details will be more likely to be picked up properly by adaptive step integration.

Ideally, the geometry for this object would be a box with the same dimensions as the 3D texture map. There may be artifacts if the geometry intersects with any other objects as the ray-marching will not take this into account.

Usages in other examples

Example name Example for