Skip to content

Commit f01371c

Browse files
committed
lmodel: Fix s_material sampling.
1 parent d8119d2 commit f01371c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

res/gamedata/shaders/gl/lmodel.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ float4 plight_infinity( float m, float3 pnt, float3 normal, float3 light_directi
1111
float3 V = -normalize (pnt); // vector2eye
1212
float3 L = -light_direction; // vector2light
1313
float3 H = normalize (L+V); // float-angle-vector
14-
return tex3D (s_material, float3( dot(L,N), dot(H,N), m ) ); // sample material
14+
return tex3D (s_material, float3( dot(L,N), dot(H,N), m ) ).xxxy; // sample material
1515
}
1616
/*
1717
float plight_infinity2( float m, float3 pnt, float3 normal, float3 light_direction )
@@ -25,7 +25,7 @@ float plight_infinity2( float m, float3 pnt, float3 normal, float3 light_directi
2525
s = saturate(dot(H,N));
2626
float f = saturate(dot(-V,R));
2727
s *= f;
28-
float4 r = tex3D (s_material, float3( dot(L,N), s, m ) ); // sample material
28+
float4 r = tex3D (s_material, float3( dot(L,N), s, m ) ).xxxy; // sample material
2929
r.w = pow(saturate(s),4);
3030
return r ;
3131
}
@@ -40,7 +40,7 @@ float4 plight_local( float m, float3 pnt, float3 normal, float3 light_position,
4040
float3 H = normalize (L+V); // float-angle-vector
4141
rsqr = dot (L2P,L2P); // distance 2 light (squared)
4242
float att = saturate (1 - rsqr*light_range_rsq); // q-linear attenuate
43-
float4 light = tex3D (s_material, float3( dot(L,N), dot(H,N), m ) ); // sample material
43+
float4 light = tex3D (s_material, float3( dot(L,N), dot(H,N), m ) ).xxxy; // sample material
4444
return att*light;
4545
}
4646

0 commit comments

Comments
 (0)