#include "rmannotes.sl" displacement glassblock(float freq = 2, Km = .065) { float surface_mag, layer_mag; float ss, tt; point diff_N, tmpP; surface_mag = 1; /* texture blocks */ ss = repeat(s, freq); tt = repeat(t, freq); layer_mag = texture("glassblock.tx", ss,tt); surface_mag += layer_mag; diff_N = normalize(N) - normalize(Ng); P += -Km * surface_mag * normalize(N); N = normalize(calculatenormal(P)) + diff_N; }