1
0
Fork 0
fgdata/Effects/tree.eff
Stuart Buchanan 6fc8b10667 Fixes for random vegetation:
1) Remove dependency on the /sim/rendering/shader-effects
2) Fix http://code.google.com/p/flightgear-bugs/issues/detail?id=494 where
toggling the random vegetation on, iff initiall set off, did not generate
new random vegetation. Fixed by forcing a tile reload in the same way as
used for random objects.
2011-11-24 21:41:05 +00:00

98 lines
3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Effects files for trees, which are placed by a shader. -->
<!-- Trees are drawn in two passes. The first draws the opaque parts
with z writes enabled. The second draws the the transparent bits
with z testing enabled and z writes disabled. The transparent
tree silhouettes will blend correctly against the opaque
geometry. They may cause artifacts when blending against other
edges, but the overall "forest" is supposed to be nice and
fuzzy. There might also be artifacts when blending over other
transparent objects, but that's mostly unavoidable.
Note: no sorting needed! -->
<PropertyList>
<name>Effects/tree</name>
<parameters>
<texture n ="0">
</texture>
</parameters>
<technique n="10">
<predicate>
<and>
<property>/sim/rendering/random-vegetation</property>
<less-equal>
<value type="float">1.0</value>
<shader-language/>
</less-equal>
</and>
</predicate>
<pass n="0">
<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>
<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>
</pass>
<pass n="1">
<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>RenderBin</bin-name>
</render-bin>
<alpha-test>
<comparison>less</comparison>
<reference type="float">0.33</reference>
</alpha-test>
<blend>
<source>src-alpha</source>
<destination>one-minus-src-alpha</destination>
</blend>
<depth>
<write-mask>false</write-mask>
</depth>
<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>
</pass>
</technique>
</PropertyList>