diff --git a/Effects/tree.eff b/Effects/tree.eff new file mode 100644 index 000000000..6713511e7 --- /dev/null +++ b/Effects/tree.eff @@ -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> diff --git a/Shaders/tree.vert b/Shaders/tree.vert index 276b39649..4c5017243 100644 --- a/Shaders/tree.vert +++ b/Shaders/tree.vert @@ -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)