Skip to content

SOP Caustics

Following our cop-caustics implementation, here is a a SOP version.

Similar to how water 'lensing' focuses rays of light, we are 'sliding' our points (rays of light) by the slope of a noise function (in this case, simplex noise).

UPDATE! Sidefx included vex function xnoised which already provides us with a gradient (slope/derivative) output. This simplifies everything to just one function

VEXpression
float frequency = chf("frequency"); // 5
float focus = chf("focus")/frequency; //0.3
float speed = chf("speed"); // 0.2
vector dir; float n;
vector uv = v@P;
uv.y = @Time*speed;
xnoised(uv*frequency, n, dir.x, dir.y, dir.z);

v@P+= dir*focus*{1,0,1};
v@Cd = clamp(pow(n, 5)*5, 0, 1);

sop-caustics-1