System Information
Blender Version
Broken: 2.78 4bb1e22
Short description of error
Currently, for k values less than 0 in the refract function, a vector of 0,0,0. This should return a reflection. In combination with fixing the Fresnel node with values under 1, this would allow for accurate total internal reflection.
Exact steps for others to reproduce the error
Create icosphere, set shading to smooth, assign refraction BSDF, view from inside sphere.
found at line 193 in stdosl.h
vector refract (vector I, vector N, float eta) {
float IdotN = dot (I, N);
float k = 1 - eta*eta * (1 - IdotN*IdotN);
return (k < 0) ? vector(0,0,0) : (eta*I - N * (eta*IdotN + sqrt(k)));
}correction should be something like
return (k < 0) ? reflect(I,N) : (eta*I - N * (eta*IdotN + sqrt(k)));