float uvscale = 1;
float s = u*uvscale;
float t = 1.0-v*uvscale;
float a = 7.68;
float b = 0.165;
float height = a*exp(-((s-0.5)*(s-0.5)+(t-0.5)*(t-0.5))/b); //Gaussian
float dHdX = Dx(height);
float dHdY = Dy(height);
It works!
I'm curious, is that numerical derivation (ie the OSL compiled code does recompute height with slightly offset u and v values obtained from dudx, etc... derivatives), or are math functions such as exp analytically derivative-aware?
Thanks!