Fixed a mistake in sem.frag: pow(x,y) is undefined when x < 0
This commit is contained in:
parent
5a9d53c572
commit
09869322af
3 changed files with 6 additions and 5 deletions
|
|
@ -14,7 +14,8 @@ 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));
|
||||
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.
Loading…
Add table
Add a link
Reference in a new issue