From: Peter Schaefer Date: Tue, 28 Jun 2016 04:23:41 +0000 (+0200) Subject: BlackWhite by Death X-Git-Url: https://git.leopard-lacewing.eu/?a=commitdiff_plain;h=a54104fc56a696ddbd494df7c904f6aa9f3cb629;p=cgue_weave.git BlackWhite by Death --- 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);