From a92e90a3f265876e7bacd4bb35dda880952b9965 Mon Sep 17 00:00:00 2001 From: LockedLunatic Date: Sat, 9 May 2015 23:26:34 +0200 Subject: [PATCH] shader is a bit better --- shader/basicTexture_VS.hlsl | 2 +- shader/lightingTexture_FS.hlsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/shader/basicTexture_VS.hlsl b/shader/basicTexture_VS.hlsl index 26f907a..aed3112 100644 --- a/shader/basicTexture_VS.hlsl +++ b/shader/basicTexture_VS.hlsl @@ -26,6 +26,6 @@ void main() worldPointLightDir1 = PointLightPosition1 - world_Position.xyz; gl_Position = uProjection * uView * world_Position; - worldNormal = (uModel * vec4(aNormal, 0.0f)).xyz; + worldNormal = normalize((uModel * vec4(aNormal, 0.0f)).xyz); cameraVec = normalize(cameraPos - world_Position.xyz); } \ No newline at end of file diff --git a/shader/lightingTexture_FS.hlsl b/shader/lightingTexture_FS.hlsl index 8a2599f..8ec4fe8 100644 --- a/shader/lightingTexture_FS.hlsl +++ b/shader/lightingTexture_FS.hlsl @@ -47,7 +47,7 @@ void main() ), uvColor.a); - //FragmentColor = vec4(worldNormal, 1.0f); + //FragmentColor = vec4((normalize(worldNormal) + 1) / 2, 1.0f); //FragmentColor = vec4(length(DirectionalLightDirection1) - 1.0f, length(DirectionalLightDirection1) - 1.0f, length(DirectionalLightDirection1) - 1.0f, 1.0f); //vec3 uvColor = texture(uColorTexture, fUVs).rgb; -- 2.47.3