1
0
forked from 0ad/0ad

First attempt at adding waterfall splashes...

This was SVN commit r12686.
This commit is contained in:
myconid 2012-09-17 12:22:21 +00:00
parent bdab01b381
commit bf5b7938f4
5 changed files with 14 additions and 8 deletions

Binary file not shown.

View File

@ -9,7 +9,7 @@
<define name="USE_TRANSPARENT" value="1"/>
<define name="USE_INSTANCING" value="1"/>
<blend src="src_alpha" dst="one_minus_src_alpha"/>
<depth func="less" mask="false"/>
<depth func="lequal" mask="true"/>
</pass>
</technique>

View File

@ -31,7 +31,7 @@ varying vec4 v_shadow;
varying vec2 v_los;
varying vec3 v_half;
varying vec3 v_normal;
varying float v_transp;
varying vec3 v_lighting;
float get_shadow()
@ -66,6 +66,11 @@ void main()
//vec4 texdiffuse = textureGrad(baseTex, vec3(fract(v_tex.xy), v_tex.z), dFdx(v_tex.xy), dFdy(v_tex.xy));
vec4 texdiffuse = texture2D(baseTex, fract(v_tex.xy));
if (texdiffuse.a < 0.25)
discard;
texdiffuse.a *= v_transp;
vec3 specular = sunColor * specularColor * pow(max(0.0, dot(normalize(v_normal), v_half)), specularPower);
vec3 color = (texdiffuse.rgb * v_lighting + specular) * get_shadow();

View File

@ -24,7 +24,7 @@ uniform vec2 translation;
attribute vec3 a_vertex;
attribute vec3 a_normal;
attribute vec2 a_uv0;
attribute vec2 a_uv1;
varying vec4 worldPos;
varying vec4 v_tex;
@ -32,7 +32,7 @@ varying vec4 v_shadow;
varying vec2 v_los;
varying vec3 v_half;
varying vec3 v_normal;
varying float v_transp;
varying vec3 v_lighting;
@ -41,6 +41,7 @@ void main()
worldPos = instancingTransform * vec4(a_vertex, 1.0);
v_tex.xy = a_uv0 + sim_time * translation;
v_transp = a_uv1.x;
#if USE_SHADOW
v_shadow = shadowTransform * worldPos;

View File

@ -5,11 +5,11 @@
<stream name="pos"/>
<stream name="normal"/>
<stream name="uv0"/>
<stream name="uv1" if="USE_AO"/>
<stream name="uv1"/>
<attrib name="a_vertex" semantics="gl_Vertex"/>
<attrib name="a_normal" semantics="gl_Normal"/>
<attrib name="a_uv0" semantics="gl_MultiTexCoord0"/>
<attrib name="a_uv1" semantics="gl_MultiTexCoord1" if="USE_AO"/>
<attrib name="a_uv1" semantics="gl_MultiTexCoord1"/>
<attrib name="a_skinJoints" semantics="CustomAttribute0" if="USE_GPU_SKINNING"/>
<attrib name="a_skinWeights" semantics="CustomAttribute1" if="USE_GPU_SKINNING"/>
<attrib name="a_tangent" semantics="CustomAttribute2" if="USE_INSTANCING"/>