Hi everyone!
I'm having a problem with a shader I wrote and was hoping someone here might be able to help me. Here's the code that gives me trouble:
vec3 refractedDirection = normalize(refract(ray, normal, eta2 / eta1));
float TIRfactor = 1.0; //-1 on total internal reflection
if(refractedDirection == 0)
TIRfactor = -1.0;
Note: The refract function returns the refracted vector or 0.0 in case of a total internal reflection.
This code compiles and runs just fine on machines with nVidia graphics cards. On a machine with an AMD graphics card however it fails to compile because of the comparison of a vec3 to a float in the if condition.
Is there any way to find out the type of the variable? I tried to google it but couldn't find one.