1
0
Fork 0

Move hard wired tree shader to an effect

Author: Tim Moore <timoore@redhat.com>
This commit is contained in:
timoore 2009-11-21 23:35:47 +00:00
parent 9987224de8
commit 00e7027dce
2 changed files with 62 additions and 0 deletions

56
Effects/tree.eff Normal file
View file

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Effects files for trees, which are placed by a shader. -->
<PropertyList>
<name>Effects/tree</name>
<parameters>
<texture n ="0">
</texture>
</parameters>
<technique n="10">
<predicate>
<and>
<property>/sim/rendering/shader-effects</property>
<less-equal>
<value type="float">1.0</value>
<shader-language/>
</less-equal>
</and>
</predicate>
<pass>
<lighting>true</lighting>
<material>
<ambient type="vec4d">1.0 1.0 1.0 1.0</ambient>
<diffuse type="vec4d">1.0 1.0 1.0 1.0</diffuse>
<color-mode>off</color-mode>
</material>
<render-bin>
<bin-number>2</bin-number> <!-- RANDOM_OBJECTS_BIN -->
<bin-name>DepthSortedBin</bin-name>
</render-bin>
<alpha-test>
<comparison>gequal</comparison>
<reference type="float">0.33</reference>
</alpha-test>
<texture-unit>
<unit>0</unit>
<type>2d</type>
<image><use>texture[0]/image</use></image>
<wrap-s>clamp</wrap-s>
<wrap-t>clamp</wrap-t>
</texture-unit>
<program>
<vertex-shader>Shaders/tree.vert</vertex-shader>
<fragment-shader>Shaders/tree.frag</fragment-shader>
</program>
<uniform>
<name>baseTexture</name>
<type>sampler-2d</type>
<value type="int">0</value>
</uniform>
<!-- The vertex shader isn't doing two-sided lighting yet, but
should be soon. -->
<vertex-program-two-side type="bool">true</vertex-program-two-side>
</pass>
</technique>
</PropertyList>

View file

@ -1,3 +1,9 @@
// Tree instance scheme:
// vertex - local position of quad vertex.
// normal - x y scaling, z number of varieties
// fog coord - rotation
// color - xyz of tree quad origin, replicated 4 times.
varying float fogFactor;
void main(void)