[iortcw] 240/497: All: Rend2: Change normal/tangent vertex encoding

2017-09-08 Thread Simon McVittie
This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 97068322694c6fa144e4214de54347751dd1d212
Author: m4n4t4...@gmail.com 

Date:   Sun Nov 2 14:39:08 2014 +

All: Rend2: Change normal/tangent vertex encoding
---
 MP/code/rend2/glsl/dlight_vp.glsl |   2 +-
 MP/code/rend2/glsl/fogpass_vp.glsl|   3 +-
 MP/code/rend2/glsl/generic_vp.glsl|   3 +-
 MP/code/rend2/glsl/lightall_vp.glsl   |   9 +--
 MP/code/rend2/glsl/pshadow_vp.glsl|   2 +-
 MP/code/rend2/glsl/shadowfill_vp.glsl |   1 -
 MP/code/rend2/tr_extensions.c |   4 +-
 MP/code/rend2/tr_vbo.c| 136 --
 SP/code/rend2/glsl/dlight_vp.glsl |   2 +-
 SP/code/rend2/glsl/fogpass_vp.glsl|   3 +-
 SP/code/rend2/glsl/generic_vp.glsl|   3 +-
 SP/code/rend2/glsl/lightall_vp.glsl   |   9 +--
 SP/code/rend2/glsl/pshadow_vp.glsl|   2 +-
 SP/code/rend2/glsl/shadowfill_vp.glsl |   1 -
 SP/code/rend2/tr_extensions.c |   4 +-
 SP/code/rend2/tr_vbo.c| 136 --
 16 files changed, 212 insertions(+), 108 deletions(-)

diff --git a/MP/code/rend2/glsl/dlight_vp.glsl 
b/MP/code/rend2/glsl/dlight_vp.glsl
index 9566a04..c326bd7 100644
--- a/MP/code/rend2/glsl/dlight_vp.glsl
+++ b/MP/code/rend2/glsl/dlight_vp.glsl
@@ -74,7 +74,7 @@ vec3 DeformPosition(const vec3 pos, const vec3 normal, const 
vec2 st)
 void main()
 {
vec3 position = attr_Position;
-   vec3 normal = attr_Normal * 2.0 - vec3(1.0);
+   vec3 normal = attr_Normal;
 
 #if defined(USE_DEFORM_VERTEXES)
position = DeformPosition(position, normal, attr_TexCoord0.st);
diff --git a/MP/code/rend2/glsl/fogpass_vp.glsl 
b/MP/code/rend2/glsl/fogpass_vp.glsl
index 6afc364..eec99de 100644
--- a/MP/code/rend2/glsl/fogpass_vp.glsl
+++ b/MP/code/rend2/glsl/fogpass_vp.glsl
@@ -108,10 +108,9 @@ void main()
 #if defined(USE_VERTEX_ANIMATION)
vec3 position = mix(attr_Position, attr_Position2, u_VertexLerp);
vec3 normal   = mix(attr_Normal,   attr_Normal2,   u_VertexLerp);
-   normal = normalize(normal - vec3(0.5));
 #else
vec3 position = attr_Position;
-   vec3 normal   = attr_Normal * 2.0 - vec3(1.0);
+   vec3 normal   = attr_Normal;
 #endif
 
 #if defined(USE_DEFORM_VERTEXES)
diff --git a/MP/code/rend2/glsl/generic_vp.glsl 
b/MP/code/rend2/glsl/generic_vp.glsl
index 60f6c99..8dc86d7 100644
--- a/MP/code/rend2/glsl/generic_vp.glsl
+++ b/MP/code/rend2/glsl/generic_vp.glsl
@@ -213,10 +213,9 @@ void main()
 #if defined(USE_VERTEX_ANIMATION)
vec3 position  = mix(attr_Position, attr_Position2, u_VertexLerp);
vec3 normal= mix(attr_Normal,   attr_Normal2,   u_VertexLerp);
-   normal = normalize(normal - vec3(0.5));
 #else
vec3 position  = attr_Position;
-   vec3 normal= attr_Normal * 2.0 - vec3(1.0);
+   vec3 normal= attr_Normal;
 #endif
 
 #if defined(USE_DEFORM_VERTEXES)
diff --git a/MP/code/rend2/glsl/lightall_vp.glsl 
b/MP/code/rend2/glsl/lightall_vp.glsl
index b9e839d..59051d7 100644
--- a/MP/code/rend2/glsl/lightall_vp.glsl
+++ b/MP/code/rend2/glsl/lightall_vp.glsl
@@ -167,11 +167,6 @@ void main()
   #endif
 #endif
 
-   normal  = normal  * 2.0 - vec3(1.0);
-#if defined(USE_VERT_TANGENT_SPACE) && defined(USE_LIGHT) && 
!defined(USE_FAST_LIGHT)
-   tangent = tangent * 2.0 - vec3(1.0);
-#endif
-
 #if defined(USE_TCGEN)
vec2 texCoords = GenTexCoords(u_TCGen0, position, normal, 
u_TCGen0Vector0, u_TCGen0Vector1);
 #else
@@ -195,13 +190,13 @@ void main()
 #endif
 
 #if defined(USE_VERT_TANGENT_SPACE) && defined(USE_LIGHT) && 
!defined(USE_FAST_LIGHT)
-   vec3 bitangent = cross(normal, tangent) * (attr_Tangent.w * 2.0 - 1.0);
+   vec3 bitangent = cross(normal, tangent) * attr_Tangent.w;
 #endif
 
 #if defined(USE_LIGHT_VECTOR)
vec3 L = u_LightOrigin.xyz - (position * u_LightOrigin.w);
 #elif defined(USE_LIGHT) && !defined(USE_FAST_LIGHT)
-   vec3 L = attr_LightDirection * 2.0 - vec3(1.0);
+   vec3 L = attr_LightDirection;
   #if defined(USE_MODELMATRIX)
L = (u_ModelMatrix * vec4(L, 0.0)).xyz;
   #endif
diff --git a/MP/code/rend2/glsl/pshadow_vp.glsl 
b/MP/code/rend2/glsl/pshadow_vp.glsl
index 0f9940c..07a4985 100644
--- a/MP/code/rend2/glsl/pshadow_vp.glsl
+++ b/MP/code/rend2/glsl/pshadow_vp.glsl
@@ -11,5 +11,5 @@ void main()
gl_Position = u_ModelViewProjectionMatrix * vec4(attr_Position, 1.0);
 
var_Position  = attr_Position;
-   var_Normal= attr_Normal * 2.0 - vec3(1.0);
+   var_Normal= attr_Normal;
 }
diff --git a/MP/code/rend2/glsl/shadowfill_vp.glsl 
b/MP/code/rend2/glsl/shadowfill_vp.glsl
index 7a5cc57..7de901b 100644
--- a/MP/code/rend2/glsl/shadowfill_vp.glsl
+++ b/MP/code/rend2/glsl/shadowfill_vp.glsl
@@ -80,7 +80,6 @@ void main()
 {
vec3 position  = 

[iortcw] 240/497: All: Rend2: Change normal/tangent vertex encoding

2016-09-21 Thread Simon McVittie
This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 97068322694c6fa144e4214de54347751dd1d212
Author: m4n4t4...@gmail.com 

Date:   Sun Nov 2 14:39:08 2014 +

All: Rend2: Change normal/tangent vertex encoding
---
 MP/code/rend2/glsl/dlight_vp.glsl |   2 +-
 MP/code/rend2/glsl/fogpass_vp.glsl|   3 +-
 MP/code/rend2/glsl/generic_vp.glsl|   3 +-
 MP/code/rend2/glsl/lightall_vp.glsl   |   9 +--
 MP/code/rend2/glsl/pshadow_vp.glsl|   2 +-
 MP/code/rend2/glsl/shadowfill_vp.glsl |   1 -
 MP/code/rend2/tr_extensions.c |   4 +-
 MP/code/rend2/tr_vbo.c| 136 --
 SP/code/rend2/glsl/dlight_vp.glsl |   2 +-
 SP/code/rend2/glsl/fogpass_vp.glsl|   3 +-
 SP/code/rend2/glsl/generic_vp.glsl|   3 +-
 SP/code/rend2/glsl/lightall_vp.glsl   |   9 +--
 SP/code/rend2/glsl/pshadow_vp.glsl|   2 +-
 SP/code/rend2/glsl/shadowfill_vp.glsl |   1 -
 SP/code/rend2/tr_extensions.c |   4 +-
 SP/code/rend2/tr_vbo.c| 136 --
 16 files changed, 212 insertions(+), 108 deletions(-)

diff --git a/MP/code/rend2/glsl/dlight_vp.glsl 
b/MP/code/rend2/glsl/dlight_vp.glsl
index 9566a04..c326bd7 100644
--- a/MP/code/rend2/glsl/dlight_vp.glsl
+++ b/MP/code/rend2/glsl/dlight_vp.glsl
@@ -74,7 +74,7 @@ vec3 DeformPosition(const vec3 pos, const vec3 normal, const 
vec2 st)
 void main()
 {
vec3 position = attr_Position;
-   vec3 normal = attr_Normal * 2.0 - vec3(1.0);
+   vec3 normal = attr_Normal;
 
 #if defined(USE_DEFORM_VERTEXES)
position = DeformPosition(position, normal, attr_TexCoord0.st);
diff --git a/MP/code/rend2/glsl/fogpass_vp.glsl 
b/MP/code/rend2/glsl/fogpass_vp.glsl
index 6afc364..eec99de 100644
--- a/MP/code/rend2/glsl/fogpass_vp.glsl
+++ b/MP/code/rend2/glsl/fogpass_vp.glsl
@@ -108,10 +108,9 @@ void main()
 #if defined(USE_VERTEX_ANIMATION)
vec3 position = mix(attr_Position, attr_Position2, u_VertexLerp);
vec3 normal   = mix(attr_Normal,   attr_Normal2,   u_VertexLerp);
-   normal = normalize(normal - vec3(0.5));
 #else
vec3 position = attr_Position;
-   vec3 normal   = attr_Normal * 2.0 - vec3(1.0);
+   vec3 normal   = attr_Normal;
 #endif
 
 #if defined(USE_DEFORM_VERTEXES)
diff --git a/MP/code/rend2/glsl/generic_vp.glsl 
b/MP/code/rend2/glsl/generic_vp.glsl
index 60f6c99..8dc86d7 100644
--- a/MP/code/rend2/glsl/generic_vp.glsl
+++ b/MP/code/rend2/glsl/generic_vp.glsl
@@ -213,10 +213,9 @@ void main()
 #if defined(USE_VERTEX_ANIMATION)
vec3 position  = mix(attr_Position, attr_Position2, u_VertexLerp);
vec3 normal= mix(attr_Normal,   attr_Normal2,   u_VertexLerp);
-   normal = normalize(normal - vec3(0.5));
 #else
vec3 position  = attr_Position;
-   vec3 normal= attr_Normal * 2.0 - vec3(1.0);
+   vec3 normal= attr_Normal;
 #endif
 
 #if defined(USE_DEFORM_VERTEXES)
diff --git a/MP/code/rend2/glsl/lightall_vp.glsl 
b/MP/code/rend2/glsl/lightall_vp.glsl
index b9e839d..59051d7 100644
--- a/MP/code/rend2/glsl/lightall_vp.glsl
+++ b/MP/code/rend2/glsl/lightall_vp.glsl
@@ -167,11 +167,6 @@ void main()
   #endif
 #endif
 
-   normal  = normal  * 2.0 - vec3(1.0);
-#if defined(USE_VERT_TANGENT_SPACE) && defined(USE_LIGHT) && 
!defined(USE_FAST_LIGHT)
-   tangent = tangent * 2.0 - vec3(1.0);
-#endif
-
 #if defined(USE_TCGEN)
vec2 texCoords = GenTexCoords(u_TCGen0, position, normal, 
u_TCGen0Vector0, u_TCGen0Vector1);
 #else
@@ -195,13 +190,13 @@ void main()
 #endif
 
 #if defined(USE_VERT_TANGENT_SPACE) && defined(USE_LIGHT) && 
!defined(USE_FAST_LIGHT)
-   vec3 bitangent = cross(normal, tangent) * (attr_Tangent.w * 2.0 - 1.0);
+   vec3 bitangent = cross(normal, tangent) * attr_Tangent.w;
 #endif
 
 #if defined(USE_LIGHT_VECTOR)
vec3 L = u_LightOrigin.xyz - (position * u_LightOrigin.w);
 #elif defined(USE_LIGHT) && !defined(USE_FAST_LIGHT)
-   vec3 L = attr_LightDirection * 2.0 - vec3(1.0);
+   vec3 L = attr_LightDirection;
   #if defined(USE_MODELMATRIX)
L = (u_ModelMatrix * vec4(L, 0.0)).xyz;
   #endif
diff --git a/MP/code/rend2/glsl/pshadow_vp.glsl 
b/MP/code/rend2/glsl/pshadow_vp.glsl
index 0f9940c..07a4985 100644
--- a/MP/code/rend2/glsl/pshadow_vp.glsl
+++ b/MP/code/rend2/glsl/pshadow_vp.glsl
@@ -11,5 +11,5 @@ void main()
gl_Position = u_ModelViewProjectionMatrix * vec4(attr_Position, 1.0);
 
var_Position  = attr_Position;
-   var_Normal= attr_Normal * 2.0 - vec3(1.0);
+   var_Normal= attr_Normal;
 }
diff --git a/MP/code/rend2/glsl/shadowfill_vp.glsl 
b/MP/code/rend2/glsl/shadowfill_vp.glsl
index 7a5cc57..7de901b 100644
--- a/MP/code/rend2/glsl/shadowfill_vp.glsl
+++ b/MP/code/rend2/glsl/shadowfill_vp.glsl
@@ -80,7 +80,6 @@ void main()
 {
vec3 position  =