From 8407a34c37b5b8f3278d4e6e6beb20683c3d13e8 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Mon, 19 Oct 2020 12:48:32 -0700 Subject: [PATCH] flip horizontal UVs of cubemap render --- Effects/FXB/LinearDepthEffect.fxb | 4 ++-- Effects/HLSL/LinearDepthEffect.fx | 1 + Renderer.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Effects/FXB/LinearDepthEffect.fxb b/Effects/FXB/LinearDepthEffect.fxb index f805053..c92681f 100644 --- a/Effects/FXB/LinearDepthEffect.fxb +++ b/Effects/FXB/LinearDepthEffect.fxb @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9509896b7532c6ecf77aef4e575a7bceb8a106f4ad0c1a9c11a1608c9807cc10 -size 1332 +oid sha256:2e91546d1db9b0bb2eb93ab2dcdeaaa260c5eb08d9acf6460c091f8fdf4c88ee +size 1344 diff --git a/Effects/HLSL/LinearDepthEffect.fx b/Effects/HLSL/LinearDepthEffect.fx index 164da5b..67db0e2 100644 --- a/Effects/HLSL/LinearDepthEffect.fx +++ b/Effects/HLSL/LinearDepthEffect.fx @@ -25,6 +25,7 @@ VertexShaderOutput main_vs(VertexShaderInput input) { VertexShaderOutput output; output.Position = mul(input.Position, ModelViewProjection); + output.Position.x *= -1; // otherwise cube map render will be horizontally flipped output.PositionWorld = mul(input.Position, Model); return output; } diff --git a/Renderer.cs b/Renderer.cs index 27b4b1b..67372c8 100644 --- a/Renderer.cs +++ b/Renderer.cs @@ -276,7 +276,7 @@ namespace Kav TextureCube skybox ) { GraphicsDevice.RasterizerState.CullMode = CullMode.CullClockwiseFace; - SkyboxEffect.Skybox = skybox; + SkyboxEffect.Skybox = PointShadowCubeMap; var view = camera.View; view.Translation = Vector3.Zero;