Fixed coordinate transformation for skybox and reflection objects
Matched HLSL and GLSL shaders Fixes #757
This commit is contained in:
parent
1d815e6ced
commit
4e600f5943
11 changed files with 5 additions and 5 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -21,7 +21,7 @@ VSOutput main([[vk::location(0)]] float3 Pos : POSITION0)
|
|||
{
|
||||
VSOutput output = (VSOutput)0;
|
||||
output.UVW = Pos;
|
||||
output.UVW.y *= -1.0;
|
||||
output.UVW.yz *= -1.0;
|
||||
output.Pos = mul(ubo.projection, mul(ubo.model, float4(Pos.xyz, 1.0)));
|
||||
return output;
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue