Fixed coordinate transformation for skybox and reflection objects

Matched HLSL and GLSL shaders
Fixes #757
This commit is contained in:
Sascha Willems 2020-08-28 21:15:13 +02:00
parent 1d815e6ced
commit 4e600f5943
11 changed files with 5 additions and 5 deletions

View file

@ -24,7 +24,7 @@ void main()
vec3 cR = reflect (cI, normalize(inNormal));
cR = vec3(ubo.invModel * vec4(cR, 0.0));
cR.y *= -1.0;
cR.yz *= -1.0;
vec4 color = textureLod(samplerCubeMapArray, vec4(cR, ubo.cubeMapIndex), ubo.lodBias);

View file

@ -16,5 +16,6 @@ layout (location = 0) out vec3 outUVW;
void main()
{
outUVW = inPos;
outUVW.yz *= -1.0f;
gl_Position = ubo.projection * ubo.model * vec4(inPos.xyz, 1.0);
}