Skip to content

Commit ba6010c

Browse files
committed
OpenGL Shaders: HQ Geometry fix by Shoker
1 parent b8cb425 commit ba6010c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

res/gamedata/shaders/gl/skin.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define SKIN_H
33

44
#include "common.h"
5-
5+
//RoH & SM+
66
struct v_model_skinned_0
77
{
88
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
@@ -49,7 +49,7 @@ struct v_model_skinned_4 // 28 bytes
4949

5050
//////////////////////////////////////////////////////////////////////////////////////////
5151

52-
float4 u_position (float4 v) { return float4(v.xyz*(12.f / 32768.f), 1.f); } // -12..+12
52+
float4 u_position (float4 v) { return float4(v.xyz, 1.f); } // -12..+12 //--#SM+#--
5353

5454
//////////////////////////////////////////////////////////////////////////////////////////
5555
//uniform float4 sbones_array [256-22] : register(vs,c22);
@@ -70,7 +70,7 @@ float3 skinning_dir (float3 dir, float4 m0, float4 m1, float4 m2)
7070
}
7171
float4 skinning_pos (float4 pos, float4 m0, float4 m1, float4 m2)
7272
{
73-
float4 P = float4(pos.xyz*(12.f / 32768.f), 1.f); // -12..+12
73+
float4 P = u_position(pos); // -12..+12 //--#SM+#--
7474
return float4
7575
(
7676
dot (m0, P),
@@ -89,11 +89,11 @@ v_model skinning_0 (v_model_skinned_0 v)
8989

9090
// skinning
9191
v_model o;
92-
o.P = float4(v.P.xyz*(12.f / 32768.f), 1.f); // -12..+12
92+
o.P = u_position(v.P); // -12..+12 //--#SM+#--
9393
o.N = unpack_normal(v.N);
9494
o.T = unpack_normal(v.T);
9595
o.B = unpack_normal(v.B);
96-
o.tc = v.tc *(16.f / 32768.f); // -16..+16
96+
o.tc = v.tc; // -16..+16 //--#SM+#--
9797
return o;
9898
}
9999
v_model skinning_1 (v_model_skinned_1 v)
@@ -115,7 +115,7 @@ v_model skinning_1 (v_model_skinned_1 v)
115115
o.N = skinning_dir(v.N.xyz, m0,m1,m2 );
116116
o.T = skinning_dir(v.T.xyz, m0,m1,m2 );
117117
o.B = skinning_dir(v.B.xyz, m0,m1,m2 );
118-
o.tc = v.tc *(16.f / 32768.f); // -16..+16
118+
o.tc = v.tc; // -16..+16 //--#SM+#--
119119
return o;
120120
}
121121
v_model skinning_2 (v_model_skinned_2 v)
@@ -147,7 +147,7 @@ v_model skinning_2 (v_model_skinned_2 v)
147147
o.N = skinning_dir(v.N.xyz, m0,m1,m2 );
148148
o.T = skinning_dir(v.T.xyz, m0,m1,m2 );
149149
o.B = skinning_dir(v.B.xyz, m0,m1,m2 );
150-
o.tc = v.tc.xy *(16.f / 32768.f); // -16..+16
150+
o.tc = v.tc.xy; // -16..+16 //--#SM+#--
151151
return o;
152152
}
153153
v_model skinning_3 (v_model_skinned_3 v)
@@ -193,7 +193,7 @@ v_model skinning_3 (v_model_skinned_3 v)
193193
o.N = skinning_dir(v.N.xyz, m0,m1,m2 );
194194
o.T = skinning_dir(v.T.xyz, m0,m1,m2 );
195195
o.B = skinning_dir(v.B.xyz, m0,m1,m2 );
196-
o.tc = v.tc.xy *(16.f / 32768.f); // -16..+16
196+
o.tc = v.tc.xy; // -16..+16 //--#SM+#--
197197
#ifdef SKIN_COLOR
198198
o.rgb_tint = float3 (2,0,0) ;
199199
if (id_0==id_1) o.rgb_tint = float3(1,2,0);
@@ -244,9 +244,9 @@ v_model skinning_4 (v_model_skinned_4 v)
244244
o.N = skinning_dir(v.N.xyz, m0,m1,m2 );
245245
o.T = skinning_dir(v.T.xyz, m0,m1,m2 );
246246
o.B = skinning_dir(v.B.xyz, m0,m1,m2 );
247-
o.tc = v.tc *(16.f / 32768.f); // -16..+16
247+
o.tc = v.tc; // -16..+16 //--#SM+#--
248248

249249
return o;
250250
}
251251

252-
#endif
252+
#endif

0 commit comments

Comments
 (0)