From a54104fc56a696ddbd494df7c904f6aa9f3cb629 Mon Sep 17 00:00:00 2001 From: Peter Schaefer Date: Tue, 28 Jun 2016 06:23:41 +0200 Subject: [PATCH] BlackWhite by Death --- Weave/Scene/Scene.cpp | 3 +++ shader/lightingTexture_FS.hlsl | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Weave/Scene/Scene.cpp b/Weave/Scene/Scene.cpp index 51acf9a..76fc7b9 100644 --- a/Weave/Scene/Scene.cpp +++ b/Weave/Scene/Scene.cpp @@ -344,6 +344,9 @@ void Scene::draw() const Shader::getShader(SH_LIGHTING)->useShader(); dirLight->updateDirLightView(); shadowdir->getTexture()->useTexture(uPLightXP); + + Shader::getShader(SH_ACTIVE)->setUniformLocation("uBlackAWhite", !timeflow); + drawSceneObjects(); /*DRAW BBOX WIRES*/ diff --git a/shader/lightingTexture_FS.hlsl b/shader/lightingTexture_FS.hlsl index 00840d0..e2559d9 100644 --- a/shader/lightingTexture_FS.hlsl +++ b/shader/lightingTexture_FS.hlsl @@ -15,6 +15,7 @@ uniform vec4 material; //vec4 in the form (ambient, point, directional, glos uniform vec3 dirLightColor; uniform vec3 AmbientLightColor; uniform bool uAddGlow = false; +uniform bool uBlackAWhite = false; float DirLightCalcShadowFactor(vec4 LightSpacePos) { @@ -63,6 +64,9 @@ void main() else AddGlow = vec4(0.f); + if (uBlackAWhite) + FragColor = vec4(dot(FragColor.rgb, vec3(0.2126f, 0.7152f, 0.0722f)) * vec3(.6f, .3f, .3f), 1.f); + //FragColor = vec4((normalize(worldNormal)+1)/2, 1.0f); //FragColor = vec4(length(DirectionalLightDirection1) - 1.0f, length(DirectionalLightDirection1) - 1.0f, length(DirectionalLightDirection1) - 1.0f, 1.0f); -- 2.47.3