Update spherical environment mapping shaders to reflect camera orientation for normals

This commit is contained in:
saschawillems 2016-03-02 21:13:23 +01:00
parent 70aa438b11
commit 10afc74051
2 changed files with 1 additions and 3 deletions

View file

@ -27,10 +27,8 @@ void main()
mat4 modelView = ubo.view * ubo.model;
outEyePos = normalize( vec3( modelView * inPos ) );
outTexIndex = ubo.texIndex;
// outNormal = normalize( mat3(ubo.normal) * inNormal );
outNormal = normalize(inNormal);
outNormal = normalize( mat3(ubo.normal) * inNormal );
vec3 r = reflect( outEyePos, outNormal );
float m = 2.0 * sqrt( pow(r.x, 2.0) + pow(r.y, 2.0) + pow(r.z + 1.0, 2.0));
//vN = r.xy / m + .5;
gl_Position = ubo.projection * modelView * inPos;
}