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

@ -25,11 +25,11 @@ struct VSOutput
float4 main(VSOutput input) : SV_TARGET
{
float3 cI = normalize (input.ViewVec);
float3 cI = normalize (input.Pos);
float3 cR = reflect (cI, normalize(input.Normal));
cR = mul(ubo.invModel, float4(cR, 0.0)).xyz;
cR *= float3(-1.0, 1.0, -1.0);
cR *= float3(1.0, -1.0, -1.0);
float4 color = textureCubeMapArray.SampleLevel(samplerCubeMapArray, float4(cR, ubo.cubeMapIndex), input.LodBias);