Fixed a mistake in sem.frag: pow(x,y) is undefined when x < 0

This commit is contained in:
Jaakko Konttinen 2016-02-22 14:06:35 -05:00
parent 5a9d53c572
commit 09869322af
3 changed files with 6 additions and 5 deletions

View file

@ -13,8 +13,9 @@ layout (location = 0) out vec4 outFragColor;
void main()
{
vec3 r = reflect( inEyePos, inNormal );
float m = 2.0 * sqrt( pow(r.x, 2.0) + pow(r.y, 2.0) + pow(r.z + 1.0, 2.0));
vec2 vN = r.xy / m + .5;
vec3 r = reflect( inEyePos, inNormal );
vec3 r2 = vec3( r.x, r.y, r.z + 1.0 );
float m = 2.0 * length( r2 );
vec2 vN = r.xy / m + .5;
outFragColor = vec4( texture( matCap, vN ).rgb * (clamp(inColor.r * 2, 0.0, 1.0)), 1.0 );
}

Binary file not shown.

Binary file not shown.