Skip to content

Commit 59a054e

Browse files
committed
shaders: Normalize position in skinning structs.
1 parent f3b036b commit 59a054e

File tree

7 files changed

+5
-29
lines changed

7 files changed

+5
-29
lines changed

res/gamedata/shaders/gl/iostructs/v_model_bump.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11

22
out gl_PerVertex { vec4 gl_Position; };
33

4-
#ifdef SKIN_NONE
54
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
6-
#else
7-
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
8-
#endif
95
#ifdef SKIN_0
106
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
117
#else

res/gamedata/shaders/gl/iostructs/v_model_def.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ struct v2p
99
float4 hpos ; // SV_Position;
1010
};
1111

12-
#ifdef SKIN_NONE
1312
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
14-
#else
15-
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
16-
#endif
1713
#ifdef SKIN_0
1814
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
1915
#else

res/gamedata/shaders/gl/iostructs/v_model_distort.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ struct vf
1212
float4 hpos; // SV_Position;
1313
};
1414

15-
#ifdef SKIN_NONE
1615
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
17-
#else
18-
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
19-
#endif
2016
#ifdef SKIN_0
2117
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
2218
#else

res/gamedata/shaders/gl/iostructs/v_model_flat.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11

22
out gl_PerVertex { vec4 gl_Position; };
33

4-
#ifdef SKIN_NONE
54
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
6-
#else
7-
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
8-
#endif
95
#ifdef SKIN_0
106
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
117
#else

res/gamedata/shaders/gl/iostructs/v_model_shadow.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11

22
out gl_PerVertex { vec4 gl_Position; };
33

4-
#ifdef SKIN_NONE
54
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
6-
#else
7-
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
8-
#endif
95
#ifdef SKIN_0
106
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
117
#else

res/gamedata/shaders/gl/iostructs/v_model_shadow_aref.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11

22
out gl_PerVertex { vec4 gl_Position; };
33

4-
#ifdef SKIN_NONE
54
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
6-
#else
7-
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
8-
#endif
95
#ifdef SKIN_0
106
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
117
#else

res/gamedata/shaders/gl/skin.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55

66
struct v_model_skinned_0
77
{
8-
int4 P ; // POSITION; // (float,float,float,1) - quantized // short4
8+
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
99
float3 N ; // NORMAL; // normal // DWORD
1010
float3 T ; // TANGENT; // tangent // DWORD
1111
float3 B ; // BINORMAL; // binormal // DWORD
1212
int2 tc ; // TEXCOORD0;// (u,v) // short2
1313
};
1414
struct v_model_skinned_1 // 24 bytes
1515
{
16-
int4 P ; // POSITION; // (float,float,float,1) - quantized // short4
16+
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
1717
float4 N ; // NORMAL; // (nx,ny,nz,index) // DWORD
1818
float3 T ; // TANGENT; // tangent // DWORD
1919
float3 B ; // BINORMAL; // binormal // DWORD
2020
int2 tc ; // TEXCOORD0;// (u,v) // short2
2121
};
2222
struct v_model_skinned_2 // 28 bytes
2323
{
24-
int4 P ; // POSITION; // (float,float,float,1) - quantized // short4
24+
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
2525
float4 N ; // NORMAL; // (nx,ny,nz,weight) // DWORD
2626
float3 T ; // TANGENT; // tangent // DWORD
2727
float3 B ; // BINORMAL; // binormal // DWORD
@@ -30,7 +30,7 @@ struct v_model_skinned_2 // 28 bytes
3030

3131
struct v_model_skinned_3 // 28 bytes
3232
{
33-
int4 P ; // POSITION; // (float,float,float,1) - quantized // short4
33+
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
3434
float4 N ; // NORMAL; // (nx,ny,nz,weight0) // DWORD
3535
float4 T ; // TANGENT; // (tx,ty,tz,weight1) // DWORD
3636
float4 B ; // BINORMAL; // (bx,by,bz,m-index2) // DWORD
@@ -39,7 +39,7 @@ struct v_model_skinned_3 // 28 bytes
3939

4040
struct v_model_skinned_4 // 28 bytes
4141
{
42-
int4 P ; // POSITION; // (float,float,float,1) - quantized // short4
42+
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
4343
float4 N ; // NORMAL; // (nx,ny,nz,weight0) // DWORD
4444
float4 T ; // TANGENT; // (tx,ty,tz,weight1) // DWORD
4545
float4 B ; // BINORMAL; // (bx,by,bz,weight2) // DWORD

0 commit comments

Comments
 (0)