Commits

davep committed f3f70d8

SH-2120 Better fix for water being very dark when basic shaders disabled (sinA might be negative)

Comments (0)

Files changed (1)

indra/newview/llvosky.cpp

 {
 	// project the direction ray onto the sky dome.
 	F32 phi = acos(Pn[1]);
-	F32 sinA = llmax(sin(F_PI - phi), 0.01f);
+	F32 sinA = sin(F_PI - phi);
+	if (fabsf(sinA) < 0.01f)
+	{ //avoid division by zero
+		sinA = 0.01f;
+	}
+
 	F32 Plen = dome_radius * sin(F_PI + phi + asin(dome_offset_ratio * sinA)) / sinA;
 
 	Pn *= Plen;