From 03a3b856d7419527511d2b56f44c1b5c91035973 Mon Sep 17 00:00:00 2001 From: Martin Felis Date: Fri, 14 Sep 2018 09:57:32 +0200 Subject: [PATCH] Forward rendering with simple shadow mapping works now. --- data/shaders/fs_default.glsl | 2 +- src/modules/RenderModule.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/shaders/fs_default.glsl b/data/shaders/fs_default.glsl index 01fd5a5..156d907 100644 --- a/data/shaders/fs_default.glsl +++ b/data/shaders/fs_default.glsl @@ -82,7 +82,7 @@ void main() { // diffuse lighting vec3 normal_dir = normalize(ioFragNormal); // vec3 light_dir = normalize(uLightDirection); - vec3 light_dir = transpose(inverse(mat3(uViewMatrix * uModelMatrix))) * uLightDirection; + vec3 light_dir = - transpose(inverse(mat3(uViewMatrix * uModelMatrix))) * uLightDirection; float diff = max(dot(normal_dir, light_dir), 0.0); vec4 diffuse = diff * albedo_color; diff --git a/src/modules/RenderModule.cc b/src/modules/RenderModule.cc index f588843..742a1ac 100644 --- a/src/modules/RenderModule.cc +++ b/src/modules/RenderModule.cc @@ -1141,9 +1141,9 @@ void Renderer::DrawGui() { switch (sRendererSettings.RenderMode) { case SceneRenderModeDefault: mRenderTextureRef.mTextureIdPtr = - &mRenderTarget.mColorTexture; +// &mRenderTarget.mColorTexture; // &mDeferredLightingTarget.mColorTexture; -// mUseDeferred ? &mDeferredLightingTarget.mColorTexture : &mRenderTarget.mColorTexture; + mUseDeferred ? &mDeferredLightingTarget.mColorTexture : &mRenderTarget.mColorTexture; break; case SceneRenderModeColor: mRenderTextureRef.mTextureIdPtr = &mRenderTarget.mColorTexture;