650 lines
18 KiB
XML
650 lines
18 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>
|
|
<!-- fog include -->
|
|
<visibility><use>/environment/ground-visibility-m</use></visibility>
|
|
<avisibility><use>/environment/visibility-m</use></avisibility>
|
|
<lthickness><use>/environment/ground-haze-thickness-m</use></lthickness>
|
|
<scattering><use>/rendering/scene/scattering</use></scattering>
|
|
<ground_scattering><use>/environment/surface/scattering</use></ground_scattering>
|
|
<terminator><use>/environment/terminator-relative-position-m</use></terminator>
|
|
<fogtype><use>/sim/rendering/shaders/skydome</use></fogtype>
|
|
<terrain_alt><use>/environment/mean-terrain-elevation-m</use></terrain_alt>
|
|
<overcast><use>/rendering/scene/overcast</use></overcast>
|
|
<eye_alt><use>/sim/rendering/eye-altitude-m</use></eye_alt>
|
|
<snow_level><use>/environment/snow-level-m</use></snow_level>
|
|
<season><use>/environment/tree-season</use></season>
|
|
<dust_cover_factor><use>/environment/surface/dust-cover-factor</use></dust_cover_factor>
|
|
<fogtype><use>/sim/rendering/shaders/skydome</use></fogtype>
|
|
<fogstructure><use>/environment/fog-structure</use></fogstructure>
|
|
<quality_level><use>/sim/rendering/shaders/landmass</use></quality_level>
|
|
<tquality_level><use>/sim/rendering/shaders/transition</use></tquality_level>
|
|
<wind_effects><use>/sim/rendering/shaders/wind-effects</use></wind_effects>
|
|
<windE><use>/environment/sea/surface/wind-from-east-fps</use></windE>
|
|
<windN><use>/environment/sea/surface/wind-from-north-fps</use></windN>
|
|
<!-- END fog include -->
|
|
</parameters>
|
|
|
|
<technique n="4">
|
|
<predicate>
|
|
<and>
|
|
<property>/sim/rendering/shaders/skydome</property>
|
|
<property>/sim/rendering/random-vegetation</property>
|
|
<property>/sim/rendering/multi-sample-buffers</property>
|
|
<less-equal>
|
|
<value type="float">1.0</value>
|
|
<float-property>/sim/rendering/multi-samples</float-property>
|
|
</less-equal>
|
|
<extension-supported>GL_ARB_shader_objects</extension-supported>
|
|
<extension-supported>GL_ARB_shading_language_100</extension-supported>
|
|
<extension-supported>GL_ARB_vertex_shader</extension-supported>
|
|
<extension-supported>GL_ARB_fragment_shader</extension-supported>
|
|
<extension-supported>GL_ARB_multisample</extension-supported>
|
|
</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>
|
|
<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>
|
|
<alpha-to-coverage>true</alpha-to-coverage>
|
|
<program>
|
|
<vertex-shader>Shaders/tree-haze.vert</vertex-shader>
|
|
<fragment-shader>Shaders/tree-haze.frag</fragment-shader>
|
|
</program>
|
|
<uniform>
|
|
<name>visibility</name>
|
|
<type>float</type>
|
|
<value><use>visibility</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>avisibility</name>
|
|
<type>float</type>
|
|
<value><use>avisibility</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>hazeLayerAltitude</name>
|
|
<type>float</type>
|
|
<value><use>lthickness</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>scattering</name>
|
|
<type>float</type>
|
|
<value><use>scattering</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>ground_scattering</name>
|
|
<type>float</type>
|
|
<value><use>ground_scattering</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>terminator</name>
|
|
<type>float</type>
|
|
<value><use>terminator</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>terrain_alt</name>
|
|
<type>float</type>
|
|
<value><use>terrain_alt</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>overcast</name>
|
|
<type>float</type>
|
|
<value><use>overcast</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>eye_alt</name>
|
|
<type>float</type>
|
|
<value><use>eye_alt</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>dust_cover_factor</name>
|
|
<type>float</type>
|
|
<value><use>dust_cover_factor</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>snow_level</name>
|
|
<type>float</type>
|
|
<value><use>snow_level</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>season</name>
|
|
<type>float</type>
|
|
<value><use>season</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>WindE</name>
|
|
<type>float</type>
|
|
<value><use>windE</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>WindN</name>
|
|
<type>float</type>
|
|
<value><use>windN</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>texture</name>
|
|
<type>sampler-2d</type>
|
|
<value type="int">0</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>colorMode</name>
|
|
<type>int</type>
|
|
<value>2</value> <!-- AMBIENT_AND_DIFFUSE -->
|
|
</uniform>
|
|
<uniform>
|
|
<name>quality_level</name>
|
|
<type>int</type>
|
|
<value><use>quality_level</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>tquality_level</name>
|
|
<type>int</type>
|
|
<value><use>tquality_level</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>wind_effects</name>
|
|
<type>int</type>
|
|
<value><use>wind_effects</use></value>
|
|
</uniform>
|
|
</pass>
|
|
</technique>
|
|
|
|
<technique n="5">
|
|
<predicate>
|
|
<and>
|
|
<property>/sim/rendering/shaders/skydome</property>
|
|
<property>/sim/rendering/random-vegetation</property>
|
|
<or>
|
|
<less-equal>
|
|
<value type="float">2.0</value>
|
|
<glversion/>
|
|
</less-equal>
|
|
<and>
|
|
<extension-supported>GL_ARB_shader_objects</extension-supported>
|
|
<extension-supported>GL_ARB_shading_language_100</extension-supported>
|
|
<extension-supported>GL_ARB_vertex_shader</extension-supported>
|
|
<extension-supported>GL_ARB_fragment_shader</extension-supported>
|
|
</and>
|
|
</or>
|
|
</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>
|
|
<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>
|
|
<alpha-test>
|
|
<comparison>gequal</comparison>
|
|
<reference type="float">0.1</reference>
|
|
</alpha-test>
|
|
<program>
|
|
<vertex-shader>Shaders/tree-haze.vert</vertex-shader>
|
|
<fragment-shader>Shaders/tree-haze.frag</fragment-shader>
|
|
</program>
|
|
<uniform>
|
|
<name>visibility</name>
|
|
<type>float</type>
|
|
<value><use>visibility</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>avisibility</name>
|
|
<type>float</type>
|
|
<value><use>avisibility</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>hazeLayerAltitude</name>
|
|
<type>float</type>
|
|
<value><use>lthickness</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>scattering</name>
|
|
<type>float</type>
|
|
<value><use>scattering</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>ground_scattering</name>
|
|
<type>float</type>
|
|
<value><use>ground_scattering</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>terminator</name>
|
|
<type>float</type>
|
|
<value><use>terminator</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>terrain_alt</name>
|
|
<type>float</type>
|
|
<value><use>terrain_alt</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>overcast</name>
|
|
<type>float</type>
|
|
<value><use>overcast</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>eye_alt</name>
|
|
<type>float</type>
|
|
<value><use>eye_alt</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>dust_cover_factor</name>
|
|
<type>float</type>
|
|
<value><use>dust_cover_factor</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>snow_level</name>
|
|
<type>float</type>
|
|
<value><use>snow_level</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>season</name>
|
|
<type>float</type>
|
|
<value><use>season</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>WindE</name>
|
|
<type>float</type>
|
|
<value><use>windE</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>WindN</name>
|
|
<type>float</type>
|
|
<value><use>windN</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>texture</name>
|
|
<type>sampler-2d</type>
|
|
<value type="int">0</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>colorMode</name>
|
|
<type>int</type>
|
|
<value>2</value> <!-- AMBIENT_AND_DIFFUSE -->
|
|
</uniform>
|
|
<uniform>
|
|
<name>quality_level</name>
|
|
<type>int</type>
|
|
<value><use>quality_level</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>tquality_level</name>
|
|
<type>int</type>
|
|
<value><use>tquality_level</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>wind_effects</name>
|
|
<type>int</type>
|
|
<value><use>wind_effects</use></value>
|
|
</uniform>
|
|
</pass>
|
|
</technique>
|
|
|
|
<technique n="8">
|
|
<predicate>
|
|
<and>
|
|
<property>/sim/rendering/rembrandt/enabled</property>
|
|
<property>/sim/rendering/random-vegetation</property>
|
|
</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.1</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/deferred-tree.vert</vertex-shader>
|
|
<fragment-shader>Shaders/deferred-tree.frag</fragment-shader>
|
|
<fragment-shader>Shaders/gbuffer-functions.frag</fragment-shader>
|
|
<fragment-shader>Shaders/gbuffer-encode.frag</fragment-shader>
|
|
</program>
|
|
<uniform>
|
|
<name>season</name>
|
|
<type>float</type>
|
|
<value><use>season</use></value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>texture</name>
|
|
<type>sampler-2d</type>
|
|
<value type="int">0</value>
|
|
</uniform>
|
|
</pass>
|
|
</technique>
|
|
|
|
<technique n="9">
|
|
<predicate>
|
|
<and>
|
|
<property>/sim/rendering/random-vegetation</property>
|
|
<property>/sim/rendering/multi-sample-buffers</property>
|
|
<less-equal>
|
|
<value type="float">1.0</value>
|
|
<float-property>/sim/rendering/multi-samples</float-property>
|
|
</less-equal>
|
|
<extension-supported>GL_ARB_multisample</extension-supported>
|
|
<extension-supported>GL_ARB_vertex_shader</extension-supported>
|
|
<extension-supported>GL_ARB_fragment_shader</extension-supported>
|
|
<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-to-coverage>true</alpha-to-coverage>
|
|
<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/include_fog.vert</vertex-shader> -->
|
|
<vertex-shader>Shaders/tree.vert</vertex-shader>
|
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
|
<fragment-shader n="1">Shaders/tree.frag</fragment-shader>
|
|
</program>
|
|
<uniform>
|
|
<name>baseTexture</name>
|
|
<type>sampler-2d</type>
|
|
<value type="int">0</value>
|
|
</uniform>
|
|
<!-- BEGIN fog include -->
|
|
<uniform>
|
|
<name>visibility</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>visibility</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>avisibility</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>avisibility</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>hazeLayerAltitude</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>lthickness</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>scattering</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>scattering</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>terminator</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>terminator</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>fogType</name>
|
|
<type>int</type>
|
|
<value>
|
|
<use>fogtype</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>season</name>
|
|
<type>float</type>
|
|
<value><use>season</use></value>
|
|
</uniform>
|
|
<!-- END fog include -->
|
|
</pass>
|
|
</technique>
|
|
|
|
<technique n="10">
|
|
<predicate>
|
|
<and>
|
|
<property>/sim/rendering/shaders/quality-level</property>
|
|
<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/include_fog.vert</vertex-shader> -->
|
|
<vertex-shader>Shaders/tree.vert</vertex-shader>
|
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
|
<fragment-shader n="1">Shaders/tree.frag</fragment-shader>
|
|
</program>
|
|
<uniform>
|
|
<name>baseTexture</name>
|
|
<type>sampler-2d</type>
|
|
<value type="int">0</value>
|
|
</uniform>
|
|
<!-- BEGIN fog include -->
|
|
<uniform>
|
|
<name>visibility</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>visibility</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>avisibility</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>avisibility</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>hazeLayerAltitude</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>lthickness</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>scattering</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>scattering</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>terminator</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>terminator</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>fogType</name>
|
|
<type>int</type>
|
|
<value>
|
|
<use>fogtype</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>season</name>
|
|
<type>float</type>
|
|
<value><use>season</use></value>
|
|
</uniform>
|
|
<!-- END fog include -->
|
|
</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>
|
|
<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 n="0">Shaders/include_fog.vert</vertex-shader> -->
|
|
<vertex-shader n="1">Shaders/tree.vert</vertex-shader>
|
|
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
|
<fragment-shader n="1">Shaders/tree.frag</fragment-shader>
|
|
</program>
|
|
<uniform>
|
|
<name>baseTexture</name>
|
|
<type>sampler-2d</type>
|
|
<value type="int">0</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>visibility</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>visibility</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>avisibility</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>avisibility</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>hazeLayerAltitude</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>lthickness</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>scattering</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>scattering</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>terminator</name>
|
|
<type>float</type>
|
|
<value>
|
|
<use>terminator</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>fogType</name>
|
|
<type>int</type>
|
|
<value>
|
|
<use>fogtype</use>
|
|
</value>
|
|
</uniform>
|
|
<uniform>
|
|
<name>season</name>
|
|
<type>float</type>
|
|
<value><use>season</use></value>
|
|
</uniform>
|
|
</pass>
|
|
</technique>
|
|
</PropertyList>
|