From 97ac826e44c9fddeef3d87e512a93ceea2757777 Mon Sep 17 00:00:00 2001 From: Areloch Date: Wed, 9 Nov 2016 00:12:35 -0600 Subject: [PATCH] Corrects the specular handling as per Richard's suggestion in #1783 --- Templates/Empty/game/shaders/common/water/gl/waterP.glsl | 2 +- Templates/Empty/game/shaders/common/water/waterP.hlsl | 2 +- Templates/Full/game/shaders/common/water/gl/waterP.glsl | 2 +- Templates/Full/game/shaders/common/water/waterP.hlsl | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Templates/Empty/game/shaders/common/water/gl/waterP.glsl b/Templates/Empty/game/shaders/common/water/gl/waterP.glsl index a68ede84e..5f722282c 100644 --- a/Templates/Empty/game/shaders/common/water/gl/waterP.glsl +++ b/Templates/Empty/game/shaders/common/water/gl/waterP.glsl @@ -356,7 +356,7 @@ void main() // Get some specular reflection. vec3 newbump = bumpNorm; newbump.xy *= 3.5; - newbump = normalize( bumpNorm ); + newbump = normalize( newbump ); vec3 halfAng = normalize( eyeVec + -lightVec ); float specular = saturate( dot( newbump, halfAng ) ); specular = pow( specular, SPEC_POWER ); diff --git a/Templates/Empty/game/shaders/common/water/waterP.hlsl b/Templates/Empty/game/shaders/common/water/waterP.hlsl index ac66e9b28..d50c0b51c 100644 --- a/Templates/Empty/game/shaders/common/water/waterP.hlsl +++ b/Templates/Empty/game/shaders/common/water/waterP.hlsl @@ -343,7 +343,7 @@ float4 main( ConnectData IN ) : TORQUE_TARGET0 // Get some specular reflection. float3 newbump = bumpNorm; newbump.xy *= 3.5; - newbump = normalize( bumpNorm ); + newbump = normalize( newbump ); float3 halfAng = normalize( eyeVec + -lightVec ); float specular = saturate( dot( newbump, halfAng ) ); specular = pow( specular, SPEC_POWER ); diff --git a/Templates/Full/game/shaders/common/water/gl/waterP.glsl b/Templates/Full/game/shaders/common/water/gl/waterP.glsl index a68ede84e..5f722282c 100644 --- a/Templates/Full/game/shaders/common/water/gl/waterP.glsl +++ b/Templates/Full/game/shaders/common/water/gl/waterP.glsl @@ -356,7 +356,7 @@ void main() // Get some specular reflection. vec3 newbump = bumpNorm; newbump.xy *= 3.5; - newbump = normalize( bumpNorm ); + newbump = normalize( newbump ); vec3 halfAng = normalize( eyeVec + -lightVec ); float specular = saturate( dot( newbump, halfAng ) ); specular = pow( specular, SPEC_POWER ); diff --git a/Templates/Full/game/shaders/common/water/waterP.hlsl b/Templates/Full/game/shaders/common/water/waterP.hlsl index ac66e9b28..d50c0b51c 100644 --- a/Templates/Full/game/shaders/common/water/waterP.hlsl +++ b/Templates/Full/game/shaders/common/water/waterP.hlsl @@ -343,7 +343,7 @@ float4 main( ConnectData IN ) : TORQUE_TARGET0 // Get some specular reflection. float3 newbump = bumpNorm; newbump.xy *= 3.5; - newbump = normalize( bumpNorm ); + newbump = normalize( newbump ); float3 halfAng = normalize( eyeVec + -lightVec ); float specular = saturate( dot( newbump, halfAng ) ); specular = pow( specular, SPEC_POWER );