 # Compare refraction angel to TIR angle math problem

As maybe some has seen the thread, where i am try to build a absorptive clear coat layer.I have a problem to compare the refractive angle to the angle of Total internal reflection.

The reason to me could be only these three.

1. the assumed dot product is no cosine.
2.the refractive angle never exceed the angle of TIR.
3.something is wrong.

with the example of a IOR medium of 1.8 the TIR result would be 33.74°.
I can not think of ,that the refractive angle never gets over that " small " angle.

here some reference of the math
the assume that dot product is cosine

the simple math of TIR

The calc of the Refraction angle

all together as nodes you can see here,with a greater than node to mask the TIR if the refractive angle becomes larger as the TIR angle.

What is wrong or missing?the math seems correct to me.

edit ,here the curent calculated refractive angle, direct to the material output.

Cycles is not give you light angle. For trhis reason, you can not calculate TIR.

Thanks for reply.Yes i know.This calc should use the refractive angle (in the medium)that reflects back (should be the same angle) to compare with the TIR angle.

Incoming dot Normal = Reflected Ray between Camera Ray and Surface Normal. This is not same thing Refractive angle or TIR angle.

yes i know,we have no access to a incoming light source.however you can calculate how the shader gets calculated based on the normal/view point (dot product) as many other shaders.

For normal situation (reflection) yes, but for refraction, no. Refraction is totally based on light vector.

If you open Cycles source code, you can see how refraction calculates. They use light vector and for TIR sets 0 automatically.

This might be right,but as you say we have no access to the light source,but you can calculate a fresnel shader as example with its refractive calculation.

what i want to calculate here is the refractive angle based on view,not on light ray.to compare to the TIR angle thats all.

TIR is not equal Fresnel. TIR = TOTAL REFLECTION - EXTERNAL REFLECTION.

When you mix Refraction and Glossy with Fresnel = Refraction + Glossy (Internal) + Glossy (External).

Man i know,its Total internal reflection

No. Total Internal Reflection = Refraction Shader’s black areas.

Thats wrong.if the refractive ray gets reflected to a TIR than this can happen almost to infinte,see glass fibre.depends on the material ofcourse.

``````Glass = Refraction + Total Internal Reflection + External Reflection.

``````

For test, use Vray Refract (Reflection = Black) and Blender Glass shaders. Vray Refraction supports TIR. Comparison two result.

I dont want to compare render engines.thanks anyway.

Maybe @Secrop any idea whats missing for calculate refractive angle based on view. ?

Then ask to Secrop. I say you, you not have light vector and for this reason you cannot calculate TIR.

I surpassed this problem with fake method in my VSHADE system.

I dont want calc the TIR.I have the angle of the TIR allready.I want to calc a refractive angle based on view.

How you calculate this when you not know light vector? Formula is clear.

I have posted all reference math in the start post allready.

I studied all of this formulas before, for days.

If you don’t know ANGLE, then you can not calculate.

I have a angle lol

This angle is VIEW/CAMERA ANGLE, not LIGHT ANGLE.