top of page

God-ray Shader

The first part is using the object's world position to dot product the camera. Therefore, when we look at the top of the plane, which means the camera director is at the right angle to the object. The dot product will return 0.

When two vectors are at right angles to each other the dot product is zero.

Example: calculate the Dot Product for:

 

a · b = | of | × | b | × cos (θ)

a · b = |a| × |b| × cos(90°)

a · b = |a| × |b| × 0

a · b = 0

So that we can avoid the player see the right angle to the plane.

The second part is SplineThicken. This node makes a plane looks like we always facing it. 

bottom of page