Skip to content

Commit eb7dbfc

Browse files
committed
shaders: Always use floating points for texture coordinates.
1 parent a1e13c8 commit eb7dbfc

File tree

10 files changed

+30
-42
lines changed

10 files changed

+30
-42
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ layout(location = BINORMAL) in float4 v_model_B ; // BINORMAL; // (nx,ny,nz,w
1414
layout(location = TANGENT) in float3 v_model_T ; // TANGENT; // (nx,ny,nz)
1515
layout(location = BINORMAL) in float3 v_model_B ; // BINORMAL; // (nx,ny,nz)
1616
#endif
17-
#ifdef SKIN_NONE
18-
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
19-
#elif defined(SKIN_2) || defined(SKIN_3)
20-
layout(location = TEXCOORD0) in int4 v_model_tc ; // TEXCOORD0; // (u,v)
17+
#if defined(SKIN_2) || defined(SKIN_3)
18+
layout(location = TEXCOORD0) in float4 v_model_tc ; // TEXCOORD0; // (u,v)
2119
#else
22-
layout(location = TEXCOORD0) in int2 v_model_tc ; // TEXCOORD0; // (u,v)
20+
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
2321
#endif
2422
#ifdef SKIN_4
2523
layout(location = TEXCOORD1) in float4 v_model_ind ; // (x=m-index0, y=m-index1, z=m-index2, w=m-index3)

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ layout(location = BINORMAL) in float4 v_model_B ; // BINORMAL; // (nx,ny,nz,w
2222
layout(location = TANGENT) in float3 v_model_T ; // TANGENT; // (nx,ny,nz)
2323
layout(location = BINORMAL) in float3 v_model_B ; // BINORMAL; // (nx,ny,nz)
2424
#endif
25-
#ifdef SKIN_NONE
26-
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
27-
#elif defined(SKIN_2) || defined(SKIN_3)
28-
layout(location = TEXCOORD0) in int4 v_model_tc ; // TEXCOORD0; // (u,v)
25+
#if defined(SKIN_2) || defined(SKIN_3)
26+
layout(location = TEXCOORD0) in float4 v_model_tc ; // TEXCOORD0; // (u,v)
2927
#else
30-
layout(location = TEXCOORD0) in int2 v_model_tc ; // TEXCOORD0; // (u,v)
28+
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
3129
#endif
3230
#ifdef SKIN_4
3331
layout(location = TEXCOORD1) in float4 v_model_ind ; // (x=m-index0, y=m-index1, z=m-index2, w=m-index3)

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,10 @@ layout(location = BINORMAL) in float4 v_model_B ; // BINORMAL; // (nx,ny,nz,w
2525
layout(location = TANGENT) in float3 v_model_T ; // TANGENT; // (nx,ny,nz)
2626
layout(location = BINORMAL) in float3 v_model_B ; // BINORMAL; // (nx,ny,nz)
2727
#endif
28-
#ifdef SKIN_NONE
29-
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
30-
#elif defined(SKIN_2) || defined(SKIN_3)
31-
layout(location = TEXCOORD0) in int4 v_model_tc ; // TEXCOORD0; // (u,v)
28+
#if defined(SKIN_2) || defined(SKIN_3)
29+
layout(location = TEXCOORD0) in float4 v_model_tc ; // TEXCOORD0; // (u,v)
3230
#else
33-
layout(location = TEXCOORD0) in int2 v_model_tc ; // TEXCOORD0; // (u,v)
31+
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
3432
#endif
3533
#ifdef SKIN_4
3634
layout(location = TEXCOORD1) in float4 v_model_ind ; // (x=m-index0, y=m-index1, z=m-index2, w=m-index3)

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ layout(location = BINORMAL) in float4 v_model_B ; // BINORMAL; // (nx,ny,nz,w
1414
layout(location = TANGENT) in float3 v_model_T ; // TANGENT; // (nx,ny,nz)
1515
layout(location = BINORMAL) in float3 v_model_B ; // BINORMAL; // (nx,ny,nz)
1616
#endif
17-
#ifdef SKIN_NONE
18-
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
19-
#elif defined(SKIN_2) || defined(SKIN_3)
20-
layout(location = TEXCOORD0) in int4 v_model_tc ; // TEXCOORD0; // (u,v)
17+
#if defined(SKIN_2) || defined(SKIN_3)
18+
layout(location = TEXCOORD0) in float4 v_model_tc ; // TEXCOORD0; // (u,v)
2119
#else
22-
layout(location = TEXCOORD0) in int2 v_model_tc ; // TEXCOORD0; // (u,v)
20+
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
2321
#endif
2422
#ifdef SKIN_4
2523
layout(location = TEXCOORD1) in float4 v_model_ind ; // (x=m-index0, y=m-index1, z=m-index2, w=m-index3)

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ layout(location = BINORMAL) in float4 v_model_B ; // BINORMAL; // (nx,ny,nz,w
1414
layout(location = TANGENT) in float3 v_model_T ; // TANGENT; // (nx,ny,nz)
1515
layout(location = BINORMAL) in float3 v_model_B ; // BINORMAL; // (nx,ny,nz)
1616
#endif
17-
#ifdef SKIN_NONE
18-
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
19-
#elif defined(SKIN_2) || defined(SKIN_3)
20-
layout(location = TEXCOORD0) in int4 v_model_tc ; // TEXCOORD0; // (u,v)
17+
#if defined(SKIN_2) || defined(SKIN_3)
18+
layout(location = TEXCOORD0) in float4 v_model_tc ; // TEXCOORD0; // (u,v)
2119
#else
22-
layout(location = TEXCOORD0) in int2 v_model_tc ; // TEXCOORD0; // (u,v)
20+
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
2321
#endif
2422
#ifdef SKIN_4
2523
layout(location = TEXCOORD1) in float4 v_model_ind ; // (x=m-index0, y=m-index1, z=m-index2, w=m-index3)

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ layout(location = BINORMAL) in float4 v_model_B ; // BINORMAL; // (nx,ny,nz,w
1414
layout(location = TANGENT) in float3 v_model_T ; // TANGENT; // (nx,ny,nz)
1515
layout(location = BINORMAL) in float3 v_model_B ; // BINORMAL; // (nx,ny,nz)
1616
#endif
17-
#ifdef SKIN_NONE
18-
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
19-
#elif defined(SKIN_2) || defined(SKIN_3)
20-
layout(location = TEXCOORD0) in int4 v_model_tc ; // TEXCOORD0; // (u,v)
17+
#if defined(SKIN_2) || defined(SKIN_3)
18+
layout(location = TEXCOORD0) in float4 v_model_tc ; // TEXCOORD0; // (u,v)
2119
#else
22-
layout(location = TEXCOORD0) in int2 v_model_tc ; // TEXCOORD0; // (u,v)
20+
layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v)
2321
#endif
2422
#ifdef SKIN_4
2523
layout(location = TEXCOORD1) in float4 v_model_ind ; // (x=m-index0, y=m-index1, z=m-index2, w=m-index3)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ out gl_PerVertex { vec4 gl_Position; };
44
struct a2v
55
{
66
float4 P ; // POSITION; // Object-space position
7-
int2 tc0 ; // TEXCOORD0; // Texture coordinates
7+
float2 tc0 ; // TEXCOORD0; // Texture coordinates
88
};
99

1010
layout(location = NORMAL) in float4 v_static_Nh ; // NORMAL; // (nx,ny,nz,hemi occlusion)
1111
layout(location = TANGENT) in float4 v_static_T ; // TANGENT; // tangent
1212
layout(location = BINORMAL) in float4 v_static_B ; // BINORMAL; // binormal
13-
layout(location = TEXCOORD0) in int2 v_static_tc ; // TEXCOORD0; // (u,v)
13+
layout(location = TEXCOORD0) in float2 v_static_tc ; // TEXCOORD0; // (u,v)
1414
#ifdef USE_LM_HEMI
15-
layout(location = TEXCOORD1) in int2 v_static_lmh ; // TEXCOORD1; // (lmu,lmv)
15+
layout(location = TEXCOORD1) in float2 v_static_lmh ; // TEXCOORD1; // (lmu,lmv)
1616
#endif
1717
layout(location = POSITION) in float4 v_static_P ; // POSITION; // (float,float,float,1)
1818

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ out gl_PerVertex { vec4 gl_Position; };
1010
layout(location = NORMAL) in float4 v_static_Nh ; // NORMAL; // (nx,ny,nz,hemi occlusion)
1111
layout(location = TANGENT) in float4 v_static_T ; // TANGENT; // tangent
1212
layout(location = BINORMAL) in float4 v_static_B ; // BINORMAL; // binormal
13-
layout(location = TEXCOORD0) in int2 v_static_tc ; // TEXCOORD0; // (u,v)
13+
layout(location = TEXCOORD0) in float2 v_static_tc ; // TEXCOORD0; // (u,v)
1414
#ifdef USE_LM_HEMI
15-
layout(location = TEXCOORD1) in int2 v_static_lmh ; // TEXCOORD1; // (lmu,lmv)
15+
layout(location = TEXCOORD1) in float2 v_static_lmh ; // TEXCOORD1; // (lmu,lmv)
1616
#endif
1717
#if defined(USE_R2_STATIC_SUN) && !defined(USE_LM_HEMI)
1818
layout(location = COLOR0) in float4 v_static_color ; // COLOR0; // (r,g,b,dir-occlusion) // Swizzle before use!!!

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ out gl_PerVertex { vec4 gl_Position; };
1010
layout(location = NORMAL) in float4 v_static_Nh ; // NORMAL; // (nx,ny,nz,hemi occlusion)
1111
layout(location = TANGENT) in float4 v_static_T ; // TANGENT; // tangent
1212
layout(location = BINORMAL) in float4 v_static_B ; // BINORMAL; // binormal
13-
layout(location = TEXCOORD0) in int2 v_static_tc ; // TEXCOORD0; // (u,v)
13+
layout(location = TEXCOORD0) in float2 v_static_tc ; // TEXCOORD0; // (u,v)
1414
#ifdef USE_LM_HEMI
15-
layout(location = TEXCOORD1) in int2 v_static_lmh ; // TEXCOORD1; // (lmu,lmv)
15+
layout(location = TEXCOORD1) in float2 v_static_lmh ; // TEXCOORD1; // (lmu,lmv)
1616
#endif
1717
#if defined(USE_R2_STATIC_SUN) && !defined(USE_LM_HEMI)
1818
layout(location = COLOR0) in float4 v_static_color ; // COLOR0; // (r,g,b,dir-occlusion) // Swizzle before use!!!

res/gamedata/shaders/gl/skin.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ struct v_model_skinned_0
99
float3 N ; // NORMAL; // normal // DWORD
1010
float3 T ; // TANGENT; // tangent // DWORD
1111
float3 B ; // BINORMAL; // binormal // DWORD
12-
int2 tc ; // TEXCOORD0;// (u,v) // short2
12+
float2 tc ; // TEXCOORD0;// (u,v) // short2
1313
};
1414
struct v_model_skinned_1 // 24 bytes
1515
{
1616
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
20-
int2 tc ; // TEXCOORD0;// (u,v) // short2
20+
float2 tc ; // TEXCOORD0;// (u,v) // short2
2121
};
2222
struct v_model_skinned_2 // 28 bytes
2323
{
2424
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
28-
int4 tc ; // TEXCOORD0; // (u,v, w=m-index0, z=m-index1) // short4
28+
float4 tc ; // TEXCOORD0; // (u,v, w=m-index0, z=m-index1) // short4
2929
};
3030

3131
struct v_model_skinned_3 // 28 bytes
@@ -34,7 +34,7 @@ struct v_model_skinned_3 // 28 bytes
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
37-
int4 tc ; // TEXCOORD0; // (u,v, w=m-index0, z=m-index1) // short4
37+
float4 tc ; // TEXCOORD0; // (u,v, w=m-index0, z=m-index1) // short4
3838
};
3939

4040
struct v_model_skinned_4 // 28 bytes
@@ -43,7 +43,7 @@ struct v_model_skinned_4 // 28 bytes
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
46-
int2 tc ; // TEXCOORD0;// (u,v) // short2
46+
float2 tc ; // TEXCOORD0;// (u,v) // short2
4747
float4 ind ; // TEXCOORD1;// (x=m-index0, y=m-index1, z=m-index2, w=m-index3) // DWORD
4848
};
4949

0 commit comments

Comments
 (0)