From what I understand, GLSL does not have constants like FLT_MAX.
Is there a way to ensure that a float represents the highest possible value without overflow?
EDIT:
Since I was asked the question that Im uses this for:
I basically scale the point to "infinity." Its for 2D shadow casting, where I completely change the shadow shadows of the triangle on the GPU. Since I can only control one vertex at a time, the w-component saves whether it remains on the body or is projected to infinity.
In the case where both points of the "border of the shadows" are the same edge, and the light is almost collinear with this edge, I need to make sure that the triangle still covers the entire screen. It is hard to describe.
kbirk source
share