Calculates LOS texture coordinates in shaders for overlay lines only if needed.
This was SVN commit r24140.
This commit is contained in:
parent
627ed773df
commit
212f1bdec4
@ -1,5 +1,7 @@
|
||||
!!ARBvp1.0
|
||||
#if !IGNORE_LOS
|
||||
PARAM losTransform = program.local[0];
|
||||
#endif
|
||||
ATTRIB position = vertex.position;
|
||||
|
||||
DP4 result.position.x, state.matrix.mvp.row[0], position;
|
||||
@ -8,7 +10,9 @@ DP4 result.position.z, state.matrix.mvp.row[2], position;
|
||||
DP4 result.position.w, state.matrix.mvp.row[3], position;
|
||||
|
||||
MOV result.texcoord[0], vertex.texcoord[0];
|
||||
#if !IGNORE_LOS
|
||||
MAD result.texcoord[1], position.xzzz, losTransform.x, losTransform.y;
|
||||
#endif
|
||||
|
||||
MOV result.color, vertex.color;
|
||||
|
||||
|
@ -11,13 +11,13 @@
|
||||
<stream name="pos"/>
|
||||
<stream name="uv0"/>
|
||||
<stream name="color" if="!USE_OBJECTCOLOR"/>
|
||||
<uniform name="losTransform" loc="0" type="vec2"/>
|
||||
<uniform name="losTransform" loc="0" type="vec2" if="!IGNORE_LOS"/>
|
||||
</vertex>
|
||||
|
||||
<fragment file="arb/overlayline.fp">
|
||||
<uniform name="baseTex" loc="0" type="sampler2D"/>
|
||||
<uniform name="maskTex" loc="1" type="sampler2D"/>
|
||||
<uniform name="losTex" loc="2" type="sampler2D"/>
|
||||
<uniform name="losTex" loc="2" type="sampler2D" if="!IGNORE_LOS"/>
|
||||
<uniform name="objectColor" loc="0" type="vec3" if="USE_OBJECTCOLOR"/>
|
||||
</fragment>
|
||||
|
||||
|
@ -11,7 +11,10 @@ varying vec4 v_color;
|
||||
#endif
|
||||
|
||||
varying vec2 v_tex;
|
||||
|
||||
#if !IGNORE_LOS
|
||||
varying vec2 v_los;
|
||||
#endif
|
||||
|
||||
void main()
|
||||
{
|
||||
|
@ -1,6 +1,8 @@
|
||||
#version 120
|
||||
|
||||
#if !IGNORE_LOS
|
||||
uniform vec2 losTransform;
|
||||
#endif
|
||||
|
||||
attribute vec3 a_vertex;
|
||||
attribute vec2 a_uv0;
|
||||
@ -11,12 +13,17 @@ varying vec4 v_color;
|
||||
#endif
|
||||
|
||||
varying vec2 v_tex;
|
||||
|
||||
#if !IGNORE_LOS
|
||||
varying vec2 v_los;
|
||||
#endif
|
||||
|
||||
void main()
|
||||
{
|
||||
v_tex = a_uv0;
|
||||
#if !IGNORE_LOS
|
||||
v_los = a_vertex.xz * losTransform.x + losTransform.yy;
|
||||
#endif
|
||||
#if !USE_OBJECTCOLOR
|
||||
v_color = a_color;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user