Reduce shader complexity and implement graphics presets
- All non-ALS Effects have been removed (except generic ones from model-default and terrain-default). - The rendering dialog has been reworked to accomodate the changes. - All necessary properties have been added to graphics-properties.xml - Five graphics presets have been added: Minimal, Low, Medium, High and Ultra. - Some unused properties have been removed from defaults.xml
This commit is contained in:
parent
bd4b4ffbec
commit
69387f09f4
101 changed files with 1879 additions and 17466 deletions
|
@ -166,10 +166,6 @@
|
|||
<value type="float">6.0</value>
|
||||
<float-property>/sim/rendering/shaders/transition</float-property>
|
||||
</less-equal>
|
||||
<less-equal>
|
||||
<value type="float">1.0</value>
|
||||
<float-property>/sim/rendering/shaders/crop</float-property>
|
||||
</less-equal>
|
||||
</and>
|
||||
<or>
|
||||
<less-equal>
|
||||
|
|
|
@ -154,8 +154,6 @@
|
|||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/skydome</property>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/water</property>
|
||||
<less-equal>
|
||||
<value type="float">2.0</value>
|
||||
<float-property>/sim/rendering/shaders/water</float-property>
|
||||
|
@ -607,466 +605,4 @@
|
|||
<!-- END fog include -->
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/water</property>
|
||||
<less-equal>
|
||||
<value type="float">2.0</value>
|
||||
<float-property>/sim/rendering/shaders/water</float-property>
|
||||
</less-equal>
|
||||
<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>
|
||||
<active>
|
||||
<use>material/active</use>
|
||||
</active>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<emissive>
|
||||
<use>material/emissive</use>
|
||||
</emissive>
|
||||
<shininess>
|
||||
<use>material/shininess</use>
|
||||
</shininess>
|
||||
<color-mode>
|
||||
<use>material/color-mode</use>
|
||||
</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active>
|
||||
<use>blend/active</use>
|
||||
</active>
|
||||
<source>
|
||||
<use>blend/source</use>
|
||||
</source>
|
||||
<destination>
|
||||
<use>blend/destination</use>
|
||||
</destination>
|
||||
</blend>
|
||||
<shade-model>
|
||||
<use>shade-model</use>
|
||||
</shade-model>
|
||||
<cull-face>
|
||||
<use>cull-face</use>
|
||||
</cull-face>
|
||||
<rendering-hint>
|
||||
<use>rendering-hint</use>
|
||||
</rendering-hint>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[2]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[2]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>3</unit>
|
||||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[3]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[3]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>4</unit>
|
||||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[4]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[4]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<image>
|
||||
<use>texture[5]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[5]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[5]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[5]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[5]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[5]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>6</unit>
|
||||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[6]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[6]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[6]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>7</unit>
|
||||
<image>
|
||||
<use>texture[7]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[7]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[7]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[7]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[7]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[7]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<program>
|
||||
<!-- <vertex-shader>Shaders/include_fog.vert</vertex-shader> -->
|
||||
<vertex-shader>Shaders/wake.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/bowwave.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>water_reflection</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_normalmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_dudvmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_reflection_grey</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sea_foam</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>alpha_tex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>bowwave_nmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">7</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>saturation</name>
|
||||
<type>float</type>
|
||||
<!--<value>0.4</value>-->
|
||||
<value>
|
||||
<use>saturation</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover0</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover0</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover1</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover1</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover2</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover2</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover3</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover3</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover4</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover4</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>Status</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>status</use>
|
||||
</value>
|
||||
<!--<value type="int">0</value> -->
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>Overcast</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>overcast</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>spd</name>
|
||||
<type>float</type>
|
||||
<value><use>speed-kt</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>hdg</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>heading-deg</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>Noise</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">1</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>
|
||||
<!-- END fog include -->
|
||||
</pass>
|
||||
</technique>
|
||||
<technique n="11"> <!-- FIXME: this technique number overlaps the one in model-default -->
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/water</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>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number>
|
||||
<use>render-bin/bin-number</use>
|
||||
</bin-number>
|
||||
<bin-name>
|
||||
<use>render-bin/bin-name</use>
|
||||
</bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<program>
|
||||
<vertex-shader>Shaders/water-orig.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/water-orig.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>texture</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -122,7 +122,6 @@
|
|||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/skydome</property>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/model</property>
|
||||
<or>
|
||||
<less-equal>
|
||||
|
@ -229,177 +228,6 @@
|
|||
</pass>
|
||||
</technique>
|
||||
|
||||
<technique n="7">
|
||||
<!-- Model and Rembrandt -->
|
||||
<pass>
|
||||
<material>
|
||||
<active>true</active>
|
||||
<color-mode-uniform>1</color-mode-uniform>
|
||||
<ambient type="vec4d">0.6 0.6 0.6 1.0</ambient>
|
||||
<diffuse type="vec4d">1.0 1.0 1.0 1.0</diffuse>
|
||||
<specular type="vec4d">0.0 0.0 0.0 1.0</specular>
|
||||
<emissive type="vec4d">0.02 0.02 0.02 1.0</emissive>
|
||||
<shininess>0.1</shininess>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
<color-mode-uniform>ambient-and-diffuse</color-mode-uniform>
|
||||
</material>
|
||||
<texture-unit n="4">
|
||||
<unit>4</unit>
|
||||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[3]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[3]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<program n="0">
|
||||
<vertex-shader n="0">Shaders/building-ubershader.vert</vertex-shader>
|
||||
<attribute>
|
||||
<name>instancePosition</name>
|
||||
<index>10</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>instanceScale</name>
|
||||
<index>11</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>attrib1</name>
|
||||
<index>12</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>attrib2</name>
|
||||
<index>13</index>
|
||||
</attribute>
|
||||
</program>
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
<technique n="9">
|
||||
<!-- Model shader, quality > 0 -->
|
||||
<pass>
|
||||
<material>
|
||||
<active>true</active>
|
||||
<color-mode-uniform>1</color-mode-uniform>
|
||||
<ambient type="vec4d">0.6 0.6 0.6 1.0</ambient>
|
||||
<diffuse type="vec4d">1.0 1.0 1.0 1.0</diffuse>
|
||||
<specular type="vec4d">0.0 0.0 0.0 1.0</specular>
|
||||
<emissive type="vec4d">0.02 0.02 0.02 1.0</emissive>
|
||||
<shininess>0.1</shininess>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
<color-mode-uniform>ambient-and-diffuse</color-mode-uniform>
|
||||
</material>
|
||||
<texture-unit n="4">
|
||||
<unit>4</unit>
|
||||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[3]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[3]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<program n="0">
|
||||
<vertex-shader n="0">Shaders/building-ubershader.vert</vertex-shader>
|
||||
<attribute>
|
||||
<name>instancePosition</name>
|
||||
<index>10</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>instanceScale</name>
|
||||
<index>11</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>attrib1</name>
|
||||
<index>12</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>attrib2</name>
|
||||
<index>13</index>
|
||||
</attribute>
|
||||
</program>
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
<technique n="10">
|
||||
<!-- Base Rembrandt -->
|
||||
<pass>
|
||||
<material>
|
||||
<active>true</active>
|
||||
<color-mode-uniform>1</color-mode-uniform>
|
||||
<ambient type="vec4d">0.6 0.6 0.6 1.0</ambient>
|
||||
<diffuse type="vec4d">1.0 1.0 1.0 1.0</diffuse>
|
||||
<specular type="vec4d">0.0 0.0 0.0 1.0</specular>
|
||||
<emissive type="vec4d">0.02 0.02 0.02 1.0</emissive>
|
||||
<shininess>0.1</shininess>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
<color-mode-uniform>ambient-and-diffuse</color-mode-uniform>
|
||||
</material>
|
||||
<texture-unit n="4">
|
||||
<unit>4</unit>
|
||||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[3]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[3]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<program n="0">
|
||||
<vertex-shader n="0">Shaders/building-ubershader.vert</vertex-shader>
|
||||
<attribute>
|
||||
<name>instancePosition</name>
|
||||
<index>10</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>instanceScale</name>
|
||||
<index>11</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>attrib1</name>
|
||||
<index>12</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>attrib2</name>
|
||||
<index>13</index>
|
||||
</attribute>
|
||||
</program>
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
<technique n="11">
|
||||
<pass>
|
||||
<vertex-program-two-side>
|
||||
|
|
|
@ -1,99 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Bump and specular effect
|
||||
parameters :
|
||||
texture[0] -> colormap
|
||||
texture[2] -> normal map + specularity in alpha channel
|
||||
|
||||
eg :
|
||||
in model.xml :
|
||||
<effect>
|
||||
<inherits-from>Aircraft/A320/Models/Effects/bumpspec</inherits-from>
|
||||
<object-name>Fuselage</object-name>
|
||||
</effect>
|
||||
|
||||
in Aircraft/A320/Models/Effects/a320_bumpspec.eff ( or whatever, private to the model )
|
||||
|
||||
<PropertyList>
|
||||
<name>Aircraft/A320/Models/Effects/a320_bumpspec</name>
|
||||
<inherits-from>Effects/bumpspec</inherits-from>
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<image>Aircraft/A320/Models/Effects/textures/a320_normals.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
</parameters>
|
||||
</PropertyList>
|
||||
<!--
|
||||
Legacy Effect.
|
||||
It's kept for backwards compatibility and should not be used on new projects.
|
||||
-->
|
||||
<PropertyList>
|
||||
<name>Effects/bumpspec</name>
|
||||
<inherits-from>Effects/model-default</inherits-from>
|
||||
<generate>
|
||||
<tangent type="int">6</tangent>
|
||||
<binormal type="int">7</binormal>
|
||||
</generate>
|
||||
<technique n="11"> <!-- This number should be the same than the second technique in model-default -->
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/model</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>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<image><use>texture[0]/image</use></image>
|
||||
<type><use>texture[0]/type</use></type>
|
||||
<filter><use>texture[0]/filter</use></filter>
|
||||
<wrap-s><use>texture[0]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[0]/wrap-t</use></wrap-t>
|
||||
<internal-format><use>texture[0]/internal-format</use></internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<image><use>texture[2]/image</use></image>
|
||||
<type><use>texture[2]/type</use></type>
|
||||
<filter><use>texture[2]/filter</use></filter>
|
||||
<wrap-s><use>texture[2]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[2]/wrap-t</use></wrap-t>
|
||||
<internal-format><use>texture[2]/internal-format</use></internal-format>
|
||||
</texture-unit>
|
||||
<program>
|
||||
<vertex-shader n="1">Shaders/bumpspec.vert</vertex-shader>
|
||||
<fragment-shader n="1">Shaders/bumpspec.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>tex_color</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>tex_normal</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
136
Effects/crop.eff
136
Effects/crop.eff
|
@ -2,140 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/crop</name>
|
||||
<inherits-from>Effects/terrain-default</inherits-from>
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<image>Textures/Terrain/crop.png</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="3">
|
||||
<image>Textures/Terrain/crop-colors.png</image>
|
||||
<type>1d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>mirror</wrap-s>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<snow-level><use>/environment/snow-level-m</use></snow-level>
|
||||
</parameters>
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/crop</property>
|
||||
<equal>
|
||||
<value type="float">0.0</value>
|
||||
<float-property>/sim/rendering/photoscenery/enabled</float-property>
|
||||
</equal>
|
||||
<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>
|
||||
<!-- Use material values that are either inherited from the
|
||||
terrain-default effect or supplied by an effect derived
|
||||
from this one e.g., one created in the materials library. -->
|
||||
<material>
|
||||
<ambient><use>material/ambient</use></ambient>
|
||||
<diffuse><use>material/diffuse</use></diffuse>
|
||||
<specular><use>material/specular</use></specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend><use>transparent</use></blend>
|
||||
<alpha-test><use>transparent</use></alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number><use>render-bin/bin-number</use></bin-number>
|
||||
<bin-name><use>render-bin/bin-name</use></bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<image><use>texture[2]/image</use></image>
|
||||
<type><use>texture[2]/type</use></type>
|
||||
<filter><use>texture[2]/filter</use></filter>
|
||||
<wrap-s><use>texture[2]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[2]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<type><use>texture[3]/type</use></type>
|
||||
<image><use>texture[3]/image</use></image>
|
||||
<filter><use>texture[3]/filter</use></filter>
|
||||
<wrap-s><use>texture[3]/wrap-s</use></wrap-s>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<program>
|
||||
<vertex-shader n="1">Shaders/crop.vert</vertex-shader>
|
||||
<vertex-shader n="2">Shaders/shadows-include.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/crop.frag</fragment-shader>
|
||||
<fragment-shader n="2">Shaders/shadows-include.frag</fragment-shader>
|
||||
<fragment-shader n="3">Shaders/clustered-include.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>NoiseTex</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>SampleTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>ColorsTex</name>
|
||||
<type>sampler-1d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>snowlevel</name>
|
||||
<type>float</type>
|
||||
<value><use>snow-level</use></value>
|
||||
</uniform>
|
||||
<!-- BEGIN shadows include -->
|
||||
<uniform>
|
||||
<name>shadow_tex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">10</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>shadows_enabled</name>
|
||||
<type>bool</type>
|
||||
<value>
|
||||
<use>shadows_enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sun_atlas_size</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>sun_atlas_size</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- END shadows include -->
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -2,22 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/cropgrass</name>
|
||||
<inherits-from>Effects/crop</inherits-from>
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<image>Textures/Terrain/cropgrass.png</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="3">
|
||||
<image>Textures/Terrain/cropgrass-colors.png</image>
|
||||
<type>1d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>mirror</wrap-s>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<snow-level><use>/environment/snow-level-m</use></snow-level>
|
||||
</parameters>
|
||||
</PropertyList>
|
||||
|
|
|
@ -327,248 +327,4 @@
|
|||
</pass>
|
||||
</technique>
|
||||
|
||||
|
||||
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/generic</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>
|
||||
<active>
|
||||
<use>material/active</use>
|
||||
</active>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<emissive>
|
||||
<use>material/emissive</use>
|
||||
</emissive>
|
||||
<shininess>
|
||||
<use>material/shininess</use>
|
||||
</shininess>
|
||||
<color-mode>
|
||||
<use>material/color-mode</use>
|
||||
</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active>
|
||||
<use>blend/active</use>
|
||||
</active>
|
||||
<source>
|
||||
<use>blend/source</use>
|
||||
</source>
|
||||
<destination>
|
||||
<use>blend/destination</use>
|
||||
</destination>
|
||||
</blend>
|
||||
<shade-model>
|
||||
<use>shade-model</use>
|
||||
</shade-model>
|
||||
<cull-face>
|
||||
<use>cull-face</use>
|
||||
</cull-face>
|
||||
<rendering-hint>
|
||||
<use>rendering-hint</use>
|
||||
</rendering-hint>
|
||||
<texture-unit>
|
||||
<!-- The texture unit is always active because the shaders expect
|
||||
that. -->
|
||||
<unit>0</unit>
|
||||
<!-- If there is a texture, the type in the derived effect
|
||||
will be "2d". -->
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<!--
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
-->
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<vertex-program-two-side>
|
||||
<use>vertex-program-two-side</use>
|
||||
</vertex-program-two-side>
|
||||
<program>
|
||||
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||
<vertex-shader n="1">Shaders/flutter.vert</vertex-shader>
|
||||
<vertex-shader n="2">Shaders/shadows-include.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/default.frag</fragment-shader>
|
||||
<fragment-shader n="2">Shaders/shadows-include.frag</fragment-shader>
|
||||
<fragment-shader n="3">Shaders/clustered-include.frag</fragment-shader>
|
||||
</program>
|
||||
<!--<uniform>
|
||||
<name>texture</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>-->
|
||||
<uniform>
|
||||
<name>colorMode</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>material/color-mode-uniform</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- uniform> unused?
|
||||
<name>WindSpeed</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>wind-speed</use>
|
||||
</value>
|
||||
</uniform-->
|
||||
<uniform>
|
||||
<name>Offset</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>offset</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>AmpFactor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>amplitude-factor</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>Noise</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">1</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>spd</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>speed-kt</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>hdg</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>heading-deg</use>
|
||||
</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>
|
||||
<!-- END fog include -->
|
||||
<!-- BEGIN shadows include -->
|
||||
<uniform>
|
||||
<name>shadow_tex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">10</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>shadows_enabled</name>
|
||||
<type>bool</type>
|
||||
<value>
|
||||
<use>shadows_enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sun_atlas_size</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>sun_atlas_size</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- END shadows include -->
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
</PropertyList>
|
||||
|
|
|
@ -2,305 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/forest</name>
|
||||
<inherits-from>Effects/terrain-default</inherits-from>
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<image>Textures/Terrain/rock.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
<type>2d</type>
|
||||
</texture>
|
||||
<texture n="3">
|
||||
<image>Textures/Terrain/forest-colors.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>mirror</wrap-s>
|
||||
<internal-format>normalized</internal-format>
|
||||
<type>1d</type>
|
||||
</texture>
|
||||
<texture n="4">
|
||||
<image>Textures/Terrain/forest.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
<type>2d</type>
|
||||
</texture>
|
||||
<texture n="5">
|
||||
<image>Textures/Terrain/forest-relief.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
<type>2d</type>
|
||||
</texture>
|
||||
<snow-level><use>/environment/snow-level-m</use></snow-level>
|
||||
<depth-factor type="float">0.04</depth-factor>
|
||||
<canopy-height type="float">15.0</canopy-height>
|
||||
<quality-level><use>/sim/rendering/shaders/transition</use></quality-level>
|
||||
|
||||
<!-- sets the season color -->
|
||||
<season-red type="float">0.12</season-red>
|
||||
<season-green type="float">0.86</season-green>
|
||||
<season-blue type="float">0.22</season-blue>
|
||||
<!-- end season color -->
|
||||
<!--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>
|
||||
<terminator>
|
||||
<use>/environment/terminator-relative-position-m</use>
|
||||
</terminator>
|
||||
<fogtype>
|
||||
<use>/sim/rendering/shaders/skydome</use>
|
||||
</fogtype>
|
||||
<!-- END fog include -->
|
||||
|
||||
</parameters>
|
||||
<generate>
|
||||
<tangent type="int">6</tangent>
|
||||
<binormal type="int">7</binormal>
|
||||
</generate>
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/transition</property>
|
||||
<equal>
|
||||
<value type="float">0.0</value>
|
||||
<float-property>/sim/rendering/photoscenery/enabled</float-property>
|
||||
</equal>
|
||||
<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>
|
||||
<!-- Use material values that are either inherited from the
|
||||
terrain-default effect or supplied by an effect derived
|
||||
from this one e.g., one created in the materials library. -->
|
||||
<material>
|
||||
<ambient><use>material/ambient</use></ambient>
|
||||
<diffuse><use>material/diffuse</use></diffuse>
|
||||
<specular><use>material/specular</use></specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend><use>transparent</use></blend>
|
||||
<alpha-test><use>transparent</use></alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number><use>render-bin/bin-number</use></bin-number>
|
||||
<bin-name><use>render-bin/bin-name</use></bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<type><use>texture[2]/type</use></type>
|
||||
<image><use>texture[2]/image</use></image>
|
||||
<filter><use>texture[2]/filter</use></filter>
|
||||
<wrap-s><use>texture[2]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[2]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>3</unit>
|
||||
<type><use>texture[3]/type</use></type>
|
||||
<image><use>texture[3]/image</use></image>
|
||||
<filter><use>texture[3]/filter</use></filter>
|
||||
<wrap-s><use>texture[3]/wrap-s</use></wrap-s>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<type><use>texture[4]/type</use></type>
|
||||
<image><use>texture[4]/image</use></image>
|
||||
<filter><use>texture[4]/filter</use></filter>
|
||||
<wrap-s><use>texture[4]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[4]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<type><use>texture[5]/type</use></type>
|
||||
<image><use>texture[5]/image</use></image>
|
||||
<filter><use>texture[5]/filter</use></filter>
|
||||
<wrap-s><use>texture[5]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[5]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[5]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<program>
|
||||
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
||||
<vertex-shader n="2">Shaders/shadows-include.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
||||
<fragment-shader n="2">Shaders/shadows-include.frag</fragment-shader>
|
||||
<fragment-shader n="3">Shaders/clustered-include.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>NoiseTex</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>SampleTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>SampleTex2</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>ColorsTex</name>
|
||||
<type>sampler-1d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>NormalTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>depth_factor</name>
|
||||
<type>float</type>
|
||||
<value><use>depth-factor</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>snowlevel</name>
|
||||
<type>float</type>
|
||||
<value><use>snow-level</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>quality_level</name>
|
||||
<type>float</type>
|
||||
<value><use>quality-level</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>red</name>
|
||||
<type>float</type>
|
||||
<value><use>season-red</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>green</name>
|
||||
<type>float</type>
|
||||
<value><use>season-green</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>blue</name>
|
||||
<type>float</type>
|
||||
<value><use>season-blue</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>alpha</name>
|
||||
<type>float</type>
|
||||
<value>0.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>
|
||||
<!-- END fog include -->
|
||||
<!-- BEGIN shadows include -->
|
||||
<uniform>
|
||||
<name>shadow_tex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">10</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>shadows_enabled</name>
|
||||
<type>bool</type>
|
||||
<value>
|
||||
<use>shadows_enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sun_atlas_size</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>sun_atlas_size</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- END shadows include -->
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -2,301 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/glacier</name>
|
||||
<inherits-from>Effects/terrain-default</inherits-from>
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<image>Textures/Terrain/rock.png</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="3">
|
||||
<image>Textures/Terrain/forest-colors.png</image>
|
||||
<type>1d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>mirror</wrap-s>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="4">
|
||||
<image>Textures/Terrain/forest.png</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="5">
|
||||
<image>Textures/Terrain/forest-relief.png</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<snow-level><use>/environment/snow-level-m</use></snow-level>
|
||||
<depth-factor type="float">0.01</depth-factor>
|
||||
<canopy-height type="float">15.0</canopy-height>
|
||||
<quality-level><use>/sim/rendering/shaders/transition</use></quality-level>
|
||||
|
||||
<!-- sets the season color -->
|
||||
<season-red type="float">0.12</season-red>
|
||||
<season-green type="float">0.86</season-green>
|
||||
<season-blue type="float">0.22</season-blue>
|
||||
<!-- end season color -->
|
||||
<!--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>
|
||||
<terminator>
|
||||
<use>/environment/terminator-relative-position-m</use>
|
||||
</terminator>
|
||||
<fogtype>
|
||||
<use>/sim/rendering/shaders/skydome</use>
|
||||
</fogtype>
|
||||
<!-- END fog include -->
|
||||
|
||||
</parameters>
|
||||
<generate>
|
||||
<tangent type="int">6</tangent>
|
||||
<binormal type="int">7</binormal>
|
||||
</generate>
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/transition</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>
|
||||
<!-- Use material values that are either inherited from the
|
||||
terrain-default effect or supplied by an effect derived
|
||||
from this one e.g., one created in the materials library. -->
|
||||
<material>
|
||||
<ambient><use>material/ambient</use></ambient>
|
||||
<diffuse><use>material/diffuse</use></diffuse>
|
||||
<specular><use>material/specular</use></specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend><use>transparent</use></blend>
|
||||
<alpha-test><use>transparent</use></alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number><use>render-bin/bin-number</use></bin-number>
|
||||
<bin-name><use>render-bin/bin-name</use></bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<image><use>texture[2]/image</use></image>
|
||||
<type><use>texture[2]/type</use></type>
|
||||
<filter><use>texture[2]/filter</use></filter>
|
||||
<wrap-s><use>texture[2]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[2]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>3</unit>
|
||||
<image><use>texture[3]/image</use></image>
|
||||
<type><use>texture[3]/type</use></type>
|
||||
<filter><use>texture[3]/filter</use></filter>
|
||||
<wrap-s><use>texture[3]/wrap-s</use></wrap-s>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<image><use>texture[4]/image</use></image>
|
||||
<type><use>texture[4]/type</use></type>
|
||||
<filter><use>texture[4]/filter</use></filter>
|
||||
<wrap-s><use>texture[4]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[4]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<image><use>texture[5]/image</use></image>
|
||||
<type><use>texture[5]/type</use></type>
|
||||
<filter><use>texture[5]/filter</use></filter>
|
||||
<wrap-s><use>texture[5]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[5]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[5]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<program>
|
||||
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
||||
<vertex-shader n="2">Shaders/shadows-include.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
||||
<fragment-shader n="2">Shaders/shadows-include.frag</fragment-shader>
|
||||
<fragment-shader n="3">Shaders/clustered-include.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>NoiseTex</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>SampleTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>SampleTex2</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>ColorsTex</name>
|
||||
<type>sampler-1d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>NormalTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>depth_factor</name>
|
||||
<type>float</type>
|
||||
<value><use>depth-factor</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>snowlevel</name>
|
||||
<type>float</type>
|
||||
<value><use>snow-level</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>quality_level</name>
|
||||
<type>float</type>
|
||||
<value><use>quality-level</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>red</name>
|
||||
<type>float</type>
|
||||
<value><use>season-red</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>green</name>
|
||||
<type>float</type>
|
||||
<value><use>season-green</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>blue</name>
|
||||
<type>float</type>
|
||||
<value><use>season-blue</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>alpha</name>
|
||||
<type>float</type>
|
||||
<value>0.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>
|
||||
<!-- END fog include -->
|
||||
<!-- BEGIN shadows include -->
|
||||
<uniform>
|
||||
<name>shadow_tex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">10</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>shadows_enabled</name>
|
||||
<type>bool</type>
|
||||
<value>
|
||||
<use>shadows_enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sun_atlas_size</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>sun_atlas_size</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- END shadows include -->
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -2,301 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/herbtundra</name>
|
||||
<inherits-from>Effects/terrain-default</inherits-from>
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<image>Textures/Terrain/rock.png</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="3">
|
||||
<image>Textures/Terrain/forest-colors.png</image>
|
||||
<type>1d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>mirror</wrap-s>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="4">
|
||||
<image>Textures/Terrain/forest.png</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="5">
|
||||
<image>Textures/Terrain/forest-relief.png</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<snow-level><use>/environment/snow-level-m</use></snow-level>
|
||||
<depth-factor type="float">0.01</depth-factor>
|
||||
<canopy-height type="float">15.0</canopy-height>
|
||||
|
||||
<!-- sets the season color -->
|
||||
<season-red type="float">0.12</season-red>
|
||||
<season-green type="float">0.86</season-green>
|
||||
<season-blue type="float">0.22</season-blue>
|
||||
<!-- end season color -->
|
||||
|
||||
<!--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>
|
||||
<terminator>
|
||||
<use>/environment/terminator-relative-position-m</use>
|
||||
</terminator>
|
||||
<fogtype>
|
||||
<use>/sim/rendering/shaders/skydome</use>
|
||||
</fogtype>
|
||||
<!-- END fog include -->
|
||||
|
||||
<quality-level><use>/sim/rendering/shaders/transition</use></quality-level>
|
||||
</parameters>
|
||||
<generate>
|
||||
<tangent type="int">6</tangent>
|
||||
<binormal type="int">7</binormal>
|
||||
</generate>
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/transition</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>
|
||||
<!-- Use material values that are either inherited from the
|
||||
terrain-default effect or supplied by an effect derived
|
||||
from this one e.g., one created in the materials library. -->
|
||||
<material>
|
||||
<ambient><use>material/ambient</use></ambient>
|
||||
<diffuse><use>material/diffuse</use></diffuse>
|
||||
<specular><use>material/specular</use></specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend><use>transparent</use></blend>
|
||||
<alpha-test><use>transparent</use></alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number><use>render-bin/bin-number</use></bin-number>
|
||||
<bin-name><use>render-bin/bin-name</use></bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<image><use>texture[2]/image</use></image>
|
||||
<type><use>texture[2]/type</use></type>
|
||||
<filter><use>texture[2]/filter</use></filter>
|
||||
<wrap-s><use>texture[2]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[2]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>3</unit>
|
||||
<image><use>texture[3]/image</use></image>
|
||||
<type><use>texture[3]/type</use></type>
|
||||
<filter><use>texture[3]/filter</use></filter>
|
||||
<wrap-s><use>texture[3]/wrap-s</use></wrap-s>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<image><use>texture[4]/image</use></image>
|
||||
<type><use>texture[4]/type</use></type>
|
||||
<filter><use>texture[4]/filter</use></filter>
|
||||
<wrap-s><use>texture[4]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[4]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<image><use>texture[5]/image</use></image>
|
||||
<type><use>texture[5]/type</use></type>
|
||||
<filter><use>texture[5]/filter</use></filter>
|
||||
<wrap-s><use>texture[5]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[5]/wrap-t</use></wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[5]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<program>
|
||||
<vertex-shader n="1">Shaders/forest.vert</vertex-shader>
|
||||
<vertex-shader n="2">Shaders/shadows-include.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/forest.frag</fragment-shader>
|
||||
<fragment-shader n="2">Shaders/shadows-include.frag</fragment-shader>
|
||||
<fragment-shader n="3">Shaders/clustered-include.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>NoiseTex</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>SampleTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>SampleTex2</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>ColorsTex</name>
|
||||
<type>sampler-1d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>NormalTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>depth_factor</name>
|
||||
<type>float</type>
|
||||
<value><use>depth-factor</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>snowlevel</name>
|
||||
<type>float</type>
|
||||
<value><use>snow-level</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>quality_level</name>
|
||||
<type>float</type>
|
||||
<value><use>quality-level</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>red</name>
|
||||
<type>float</type>
|
||||
<value><use>season-red</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>green</name>
|
||||
<type>float</type>
|
||||
<value><use>season-green</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>blue</name>
|
||||
<type>float</type>
|
||||
<value><use>season-blue</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>alpha</name>
|
||||
<type>float</type>
|
||||
<value>0.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>
|
||||
<!-- END fog include -->
|
||||
<!-- BEGIN shadows include -->
|
||||
<uniform>
|
||||
<name>shadow_tex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">10</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>shadows_enabled</name>
|
||||
<type>bool</type>
|
||||
<value>
|
||||
<use>shadows_enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sun_atlas_size</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>sun_atlas_size</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- END shadows include -->
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -2,7 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/landmass-nowood</name>
|
||||
<inherits-from>Effects/landmass</inherits-from>
|
||||
<parameters>
|
||||
<canopy-height type="float">0.0</canopy-height>
|
||||
</parameters>
|
||||
</PropertyList>
|
||||
|
|
|
@ -2,15 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/landmass-scrub</name>
|
||||
<inherits-from>Effects/landmass</inherits-from>
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<image>Textures/Terrain/shrubcover-relief.png</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<canopy-height type="float">1.0</canopy-height>
|
||||
</parameters>
|
||||
</PropertyList>
|
||||
|
|
|
@ -2,581 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/landmass</name>
|
||||
<inherits-from>Effects/terrain-default</inherits-from>
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<image>Textures/Terrain/forest-relief.png</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<snow-level>
|
||||
<use>/environment/snow-level-m</use>
|
||||
</snow-level>
|
||||
<depth-factor type="float">0.01</depth-factor>
|
||||
<canopy-height type="float">15.0</canopy-height>
|
||||
<quality-level>
|
||||
<use>/sim/rendering/shaders/landmass</use>
|
||||
</quality-level>
|
||||
<!--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>
|
||||
<terminator>
|
||||
<use>/environment/terminator-relative-position-m</use>
|
||||
</terminator>
|
||||
<fogtype>
|
||||
<use>/sim/rendering/shaders/skydome</use>
|
||||
</fogtype>
|
||||
<!-- END fog include -->
|
||||
</parameters>
|
||||
|
||||
<generate>
|
||||
<tangent type="int">6</tangent>
|
||||
<binormal type="int">7</binormal>
|
||||
</generate>
|
||||
<technique n="8">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/landmass</property>
|
||||
<equal>
|
||||
<value type="float">0.0</value>
|
||||
<float-property>/sim/rendering/photoscenery/enabled</float-property>
|
||||
</equal>
|
||||
<less-equal>
|
||||
<value type="float">4.0</value>
|
||||
<float-property>/sim/rendering/shaders/landmass</float-property>
|
||||
</less-equal>
|
||||
<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>
|
||||
<extension-supported>GL_EXT_geometry_shader4</extension-supported>
|
||||
</and>
|
||||
</predicate>
|
||||
|
||||
<!--
|
||||
<pass>
|
||||
<lighting>true</lighting>
|
||||
<material>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number>-1</bin-number>
|
||||
<bin-name>RenderBin</bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<program>
|
||||
<vertex-shader n="0">Shaders/include_fog.vert</vertex-shader>
|
||||
<vertex-shader n="1">Shaders/landmass-g.vert</vertex-shader>
|
||||
<geometry-shader>Shaders/landmass.geom</geometry-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/terrain-nocolor.frag</fragment-shader>
|
||||
<geometry-vertices-out type="int">18</geometry-vertices-out>
|
||||
<geometry-input-type>triangles</geometry-input-type>
|
||||
<geometry-output-type>triangle-strip</geometry-output-type>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>texture</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>canopy_height</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>canopy-height</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<color-mask type="vec4d">0 0 0 0</color-mask>
|
||||
|
||||
<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>
|
||||
</pass>
|
||||
-->
|
||||
|
||||
<pass>
|
||||
<lighting>true</lighting>
|
||||
<material>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number>
|
||||
<use>render-bin/bin-number</use>
|
||||
</bin-number>
|
||||
<bin-name>
|
||||
<use>render-bin/bin-name</use>
|
||||
</bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[2]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[2]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<program>
|
||||
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||
<vertex-shader n="1">Shaders/landmass-g.vert</vertex-shader>
|
||||
<geometry-shader>Shaders/landmass.geom</geometry-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/landmass.frag</fragment-shader>
|
||||
<geometry-vertices-out type="int">18</geometry-vertices-out>
|
||||
<geometry-input-type>triangles</geometry-input-type>
|
||||
<geometry-output-type>triangle-strip</geometry-output-type>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>NoiseTex</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>BaseTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>NormalTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>depth_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>depth-factor</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>snowlevel</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>snow-level</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>canopy_height</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>canopy-height</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>quality_level</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>quality-level</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<depth>
|
||||
<function>lequal</function>
|
||||
<!-- <write-mask type="bool">false</write-mask> -->
|
||||
</depth>
|
||||
<!-- 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>
|
||||
<!-- END fog include -->
|
||||
</pass>
|
||||
</technique>
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/landmass</property>
|
||||
<equal>
|
||||
<value type="float">0.0</value>
|
||||
<float-property>/sim/rendering/photoscenery/enabled</float-property>
|
||||
</equal>
|
||||
<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>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number>
|
||||
<use>render-bin/bin-number</use>
|
||||
</bin-number>
|
||||
<bin-name>
|
||||
<use>render-bin/bin-name</use>
|
||||
</bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[2]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[2]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<program>
|
||||
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||
<vertex-shader n="1">Shaders/landmass.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/landmass.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>NoiseTex</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>BaseTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>NormalTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>depth_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>depth-factor</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>snowlevel</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>snow-level</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>quality_level</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>quality-level</use>
|
||||
</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>
|
||||
<!-- END fog include -->
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -93,12 +93,4 @@
|
|||
</polygon-offset>
|
||||
</pass>
|
||||
</technique>
|
||||
<technique n="5">
|
||||
<pass n="0">
|
||||
<polygon-offset>
|
||||
<factor>-2.0</factor>
|
||||
<units>-5.0</units>
|
||||
</polygon-offset>
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -1,223 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Legacy Effect.
|
||||
It's kept for backwards compatibility and should not be used on new projects.
|
||||
-->
|
||||
<PropertyList>
|
||||
<name>Effects/lightmap</name>
|
||||
<parameters>
|
||||
<texture n ="0">
|
||||
<type>white</type>
|
||||
</texture>
|
||||
<vertex-program-two-side type="bool">false</vertex-program-two-side>
|
||||
<material>
|
||||
<color-mode-uniform>1</color-mode-uniform> <!-- DIFFUSE -->
|
||||
</material>
|
||||
<condition><use>/sim/rendering/shaders/generic</use></condition>
|
||||
<factor>1</factor>
|
||||
<!-- BEGIN 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>
|
||||
<terminator>
|
||||
<use>/environment/terminator-relative-position-m</use>
|
||||
</terminator>
|
||||
<fogtype>
|
||||
<use>/sim/rendering/shaders/skydome</use>
|
||||
</fogtype>
|
||||
<!-- END fog include -->
|
||||
</parameters>
|
||||
<technique n="10">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/generic</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>
|
||||
<active><use>material/active</use></active>
|
||||
<ambient><use>material/ambient</use></ambient>
|
||||
<diffuse><use>material/diffuse</use></diffuse>
|
||||
<specular><use>material/specular</use></specular>
|
||||
<emissive><use>material/emissive</use></emissive>
|
||||
<shininess><use>material/shininess</use></shininess>
|
||||
<color-mode><use>material/color-mode</use></color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active><use>blend/active</use></active>
|
||||
<source><use>blend/source</use></source>
|
||||
<destination><use>blend/destination</use></destination>
|
||||
</blend>
|
||||
<shade-model><use>shade-model</use></shade-model>
|
||||
<cull-face><use>cull-face</use></cull-face>
|
||||
<rendering-hint><use>rendering-hint</use></rendering-hint>
|
||||
<texture-unit>
|
||||
<!-- The texture unit is always active because the shaders expect
|
||||
that. -->
|
||||
<unit>0</unit>
|
||||
<!-- If there is a texture, the type in the derived effect
|
||||
will be "2d". -->
|
||||
<type><use>texture[0]/type</use></type>
|
||||
<image><use>texture[0]/image</use></image>
|
||||
<filter><use>texture[0]/filter</use></filter>
|
||||
<wrap-s><use>texture[0]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[0]/wrap-t</use></wrap-t>
|
||||
<!--
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
-->
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<!-- The texture unit is always active because the shaders expect
|
||||
that. -->
|
||||
<unit>1</unit>
|
||||
<!-- If there is a texture, the type in the derived effect
|
||||
will be "2d". -->
|
||||
<type><use>texture[1]/type</use></type>
|
||||
<image><use>texture[1]/image</use></image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
</texture-unit>
|
||||
<vertex-program-two-side>
|
||||
<use>vertex-program-two-side</use>
|
||||
</vertex-program-two-side>
|
||||
<program>
|
||||
<vertex-shader>Shaders/lightmap.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/lightmap.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>texture</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>lightmap_texture</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>colorMode</name>
|
||||
<type>int</type>
|
||||
<value><use>material/color-mode-uniform</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>condition</name>
|
||||
<type>float</type>
|
||||
<value><use>condition</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>lightmap_factor</name>
|
||||
<type>float</type>
|
||||
<value><use>factor</use></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>
|
||||
<!-- END fog include -->
|
||||
</pass>
|
||||
</technique>
|
||||
<technique n="11">
|
||||
<pass>
|
||||
<lighting>true</lighting>
|
||||
<material>
|
||||
<active><use>material/active</use></active>
|
||||
<ambient><use>material/ambient</use></ambient>
|
||||
<diffuse><use>material/diffuse</use></diffuse>
|
||||
<specular><use>material/specular</use></specular>
|
||||
<emissive><use>material/emissive</use></emissive>
|
||||
<shininess><use>material/shininess</use></shininess>
|
||||
<color-mode><use>material/color-mode</use></color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active><use>blend/active</use></active>
|
||||
<source><use>blend/source</use></source>
|
||||
<destination><use>blend/destination</use></destination>
|
||||
</blend>
|
||||
<shade-model><use>shade-model</use></shade-model>
|
||||
<cull-face><use>cull-face</use></cull-face>
|
||||
<rendering-hint><use>rendering-hint</use></rendering-hint>
|
||||
<texture-unit>
|
||||
<active><use>texture[0]/active</use></active>
|
||||
<unit>0</unit>
|
||||
<image><use>texture[0]/image</use></image>
|
||||
<type><use>texture[0]/type</use></type>
|
||||
<filter><use>texture[0]/filter</use></filter>
|
||||
<wrap-s><use>texture[0]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[0]/wrap-t</use></wrap-t>
|
||||
<!--
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
-->
|
||||
<environment>
|
||||
<mode>modulate</mode>
|
||||
</environment>
|
||||
</texture-unit>
|
||||
<!-- A two-sided lighting model is set by default near the root
|
||||
of the scene graph. Perhaps that ought to be set in this
|
||||
effect?
|
||||
-->
|
||||
</pass>
|
||||
</technique>
|
||||
<inherits-from>model-default</inherits-from>
|
||||
</PropertyList>
|
||||
|
|
|
@ -6,110 +6,4 @@ and fallback to plain transparency when the model shader is disabled.
|
|||
<PropertyList>
|
||||
<name>Effects/model-combined-transparent</name>
|
||||
<inherits-from>Effects/model-combined</inherits-from>
|
||||
|
||||
<technique n="7">
|
||||
<predicate>
|
||||
<and>
|
||||
<equal>
|
||||
<float-property>/sim/rendering/shaders/model</float-property>
|
||||
<value type="float">0.0</value>
|
||||
</equal>
|
||||
<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>
|
||||
<depth>
|
||||
<write-mask type="bool">false</write-mask>
|
||||
</depth>
|
||||
<material>
|
||||
<active>
|
||||
<use>material/active</use>
|
||||
</active>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<emissive>
|
||||
<use>material/emissive</use>
|
||||
</emissive>
|
||||
<shininess>
|
||||
<use>material/shininess</use>
|
||||
</shininess>
|
||||
<color-mode>
|
||||
<use>material/color-mode</use>
|
||||
</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active>
|
||||
<use>blend/active</use>
|
||||
</active>
|
||||
<source>
|
||||
<use>blend/source</use>
|
||||
</source>
|
||||
<destination>
|
||||
<use>blend/destination</use>
|
||||
</destination>
|
||||
</blend>
|
||||
<shade-model>
|
||||
<use>shade-model</use>
|
||||
</shade-model>
|
||||
<cull-face>
|
||||
<use>cull-face</use>
|
||||
</cull-face>
|
||||
<render-bin>
|
||||
<bin-number>111</bin-number>
|
||||
<bin-name>DepthSortedBin</bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<active>
|
||||
<use>texture[0]/active</use>
|
||||
</active>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<!--
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
-->
|
||||
<environment>
|
||||
<mode>modulate</mode>
|
||||
</environment>
|
||||
</texture-unit>
|
||||
<!-- A two-sided lighting model is set by default near the root
|
||||
of the scene graph. Perhaps that ought to be set in this
|
||||
effect?
|
||||
-->
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -391,8 +391,7 @@
|
|||
<technique n="11">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/generic</property>
|
||||
<property>/sim/rendering/shaders/use-shaders</property>
|
||||
<or>
|
||||
<less-equal>
|
||||
<value type="float">2.0</value>
|
||||
|
|
|
@ -472,277 +472,4 @@
|
|||
</uniform>
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
|
||||
|
||||
<!-- <technique n="4">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/skydome</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>
|
||||
<active><use>material/active</use></active>
|
||||
<ambient><use>material/ambient</use></ambient>
|
||||
<diffuse><use>material/diffuse</use></diffuse>
|
||||
<specular><use>material/specular</use></specular>
|
||||
<emissive><use>material/emissive</use></emissive>
|
||||
<shininess><use>material/shininess</use></shininess>
|
||||
<color-mode><use>material/color-mode</use></color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active><use>blend/active</use></active>
|
||||
<source><use>blend/source</use></source>
|
||||
<destination><use>blend/destination</use></destination>
|
||||
</blend>
|
||||
<shade-model><use>shade-model</use></shade-model>
|
||||
<cull-face><use>cull-face</use></cull-face>
|
||||
<rendering-hint><use>rendering-hint</use></rendering-hint>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<type><use>texture[0]/type</use></type>
|
||||
<image><use>texture[0]/image</use></image>
|
||||
<filter><use>texture[0]/filter</use></filter>
|
||||
<wrap-s><use>texture[0]/wrap-s</use></wrap-s>
|
||||
<wrap-t><use>texture[0]/wrap-t</use></wrap-t>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>4</unit>
|
||||
<type><use>texture[4]/type</use></type>
|
||||
<images><use>texture[4]/images</use></images>
|
||||
</texture-unit>
|
||||
<vertex-program-two-side>
|
||||
<use>vertex-program-two-side</use>
|
||||
</vertex-program-two-side>
|
||||
<program>
|
||||
<vertex-shader>Shaders/generic-ALS-base.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/model-interior-ALS-base.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/hazes.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/secondary_lights.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/noise.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/filters-ALS.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>terminator</name>
|
||||
<type>float</type>
|
||||
<value><use>terminator</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>cloud_self_shading</name>
|
||||
<type>float</type>
|
||||
<value><use>cloud_self_shading</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>moonlight</name>
|
||||
<type>float</type>
|
||||
<value><use>moonlight</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>offset_vec</name>
|
||||
<type>float-vec3</type>
|
||||
<value><use>opacity-cube-center</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>scale_vec</name>
|
||||
<type>float-vec3</type>
|
||||
<value><use>opacity-cube-scale</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>angle</name>
|
||||
<type>float</type>
|
||||
<value><use>opacity-cube-angle</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>tag_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value><use>implicit-lightmap-tag-color</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>emit_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value><use>implicit-lightmap-emit-color</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>light_filter_one</name>
|
||||
<type>float-vec3</type>
|
||||
<value><use>light-filter-one</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>light_filter_two</name>
|
||||
<type>float-vec3</type>
|
||||
<value><use>light-filter-two</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>light_radius</name>
|
||||
<type>float</type>
|
||||
<value><use>light-radius</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>threshold_low</name>
|
||||
<type>float</type>
|
||||
<value><use>implicit-lightmap-threshold-low</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>threshold_high</name>
|
||||
<type>float</type>
|
||||
<value><use>implicit-lightmap-threshold-high</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>emit_intensity</name>
|
||||
<type>float</type>
|
||||
<value><use>implicit-lightmap-intensity</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>view_pitch_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>view_pitch_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>view_heading_offset</name>
|
||||
<type>float</type>
|
||||
<value><use>view_heading_offset</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>field_of_view</name>
|
||||
<type>float</type>
|
||||
<value><use>view_fov</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>display_xsize</name>
|
||||
<type>int</type>
|
||||
<value><use>display_xsize</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>display_ysize</name>
|
||||
<type>int</type>
|
||||
<value><use>display_ysize</use></value>
|
||||
</uniform> -->
|
||||
<!-- filtering -->
|
||||
<!--<uniform>
|
||||
<name>gamma</name>
|
||||
<type>float</type>
|
||||
<value><use>gamma</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>brightness</name>
|
||||
<type>float</type>
|
||||
<value><use>brightness</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>use_filtering</name>
|
||||
<type>bool</type>
|
||||
<value><use>use_filtering</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>use_night_vision</name>
|
||||
<type>bool</type>
|
||||
<value><use>use_night_vision</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>use_IR_vision</name>
|
||||
<type>bool</type>
|
||||
<value><use>use_IR_vision</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>delta_T</name>
|
||||
<type>float</type>
|
||||
<value><use>delta_T</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>texture</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>cube_texture</name>
|
||||
<type>sampler-cube</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>colorMode</name>
|
||||
<type>int</type>
|
||||
<value><use>material/color-mode-uniform</use></value>
|
||||
</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>implicit_lightmap_enabled</name>
|
||||
<type>int</type>
|
||||
<value><use>implicit-lightmap-enabled</use></value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>use_flashlight</name>
|
||||
<type>int</type>
|
||||
<value><use>use-flashlight</use></value>
|
||||
</uniform>
|
||||
</pass>
|
||||
</technique>-->
|
||||
|
||||
</PropertyList>
|
||||
|
|
|
@ -213,7 +213,6 @@
|
|||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/skydome</property>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/model</property>
|
||||
<or>
|
||||
<less-equal>
|
||||
|
@ -1328,600 +1327,4 @@
|
|||
<!-- END shadows include -->
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
<!-- Default rendering -->
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/model</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 n="0">
|
||||
<lighting>true</lighting>
|
||||
<material>
|
||||
<active>
|
||||
<use>material/active</use>
|
||||
</active>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<emissive>
|
||||
<use>material/emissive</use>
|
||||
</emissive>
|
||||
<shininess>
|
||||
<use>material/shininess</use>
|
||||
</shininess>
|
||||
<color-mode>
|
||||
<use>material/color-mode</use>
|
||||
</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active>
|
||||
<use>blend/active</use>
|
||||
</active>
|
||||
<source>
|
||||
<use>blend/source</use>
|
||||
</source>
|
||||
<destination>
|
||||
<use>blend/destination</use>
|
||||
</destination>
|
||||
</blend>
|
||||
<shade-model>
|
||||
<use>shade-model</use>
|
||||
</shade-model>
|
||||
<cull-face>
|
||||
<use>cull-face</use>
|
||||
</cull-face>
|
||||
<rendering-hint>
|
||||
<use>rendering-hint</use>
|
||||
</rendering-hint>
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<render-bin>
|
||||
<bin-number>
|
||||
<use>render-bin/bin-number</use>
|
||||
</bin-number>
|
||||
<bin-name>
|
||||
<use>render-bin/bin-name</use>
|
||||
</bin-name>
|
||||
</render-bin>
|
||||
<!-- Diffuse texture unit-->
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<!-- Reflection Noise texture unit-->
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<!-- NormalMap texture unit-->
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[2]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[2]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<!-- LightMap texture unit-->
|
||||
<texture-unit>
|
||||
<unit>3</unit>
|
||||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[3]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[3]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<!-- ReflectMap texture unit-->
|
||||
<texture-unit>
|
||||
<unit>4</unit>
|
||||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[4]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[4]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<!-- Reflection CubeMap texture unit-->
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<type>
|
||||
<use>texture[5]/type</use>
|
||||
</type>
|
||||
<!-- use this form for a cube cross -->
|
||||
<!--<image>
|
||||
<use>texture[5]/image</use>
|
||||
</image>-->
|
||||
<!-- END CubeCross -->
|
||||
<!-- use this form for a 6 image cube map -->
|
||||
<images>
|
||||
<use>texture[5]/images</use>
|
||||
</images>
|
||||
<!-- END 6 image cube map -->
|
||||
</texture-unit>
|
||||
<!-- Reflection gradients texture unit-->
|
||||
<texture-unit>
|
||||
<unit>6</unit>
|
||||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[6]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[6]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[6]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<vertex-program-two-side>
|
||||
<use>vertex-program-two-side</use>
|
||||
</vertex-program-two-side>
|
||||
|
||||
<program n="0">
|
||||
<vertex-shader n="0">Shaders/ubershader.vert</vertex-shader>
|
||||
<vertex-shader n="1">Shaders/shadows-include.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/ubershader.frag</fragment-shader>
|
||||
<fragment-shader n="2">Shaders/shadows-include.frag</fragment-shader>
|
||||
<fragment-shader n="3">Shaders/clustered-include.frag</fragment-shader>
|
||||
</program>
|
||||
|
||||
<uniform>
|
||||
<name>BaseTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflNoiseTex</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>NormalTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>LightMapTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflMapTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Environment</name>
|
||||
<type>sampler-cube</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ReflGradientsTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
|
||||
<!-- NORMAL MAP -->
|
||||
<!-- normalmap is used-->
|
||||
<uniform>
|
||||
<name>nmap_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>normalmap-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- normalmap is .dds-->
|
||||
<uniform>
|
||||
<name>nmap_dds</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>normalmap-dds</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>nmap_tile</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>normalmap-tiling</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- LIGHTMAP -->
|
||||
<!-- lightmap is used -->
|
||||
<uniform>
|
||||
<name>lightmap_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>lightmap-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- lightmap is multichannel -->
|
||||
<uniform>
|
||||
<name>lightmap_multi</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>lightmap-multi</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_r_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_r_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_g_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_g_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_b_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_b_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_a_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>lightmap-factor[3]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_a_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>lightmap-color[3]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- reflection is used -->
|
||||
<uniform>
|
||||
<name>refl_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>reflection-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- reflection correction -->
|
||||
<uniform>
|
||||
<name>refl_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- use a reflection map-->
|
||||
<uniform>
|
||||
<name>refl_map</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>reflect-map-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- reflection is dynamic -->
|
||||
<uniform>
|
||||
<name>refl_dynamic</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>reflection-dynamic</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fringing colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>refl_rainbow</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-rainbow</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fresnel effect colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>refl_fresnel</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-fresnel</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of noisiness 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>refl_noise</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflection-noise</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- dirt -->
|
||||
<uniform>
|
||||
<name>dirt_enabled</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>dirt-enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_multi</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>dirt-multi</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_r_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>dirt-color[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_r_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>dirt-factor[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_g_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>dirt-color[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_g_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>dirt-factor[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_b_color</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>dirt-color[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>dirt_b_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>dirt-factor[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of ambient light correction 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>amb_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>ambient-correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
|
||||
<uniform>
|
||||
<name>lonDeg</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>pos-lon</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>latDeg</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>pos-lat</use>
|
||||
</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>
|
||||
<!-- END fog include -->
|
||||
<!-- BEGIN shadows include -->
|
||||
<uniform>
|
||||
<name>shadow_tex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">10</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>shadows_enabled</name>
|
||||
<type>bool</type>
|
||||
<value>
|
||||
<use>shadows_enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sun_atlas_size</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>sun_atlas_size</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- END shadows include -->
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -1,492 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Reflections + Bumpmapping + specular
|
||||
|
||||
PARAMETERS: There are two forms of cube map texture:- vertical cross and 6 images.
|
||||
Either can be used - alternative forms are shown in <parameters> and in <texture-unit>
|
||||
|
||||
The reflection is set proportional to the shininess of the material. Thus by
|
||||
varying the material shininess value over or between objects the amount of
|
||||
refection can be controlled. The overall amount of reflection may be
|
||||
adjusted by the use of <refl_correction> -1.0 (fully transparent)- 1.0 (fully opaque).
|
||||
|
||||
The overall values of the noisiness, coloured fringing or fresnel effect may be adjusted
|
||||
by the use of <noisiness>, <rainbowiness> and <fresneliness>.
|
||||
|
||||
If your result is too dark/too light the overall ambient light value can be adjusted
|
||||
by the use of <ambient_correction>. This correction also takes out some of the blueness
|
||||
added as default to compensate for the lack of reflection.
|
||||
|
||||
To use a reflection map set <reflect_map> to 1,and the path to the map texture in
|
||||
<texture n="8">
|
||||
|
||||
A default, null, bumpspec is specified as texture unit 4. To provide a custom bumpspec map,
|
||||
define <texture n="4"> in the derived effect file
|
||||
|
||||
If you are using Direct Draw Surface (.dds) files for your bumpmap set <normalmap_dds> to 1.
|
||||
|
||||
USE: To use the default reflection effect (controlled by material shininess values) use
|
||||
|
||||
<effect>
|
||||
<inherits-from>Effects/reflect-bump-spec</inherits-from>
|
||||
<object-name>Fuselage</object-name>
|
||||
</effect>
|
||||
|
||||
To use your own reflection effect, use
|
||||
|
||||
<effect>
|
||||
<inherits-from>Aircraft/Lightning/Models/Effects/lightningreflect</inherits-from>
|
||||
<object-name>Fuselage</object-name>
|
||||
</effect>
|
||||
|
||||
in your model file.
|
||||
|
||||
To use your own effect place your efffect file containing something like this:
|
||||
|
||||
<name>Effects/lightningreflect</name>
|
||||
<inherits-from>Effects/reflect-bump-spec</inherits-from>
|
||||
|
||||
and the the modified tags in the path as above
|
||||
|
||||
EXAMPLES: You can find examples of both usages in the Hunter and Lightning models.
|
||||
<!--
|
||||
Legacy Effect.
|
||||
It's kept for backwards compatibility and should not be used on new projects.
|
||||
-->
|
||||
<PropertyList>
|
||||
<name>Effects/reflect-bump-spec</name>
|
||||
<inherits-from>Effects/model-default</inherits-from>
|
||||
|
||||
<parameters>
|
||||
<texture n="4">
|
||||
<image>Aircraft/Generic/Effects/null_bumpspec.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="5">
|
||||
<type>cubemap</type>
|
||||
<!-- use this form for a cube cross -->
|
||||
<!--<image>Aircraft/Generic/Effects/CubeCrosses/blue_sky_big.jpg</image>-->
|
||||
|
||||
<!-- use this form for a 6 image cube map -->
|
||||
<images>
|
||||
<positive-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png</positive-x>
|
||||
<negative-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png</negative-x>
|
||||
<positive-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png</positive-y>
|
||||
<negative-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png</negative-y>
|
||||
<positive-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png</positive-z>
|
||||
<negative-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png</negative-z>
|
||||
</images>
|
||||
|
||||
</texture>
|
||||
<texture n="6">
|
||||
<image>Aircraft/Generic/Effects/Rainbow.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="7">
|
||||
<image>Aircraft/Generic/Effects/FresnelLookUp.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="8">
|
||||
<image>Aircraft/Generic/Effects/ReflectMaps/reflectmap.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<rendering-hint>transparent</rendering-hint>
|
||||
<shade-model>smooth</shade-model>
|
||||
<rainbowiness type="float">0.01</rainbowiness>
|
||||
<fresneliness>0.1</fresneliness>
|
||||
<noisiness>0.25</noisiness>
|
||||
<refl_correction>0.0</refl_correction>
|
||||
<ambient_correction>0.05</ambient_correction>
|
||||
<reflect_map>0</reflect_map>
|
||||
<normalmap_dds>0</normalmap_dds>
|
||||
<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>
|
||||
<terminator>
|
||||
<use>/environment/terminator-relative-position-m</use>
|
||||
</terminator>
|
||||
<fogtype>
|
||||
<use>/sim/rendering/shaders/skydome</use>
|
||||
</fogtype>
|
||||
</parameters>
|
||||
|
||||
<generate>
|
||||
<tangent type="int">6</tangent>
|
||||
<binormal type="int">7</binormal>
|
||||
</generate>
|
||||
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/model</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>
|
||||
<active>
|
||||
<use>material/active</use>
|
||||
</active>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<emissive>
|
||||
<use>material/emissive</use>
|
||||
</emissive>
|
||||
<shininess>
|
||||
<use>material/shininess</use>
|
||||
</shininess>
|
||||
<color-mode>
|
||||
<use>material/color-mode</use>
|
||||
</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active>
|
||||
<use>blend/active</use>
|
||||
</active>
|
||||
<source>
|
||||
<use>blend/source</use>
|
||||
</source>
|
||||
<destination>
|
||||
<use>blend/destination</use>
|
||||
</destination>
|
||||
</blend>
|
||||
<shade-model>
|
||||
<use>shade-model</use>
|
||||
</shade-model>
|
||||
<cull-face>
|
||||
<use>cull-face</use>
|
||||
</cull-face>
|
||||
<rendering-hint>
|
||||
<use>rendering-hint</use>
|
||||
</rendering-hint>
|
||||
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<image>
|
||||
<use>texture[8]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[8]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[8]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[8]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[8]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[8]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>4</unit>
|
||||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[4]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[4]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<type>
|
||||
<use>texture[5]/type</use>
|
||||
</type>
|
||||
|
||||
<!-- use this form for a cube cross -->
|
||||
<!--<image><use>texture[5]/image</use></image>-->
|
||||
|
||||
<!-- use this form for a 6 image cube map -->
|
||||
<images>
|
||||
<use>texture[5]/images</use>
|
||||
</images>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>6</unit>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[6]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[6]/wrap-t</use>
|
||||
</wrap-t>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>7</unit>
|
||||
<type>
|
||||
<use>texture[7]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[7]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[7]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[7]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[7]/wrap-t</use>
|
||||
</wrap-t>
|
||||
</texture-unit>
|
||||
|
||||
|
||||
<program>
|
||||
<!-- <vertex-shader>Shaders/include_fog.vert</vertex-shader> -->
|
||||
<vertex-shader n="1">Shaders/reflect-bump-spec.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/reflect-bump-spec.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>
|
||||
</program>
|
||||
|
||||
<uniform>
|
||||
<name>BaseTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Map</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Noise</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>NormalTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Environment</name>
|
||||
<type>sampler-cube</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Rainbow</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Fresnel</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">7</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fringing colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>rainbowiness</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>rainbowiness</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fresnel effect colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>fresneliness</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>fresneliness</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of noisiness 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>noisiness</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>noisiness</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- The reflection is set proportional to the shininess of the material.
|
||||
The amount of reflection may be adjusted by the use of this correction
|
||||
-1.0 (fully transparent)- 1.0 (fully opaque) -->
|
||||
<uniform>
|
||||
<name>refl_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>refl_correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of ambient light correction 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>ambient_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>ambient_correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- use a reflection map-->
|
||||
<uniform>
|
||||
<name>reflect_map</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflect_map</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- normalmap is .dds-->
|
||||
<uniform>
|
||||
<name>normalmap_dds</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>normalmap_dds</use>
|
||||
</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>
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
|
@ -1,427 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Reflections
|
||||
|
||||
PARAMETERS: There are two forms of cube map texture:- vertical cross and 6 images.
|
||||
Either can be used - alternative forms are shown in <parameters> and in <texture-unit>
|
||||
The reflection is set proportional to the shininess of the material. Thus by
|
||||
varying the material shininess value over or between objects the amount of
|
||||
refection can be controlled. The overall amount of reflection may be
|
||||
adjusted by the use of <refl_correction> -1.0 (fully transparent)- 1.0 (fully opaque).
|
||||
|
||||
The overall values of the noisiness, coloured fringing or fresnel effect may be adjusted
|
||||
by the use of <noisiness>, <rainbowiness> and <fresneliness>.
|
||||
|
||||
If your result is too dark/too light the overall ambient light value can be adjusted
|
||||
by the use of <ambient_correction>. This correction also takes out some of the blueness
|
||||
added as default to compensate for the lack of reflection.
|
||||
|
||||
To use a reflection map set <reflect_map> to 1,and the path to the map texture in
|
||||
<texture n="8">
|
||||
|
||||
To use a light map set <light_map> to 1,and the path to the map texture in
|
||||
<texture n="2">
|
||||
|
||||
USE: To use the default reflection effect (controlled by material shininess values) use
|
||||
|
||||
<effect>
|
||||
<inherits-from>Effects/reflect</inherits-from>
|
||||
<object-name>Fuselage</object-name>
|
||||
</<effect>
|
||||
|
||||
To use your own reflection effectuse
|
||||
|
||||
<effect>
|
||||
<inherits-from>Aircraft/Lightning/Models/Effects/lightningreflect</inherits-from>
|
||||
<object-name>Fuselage</object-name>
|
||||
</<effect>
|
||||
|
||||
in your model file.
|
||||
|
||||
To use your own effect place your efffect file containing something like this:
|
||||
|
||||
<name>Effects/lightningreflect</name>
|
||||
<inherits-from>Effects/reflect</inherits-from>
|
||||
|
||||
and the the modified tags in the path as above
|
||||
|
||||
EXAMPLES: You can find examples of both usages in the Hunter and Lightning models.
|
||||
<!--
|
||||
Legacy Effect.
|
||||
It's kept for backwards compatibility and should not be used on new projects.
|
||||
-->
|
||||
|
||||
<PropertyList>
|
||||
<name>Effects/reflect</name>
|
||||
<inherits-from>Effects/model-default</inherits-from>
|
||||
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<!--lightmap image -->
|
||||
<image>Aircraft/Generic/Effects/greymap.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
|
||||
<texture n="5">
|
||||
<type>cubemap</type>
|
||||
<!-- use this form for a cube cross -->
|
||||
<!--<image>Aircraft/Generic/Effects/CubeCrosses/blue_sky_big.jpg</image>-->
|
||||
|
||||
<!-- use this form for a 6 image cube map -->
|
||||
<images>
|
||||
<positive-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_px.png</positive-x>
|
||||
<negative-x>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nx.png</negative-x>
|
||||
<positive-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_py.png</positive-y>
|
||||
<negative-y>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_ny.png</negative-y>
|
||||
<positive-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_pz.png</positive-z>
|
||||
<negative-z>Aircraft/Generic/Effects/CubeMaps/fair-sky/fair-sky_nz.png</negative-z>
|
||||
</images>
|
||||
|
||||
</texture>
|
||||
<texture n="6">
|
||||
<image>Aircraft/Generic/Effects/Rainbow.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="7">
|
||||
<image>Aircraft/Generic/Effects/FresnelLookUp.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="8">
|
||||
<image>Aircraft/Generic/Effects/ReflectMaps/reflectmap.png</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<rendering-hint>transparent</rendering-hint>
|
||||
<shade-model>smooth</shade-model>
|
||||
<rainbowiness type="float">0.01</rainbowiness>
|
||||
<fresneliness>0.1</fresneliness>
|
||||
<noisiness>0.25</noisiness>
|
||||
<refl_correction>0.0</refl_correction>
|
||||
<ambient_correction>0.05</ambient_correction>
|
||||
<reflect_map type="int">0</reflect_map>
|
||||
<light_map type="int">0</light_map>
|
||||
<factor>1</factor>
|
||||
</parameters>
|
||||
|
||||
<technique n="9">
|
||||
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/model</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>
|
||||
<active>
|
||||
<use>material/active</use>
|
||||
</active>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<emissive>
|
||||
<use>material/emissive</use>
|
||||
</emissive>
|
||||
<shininess>
|
||||
<use>material/shininess</use>
|
||||
</shininess>
|
||||
<color-mode>
|
||||
<use>material/color-mode</use>
|
||||
</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<active>
|
||||
<use>blend/active</use>
|
||||
</active>
|
||||
<source>
|
||||
<use>blend/source</use>
|
||||
</source>
|
||||
<destination>
|
||||
<use>blend/destination</use>
|
||||
</destination>
|
||||
</blend>
|
||||
<shade-model>
|
||||
<use>shade-model</use>
|
||||
</shade-model>
|
||||
<cull-face>
|
||||
<use>cull-face</use>
|
||||
</cull-face>
|
||||
<rendering-hint>
|
||||
<use>rendering-hint</use>
|
||||
</rendering-hint>
|
||||
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<image>
|
||||
<use>texture[8]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[8]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[8]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[8]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[8]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>3</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<type>
|
||||
<use>texture[5]/type</use>
|
||||
</type>
|
||||
|
||||
<!-- use this form for a cube cross -->
|
||||
<!--<image>
|
||||
<use>texture[5]/image</use>
|
||||
</image>-->
|
||||
|
||||
<!-- use this form for a 6 image cube map -->
|
||||
<images>
|
||||
<use>texture[5]/images</use>
|
||||
</images>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>6</unit>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[6]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[6]/wrap-t</use>
|
||||
</wrap-t>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>7</unit>
|
||||
<type>
|
||||
<use>texture[7]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[7]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[7]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[7]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[7]/wrap-t</use>
|
||||
</wrap-t>
|
||||
</texture-unit>
|
||||
|
||||
<program>
|
||||
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||
<vertex-shader n="1">Shaders/reflect.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/reflect.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>normal</name>
|
||||
<index>15</index>
|
||||
</attribute>
|
||||
</program>
|
||||
|
||||
<uniform>
|
||||
<name>BaseTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Map</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Lightmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Noise</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Environment</name>
|
||||
<type>sampler-cube</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Rainbow</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Fresnel</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">7</value>
|
||||
</uniform>
|
||||
<!-- set the amount of fringing colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>rainbowiness</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>rainbowiness</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fresnel effect colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>fresneliness</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>fresneliness</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of noisiness 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>noisiness</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>noisiness</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- The reflection is set proportional to the shininess of the material.
|
||||
The amount of reflection may be adjusted by the use of this correction
|
||||
-1.0 (fully transparent)- 1.0 (fully opaque) -->
|
||||
<uniform>
|
||||
<name>refl_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>refl_correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of ambient light correction 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>ambient_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>ambient_correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- use a reflection map-->
|
||||
<uniform>
|
||||
<name>reflect_map</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>reflect_map</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- use a light map-->
|
||||
<uniform>
|
||||
<name>light_map</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>light_map</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>lightmap_factor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>factor</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
</PropertyList>
|
||||
|
|
|
@ -53,7 +53,6 @@
|
|||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/skydome</property>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/model</property>
|
||||
<or>
|
||||
<less-equal>
|
||||
|
|
|
@ -886,348 +886,4 @@
|
|||
</alpha-test>
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/generic</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>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<type>
|
||||
<use>texture[8]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[8]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[8]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[8]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[8]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[8]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>4</unit>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[4]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[4]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<type>
|
||||
<use>texture[5]/type</use>
|
||||
</type>
|
||||
|
||||
<!-- use this form for a cube cross -->
|
||||
<!--<image>
|
||||
<use>texture[5]/image</use>
|
||||
</image>-->
|
||||
|
||||
<!-- use this form for a 6 image cube map -->
|
||||
<images>
|
||||
<use>texture[5]/images</use>
|
||||
</images>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>6</unit>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[6]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[6]/wrap-t</use>
|
||||
</wrap-t>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>7</unit>
|
||||
<type>
|
||||
<use>texture[7]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[7]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[7]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[7]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[7]/wrap-t</use>
|
||||
</wrap-t>
|
||||
</texture-unit>
|
||||
|
||||
<vertex-program-two-side>
|
||||
<use>vertex-program-two-side</use>
|
||||
</vertex-program-two-side>
|
||||
<cull-face>
|
||||
<use>cull-face</use>
|
||||
</cull-face>
|
||||
|
||||
<program>
|
||||
<!-- <vertex-shader n="0">Shaders/include_fog.vert</vertex-shader> -->
|
||||
<vertex-shader n="1">Shaders/runway.vert</vertex-shader>
|
||||
<vertex-shader n="2">Shaders/shadows-include.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/runway.frag</fragment-shader>
|
||||
<fragment-shader n="2">Shaders/shadows-include.frag</fragment-shader>
|
||||
<fragment-shader n="3">Shaders/clustered-include.frag</fragment-shader>
|
||||
<attribute>
|
||||
<name>tangent</name>
|
||||
<index>6</index>
|
||||
</attribute>
|
||||
<attribute>
|
||||
<name>binormal</name>
|
||||
<index>7</index>
|
||||
</attribute>
|
||||
</program>
|
||||
|
||||
<uniform>
|
||||
<name>BaseTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Map</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Noise</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>NormalTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Environment</name>
|
||||
<type>sampler-cube</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Rainbow</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Fresnel</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">7</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fringing colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>rainbowiness</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>rainbowiness</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of fresnel effect colour 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>fresneliness</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>fresneliness</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of noisiness 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>noisiness</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>noisiness</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- The reflection is set proportional to the shininess of the material.
|
||||
The amount of reflection may be adjusted by the use of this correction
|
||||
-1.0 (fully transparent)- 1.0 (fully opaque) -->
|
||||
<uniform>
|
||||
<name>spec_adjust</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>rnorm</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- set the amount of ambient light correction 0.0 - 1.0 -->
|
||||
<uniform>
|
||||
<name>ambient_correction</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>ambient_correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- use a reflection map-->
|
||||
<uniform>
|
||||
<name>reflect_map</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>reflect_map</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<!-- normalmap is .dds-->
|
||||
<uniform>
|
||||
<name>normalmap_dds</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>normalmap_dds</use>
|
||||
</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>
|
||||
<!-- BEGIN shadows include -->
|
||||
<uniform>
|
||||
<name>shadow_tex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">10</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>shadows_enabled</name>
|
||||
<type>bool</type>
|
||||
<value>
|
||||
<use>shadows_enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sun_atlas_size</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>sun_atlas_size</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- END shadows include -->
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -1468,10 +1468,7 @@
|
|||
<and>
|
||||
<or>
|
||||
<property>/sim/rendering/photoscenery/enabled</property>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/generic</property>
|
||||
</and>
|
||||
<property>/sim/rendering/shaders/use-shaders</property>
|
||||
</or>
|
||||
<or>
|
||||
<less-equal>
|
||||
|
|
|
@ -2,16 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/transition-base-dirt</name>
|
||||
<inherits-from>Effects/transition</inherits-from>
|
||||
<parameters>
|
||||
<texture n="3">
|
||||
<image>Textures/Terrain/dirt3.dds</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<transitions type="float">1.0</transitions>
|
||||
<inverse type="float">0.0</inverse>
|
||||
</parameters>
|
||||
</PropertyList>
|
||||
|
|
|
@ -2,16 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/transition-base-rock</name>
|
||||
<inherits-from>Effects/transition</inherits-from>
|
||||
<parameters>
|
||||
<texture n="3">
|
||||
<image>Textures/Terrain/herbtundra.dds</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<transitions type="float">1.0</transitions>
|
||||
<inverse type="float">1.0</inverse>
|
||||
</parameters>
|
||||
</PropertyList>
|
||||
|
|
|
@ -2,32 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/transition-base-grass-rock</name>
|
||||
<inherits-from>Effects/transition</inherits-from>
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<image>Textures/Terrain/grass10c.dds</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="3">
|
||||
<image>Textures/Terrain/rock7.dds</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="4">
|
||||
<image>Textures/Terrain.winter/mixedforest1c.dds</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<transitions type="float">2.0</transitions>
|
||||
<inverse type="float">0.0</inverse>
|
||||
</parameters>
|
||||
</PropertyList>
|
||||
|
|
|
@ -2,16 +2,4 @@
|
|||
<PropertyList>
|
||||
<name>Effects/transition-base-rock</name>
|
||||
<inherits-from>Effects/transition</inherits-from>
|
||||
<parameters>
|
||||
<texture n="3">
|
||||
<image>Textures/Terrain/rock7.dds</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<transitions type="float">1.0</transitions>
|
||||
<inverse type="float">0.0</inverse>
|
||||
</parameters>
|
||||
</PropertyList>
|
||||
|
|
|
@ -1,426 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Transition effect starting from the base texture of the scenery, and changing textures according to slope in one or two steps.
|
||||
|
||||
parameters :
|
||||
texture[0] -> base texture from the scenery
|
||||
texture[2] -> intermediate texture if transitions is set to 2
|
||||
texture[3] -> texture you want to transition to
|
||||
texture[4] -> snow texture you want applied above snow-limit (I recommend using the corespondent winter texture for the base texture that you can find in terrain.winter)
|
||||
|
||||
transitions -> transitions number can be set to 1 or 2 (if set to 2 will allow for an intermediate step)
|
||||
inverse -> if this is set to 1 will keep the base texture on steep slopes and transition to the texture you want (useful to add some grass patches in rocky areas)
|
||||
-->
|
||||
|
||||
<PropertyList>
|
||||
<name>Effects/transition</name>
|
||||
<inherits-from>Effects/terrain-default</inherits-from>
|
||||
<parameters>
|
||||
<texture n="2">
|
||||
<image>Textures/Terrain/transition1.dds</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="3">
|
||||
<image>Textures/Terrain/transition2.dds</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
<texture n="4">
|
||||
<image>Textures/Terrain/snow3.dds</image>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
<internal-format>normalized</internal-format>
|
||||
</texture>
|
||||
|
||||
<rain-norm>
|
||||
<use>/environment/rain-norm</use>
|
||||
</rain-norm>
|
||||
<snow-level>
|
||||
<use>/environment/snow-level-m</use>
|
||||
</snow-level>
|
||||
|
||||
<cloud-cover0>
|
||||
<use>/environment/clouds/layer[0]/coverage-type</use>
|
||||
</cloud-cover0>
|
||||
<cloud-cover1>
|
||||
<use>/environment/clouds/layer[1]/coverage-type</use>
|
||||
</cloud-cover1>
|
||||
<cloud-cover2>
|
||||
<use>/environment/clouds/layer[2]/coverage-type</use>
|
||||
</cloud-cover2>
|
||||
<cloud-cover3>
|
||||
<use>/environment/clouds/layer[3]/coverage-type</use>
|
||||
</cloud-cover3>
|
||||
<cloud-cover4>
|
||||
<use>/environment/clouds/layer[4]/coverage-type</use>
|
||||
</cloud-cover4>
|
||||
|
||||
<transitions type="float">2.0</transitions>
|
||||
<inverse type="float">0.0</inverse>
|
||||
|
||||
<!-- 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>
|
||||
<terminator>
|
||||
<use>/environment/terminator-relative-position-m</use>
|
||||
</terminator>
|
||||
<fogtype>
|
||||
<use>/sim/rendering/shaders/skydome</use>
|
||||
</fogtype>
|
||||
<!-- END fog include -->
|
||||
</parameters>
|
||||
|
||||
<!--<generate>
|
||||
<tangent type="int">6</tangent>
|
||||
<binormal type="int">7</binormal>
|
||||
</generate>-->
|
||||
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/transition</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>
|
||||
<!-- Use material values that are either inherited from the
|
||||
terrain-default effect or supplied by an effect derived
|
||||
from this one e.g., one created in the materials library. -->
|
||||
<material>
|
||||
<ambient>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
|
||||
<render-bin>
|
||||
<bin-number>
|
||||
<use>render-bin/bin-number</use>
|
||||
</bin-number>
|
||||
<bin-name>
|
||||
<use>render-bin/bin-name</use>
|
||||
</bin-name>
|
||||
</render-bin>
|
||||
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[2]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[2]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[3]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[3]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>3</unit>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[4]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[4]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<texture-unit>
|
||||
<unit>4</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
|
||||
<program>
|
||||
<!-- <vertex-shader>Shaders/include_fog.vert</vertex-shader> -->
|
||||
<vertex-shader n="1">Shaders/transition.vert</vertex-shader>
|
||||
<vertex-shader n="2">Shaders/shadows-include.vert</vertex-shader>
|
||||
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader n="1">Shaders/transition.frag</fragment-shader>
|
||||
<fragment-shader n="2">Shaders/shadows-include.frag</fragment-shader>
|
||||
<fragment-shader n="3">Shaders/clustered-include.frag</fragment-shader>
|
||||
</program>
|
||||
|
||||
<uniform>
|
||||
<name>BaseTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>SecondTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>ThirdTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>SnowTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>NoiseTex</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>RainNorm</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>rain-norm</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>SnowLevel</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>snow-level</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>Transitions</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>transitions</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>InverseSlope</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>inverse</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>CloudCover0</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover0</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>CloudCover1</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover1</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>CloudCover2</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover2</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>CloudCover3</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover3</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>CloudCover4</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover4</use>
|
||||
</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>
|
||||
<!-- END fog include -->
|
||||
<!-- BEGIN shadows include -->
|
||||
<uniform>
|
||||
<name>shadow_tex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">10</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>shadows_enabled</name>
|
||||
<type>bool</type>
|
||||
<value>
|
||||
<use>shadows_enabled</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sun_atlas_size</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>sun_atlas_size</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- END shadows include -->
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
<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>
|
||||
<forest_effects><use>/sim/rendering/shaders/forest</use></forest_effects>
|
||||
<forest_effects>true</forest_effects>
|
||||
<windE><use>/environment/sea/surface/wind-from-east-fps</use></windE>
|
||||
<windN><use>/environment/sea/surface/wind-from-north-fps</use></windN>
|
||||
<display_xsize><use>/sim/startup/xsize</use></display_xsize>
|
||||
|
@ -1693,7 +1693,6 @@
|
|||
<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>
|
||||
|
|
1990
Effects/urban.eff
1990
Effects/urban.eff
File diff suppressed because it is too large
Load diff
|
@ -1414,386 +1414,4 @@
|
|||
</pass>
|
||||
</technique>
|
||||
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/water</property>
|
||||
<less-equal>
|
||||
<value type="float">2.0</value>
|
||||
<float-property>/sim/rendering/shaders/water</float-property>
|
||||
</less-equal>
|
||||
<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>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number>
|
||||
<use>render-bin/bin-number</use>
|
||||
</bin-number>
|
||||
<bin-name>
|
||||
<use>render-bin/bin-name</use>
|
||||
</bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[2]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[2]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>3</unit>
|
||||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[3]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[3]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>4</unit>
|
||||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[4]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[4]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<image>
|
||||
<use>texture[5]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[5]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[5]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[5]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[5]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[5]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>6</unit>
|
||||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[6]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[6]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[6]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<program>
|
||||
<vertex-shader>Shaders/water.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/water.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>water_reflection</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_normalmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_dudvmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_reflection_grey</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sea_foam</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>perlin_normalmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
<!-- normalmap is .dds-->
|
||||
<uniform>
|
||||
<name>normalmap_dds</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>normalmap_dds</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>saturation</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>saturation</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover0</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover1</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover2</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover3</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[3]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover4</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[4]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>Status</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>status</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>Overcast</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>overcast</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>WaveFreq</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveFreq</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveAmp</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveAmp</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveSharp</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveSharp</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveAngle</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveAngle</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveFactor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveFactor</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveDAngle</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveDAngle</use>
|
||||
</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>
|
||||
<!-- END fog include -->
|
||||
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -1390,830 +1390,4 @@
|
|||
<!-- END fog include -->
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
<technique n="8">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/water</property>
|
||||
<less-equal>
|
||||
<value type="float">4.0</value>
|
||||
<float-property>/sim/rendering/shaders/water</float-property>
|
||||
</less-equal>
|
||||
<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>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number>
|
||||
<use>render-bin/bin-number</use>
|
||||
</bin-number>
|
||||
<bin-name>
|
||||
<use>render-bin/bin-name</use>
|
||||
</bin-name>
|
||||
</render-bin>
|
||||
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>1</unit>
|
||||
<type>noise</type>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[2]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[2]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>3</unit>
|
||||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[3]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[3]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>4</unit>
|
||||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[4]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[4]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<image>
|
||||
<use>texture[5]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[5]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[5]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[5]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[5]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[5]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>6</unit>
|
||||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[6]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[6]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[6]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>7</unit>
|
||||
<image>
|
||||
<use>texture[7]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[7]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[7]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[7]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[7]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[7]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<program>
|
||||
<vertex-shader>Shaders/water.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/water_sine.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>water_reflection</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>Noise</name>
|
||||
<type>sampler-3d</type>
|
||||
<value type="int">1</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_normalmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_dudvmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_reflection_grey</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sea_foam</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>perlin_normalmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>topo_map</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">7</value>
|
||||
</uniform>
|
||||
<!-- normalmap is .dds-->
|
||||
<uniform>
|
||||
<name>normalmap_dds</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>normalmap_dds</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>saturation</name>
|
||||
<type>float</type>
|
||||
<!--<value>0.4</value>-->
|
||||
<value>
|
||||
<use>saturation</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover0</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover1</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover2</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover3</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[3]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover4</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[4]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- <uniform>
|
||||
<name>CloudCoverLo</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>cloud-cover-lo</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCoverHi</name>
|
||||
<type>float-vec3</type>
|
||||
<value>
|
||||
<use>cloud-cover-hi</use>
|
||||
</value>
|
||||
</uniform>-->
|
||||
<uniform>
|
||||
<name>Status</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>status</use>
|
||||
</value>
|
||||
<!--<value type="int">0</value> -->
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>Overcast</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>overcast</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>WaveFreq</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveFreq</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveAmp</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveAmp</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveSharp</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveSharp</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveAngle</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveAngle</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveFactor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveFactor</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveDAngle</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveDAngle</use>
|
||||
</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>
|
||||
<!-- END fog include -->
|
||||
</pass>
|
||||
</technique>
|
||||
|
||||
<technique n="9">
|
||||
<predicate>
|
||||
<and>
|
||||
<property>/sim/rendering/shaders/quality-level</property>
|
||||
<property>/sim/rendering/shaders/water</property>
|
||||
<less-equal>
|
||||
<value type="float">2.0</value>
|
||||
<float-property>/sim/rendering/shaders/water</float-property>
|
||||
</less-equal>
|
||||
<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>
|
||||
<use>material/ambient</use>
|
||||
</ambient>
|
||||
<diffuse>
|
||||
<use>material/diffuse</use>
|
||||
</diffuse>
|
||||
<specular>
|
||||
<use>material/specular</use>
|
||||
</specular>
|
||||
<color-mode>ambient-and-diffuse</color-mode>
|
||||
</material>
|
||||
<blend>
|
||||
<use>transparent</use>
|
||||
</blend>
|
||||
<alpha-test>
|
||||
<use>transparent</use>
|
||||
</alpha-test>
|
||||
<shade-model>smooth</shade-model>
|
||||
<cull-face>back</cull-face>
|
||||
<render-bin>
|
||||
<bin-number>
|
||||
<use>render-bin/bin-number</use>
|
||||
</bin-number>
|
||||
<bin-name>
|
||||
<use>render-bin/bin-name</use>
|
||||
</bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[0]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[0]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[0]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>2</unit>
|
||||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[2]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[2]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[2]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>3</unit>
|
||||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[3]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[3]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[3]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>4</unit>
|
||||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[4]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[4]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[4]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>5</unit>
|
||||
<image>
|
||||
<use>texture[5]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[5]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[5]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[5]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[5]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[5]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
<texture-unit>
|
||||
<unit>6</unit>
|
||||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
<wrap-s>
|
||||
<use>texture[6]/wrap-s</use>
|
||||
</wrap-s>
|
||||
<wrap-t>
|
||||
<use>texture[6]/wrap-t</use>
|
||||
</wrap-t>
|
||||
<internal-format>
|
||||
<use>texture[6]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>
|
||||
|
||||
<program>
|
||||
<vertex-shader>Shaders/water.vert</vertex-shader>
|
||||
<fragment-shader>Shaders/include_fog.frag</fragment-shader>
|
||||
<fragment-shader>Shaders/water.frag</fragment-shader>
|
||||
</program>
|
||||
<uniform>
|
||||
<name>water_reflection</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">0</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_normalmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">2</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_dudvmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">3</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>water_reflection_grey</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">4</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>sea_foam</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">5</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>perlin_normalmap</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
<!-- normalmap is .dds-->
|
||||
<uniform>
|
||||
<name>normalmap_dds</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>normalmap_dds</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>saturation</name>
|
||||
<type>float</type>
|
||||
<!--<value>0.4</value>-->
|
||||
<value>
|
||||
<use>saturation</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover0</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[0]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover1</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[1]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover2</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[2]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover3</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[3]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>CloudCover4</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>cloud-cover[4]</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>Status</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>status</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>Overcast</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>overcast</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> unused?
|
||||
<name>WindFrom</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>wind-from</use>
|
||||
</value>
|
||||
</uniform-->
|
||||
<uniform>
|
||||
<name>WaveFreq</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveFreq</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveAmp</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveAmp</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveSharp</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveSharp</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveAngle</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveAngle</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveFactor</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveFactor</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<uniform>
|
||||
<name>WaveDAngle</name>
|
||||
<type>float</type>
|
||||
<value>
|
||||
<use>WaveDAngle</use>
|
||||
</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>
|
||||
<!-- END fog include -->
|
||||
</pass>
|
||||
</technique>
|
||||
</PropertyList>
|
||||
|
|
|
@ -1366,90 +1366,6 @@ setlistener("/sim/signals/fdm-initialized", func {
|
|||
do_welcome = 0;
|
||||
});
|
||||
|
||||
|
||||
##
|
||||
# overwrite custom shader settings when quality-level is set on startup
|
||||
var qualityLevel = getprop("/sim/rendering/shaders/quality-level");
|
||||
var rembrandtOn = getprop("/sim/rendering/rembrandt/enabled");
|
||||
if (qualityLevel == -1) {
|
||||
setprop("/sim/rendering/shaders/custom-settings",1);
|
||||
}
|
||||
elsif (qualityLevel != nil) {
|
||||
setprop("/sim/rendering/shaders/custom-settings",0);
|
||||
setprop("/sim/rendering/shaders/quality-level-internal",qualityLevel);
|
||||
if (qualityLevel == 0) {
|
||||
setprop("/sim/rendering/shaders/skydome",0);
|
||||
}
|
||||
}
|
||||
|
||||
# overwrite custom shader settings when quality-level is set through the slider
|
||||
# in the Rendering Options dialog
|
||||
var update_shader_settings = func() {
|
||||
var shaderPath = "/sim/rendering/shaders/";
|
||||
if (getprop(shaderPath ~ "custom-settings")) {
|
||||
setprop(shaderPath ~ "quality-level", -1);
|
||||
} else {
|
||||
var qualityLvl = getprop(shaderPath ~ "quality-level-internal") or 0;
|
||||
setprop(shaderPath ~ "quality-level", qualityLvl);
|
||||
|
||||
if (qualityLvl < 2) {
|
||||
# Non-ALS fallback
|
||||
setprop(shaderPath ~ "skydome", 0.0);
|
||||
setprop(shaderPath ~ "quality-level", qualityLvl);
|
||||
setprop(shaderPath ~ "landmass", qualityLvl);
|
||||
setprop(shaderPath ~ "urban", qualityLvl);
|
||||
setprop(shaderPath ~ "water", qualityLvl);
|
||||
|
||||
qualityLvl = math.min(qualityLvl, 4.0);
|
||||
setprop(shaderPath ~ "lights", qualityLvl);
|
||||
|
||||
qualityLvl = math.min(qualityLvl, 1.0);
|
||||
setprop(shaderPath ~ "model", qualityLvl);
|
||||
setprop(shaderPath ~ "contrails", qualityLvl);
|
||||
setprop(shaderPath ~ "crop", qualityLvl);
|
||||
setprop(shaderPath ~ "generic", qualityLvl);
|
||||
setprop(shaderPath ~ "transition", qualityLvl);
|
||||
} else {
|
||||
# ALS from quality 2 upwards
|
||||
setprop(shaderPath ~ "skydome", 1.0);
|
||||
|
||||
if (qualityLvl != 0.0) {
|
||||
setprop(shaderPath ~ "landmass", qualityLvl + 1); # these go to 6 rather than 5
|
||||
setprop(shaderPath ~ "transition", qualityLvl + 1);
|
||||
} else {
|
||||
setprop(shaderPath ~ "landmass", 0);
|
||||
setprop(shaderPath ~ "transition", 0);
|
||||
}
|
||||
setprop(shaderPath ~ "water", qualityLvl);
|
||||
setprop(shaderPath ~ "urban", qualityLvl);
|
||||
|
||||
if (qualityLvl >= 5.0) {
|
||||
setprop(shaderPath ~ "vegetation-effects", qualityLvl);
|
||||
} else {
|
||||
setprop(shaderPath ~ "vegetation-effects", 0);
|
||||
}
|
||||
|
||||
qualityLvl = math.min(qualityLvl, 4.0);
|
||||
setprop(shaderPath ~ "lights", qualityLvl);
|
||||
|
||||
qualityLvl = math.min(qualityLvl, 3.0);
|
||||
setprop(shaderPath ~ "model", qualityLvl);
|
||||
|
||||
qualityLvl = math.min(qualityLvl, 2.0);
|
||||
setprop(shaderPath ~ "wind-effects", qualityLvl);
|
||||
|
||||
qualityLvl = math.min(qualityLvl, 1.0);
|
||||
setprop(shaderPath ~ "crop", qualityLvl);
|
||||
setprop(shaderPath ~ "clouds", qualityLvl);
|
||||
setprop(shaderPath ~ "forest", qualityLvl);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
setlistener("/sim/rendering/shaders/custom-settings", func { update_shader_settings() } );
|
||||
setlistener("/sim/rendering/shaders/quality-level-internal", func { update_shader_settings() } );
|
||||
update_shader_settings();
|
||||
|
||||
screenHProp = props.globals.getNode("/sim/startup/ysize");
|
||||
|
||||
props.globals.getNode("/sim/help/debug", 1).setValues(debug_keys);
|
||||
|
|
|
@ -1,217 +0,0 @@
|
|||
// This shader is mostly an adaptation of the shader found at
|
||||
// http://www.bonzaisoftware.com/water_tut.html and its glsl conversion
|
||||
// available at http://forum.bonzaisoftware.com/viewthread.php?tid=10
|
||||
// © Michael Horsch - 2005
|
||||
// Major update and revisions - 2011-10-07
|
||||
// © Emilian Huminiuc and Vivian Meazza
|
||||
// Optimisation - 2012-5-05
|
||||
// © Emilian Huminiuc and Vivian Meazza
|
||||
|
||||
#version 120
|
||||
#define fps2kts 0.5925
|
||||
|
||||
uniform sampler2D water_normalmap;
|
||||
uniform sampler2D water_reflection;
|
||||
uniform sampler2D water_dudvmap;
|
||||
uniform sampler2D water_reflection_grey;
|
||||
uniform sampler2D sea_foam;
|
||||
uniform sampler2D alpha_tex;
|
||||
uniform sampler2D bowwave_nmap;
|
||||
|
||||
uniform float saturation, Overcast, WindE, WindN, spd, hdg;
|
||||
uniform float CloudCover0, CloudCover1, CloudCover2, CloudCover3, CloudCover4;
|
||||
uniform int Status;
|
||||
|
||||
varying vec4 waterTex1; //moving texcoords
|
||||
varying vec4 waterTex2; //moving texcoords
|
||||
varying vec3 viewerdir;
|
||||
varying vec3 lightdir;
|
||||
varying vec3 normal;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
/////// functions /////////
|
||||
|
||||
float normalize_range(float _val)
|
||||
{
|
||||
if (_val > 180.0)
|
||||
return _val - 360.0;
|
||||
else
|
||||
return _val;
|
||||
}
|
||||
|
||||
|
||||
void relWind(out float rel_wind_speed_kts, out float rel_wind_from_rad)
|
||||
{
|
||||
//calculate the carrier speed north and east in kts
|
||||
float speed_north_kts = cos(radians(hdg)) * spd ;
|
||||
float speed_east_kts = sin(radians(hdg)) * spd ;
|
||||
|
||||
//calculate the relative wind speed north and east in kts
|
||||
float rel_wind_speed_from_east_kts = WindE*fps2kts + speed_east_kts;
|
||||
float rel_wind_speed_from_north_kts = WindN*fps2kts + speed_north_kts;
|
||||
|
||||
//combine relative speeds north and east to get relative windspeed in kts
|
||||
rel_wind_speed_kts = sqrt(rel_wind_speed_from_east_kts*rel_wind_speed_from_east_kts
|
||||
+ rel_wind_speed_from_north_kts*rel_wind_speed_from_north_kts);
|
||||
|
||||
//calculate the relative wind direction
|
||||
float rel_wind_from_deg = degrees(atan(rel_wind_speed_from_east_kts, rel_wind_speed_from_north_kts));
|
||||
// rel_wind_from_rad = atan(rel_wind_speed_from_east_kts, rel_wind_speed_from_north_kts);
|
||||
float rel_wind = rel_wind_from_deg - hdg;
|
||||
rel_wind = normalize_range(rel_wind);
|
||||
rel_wind_from_rad = radians(rel_wind);
|
||||
}
|
||||
|
||||
void rotationmatrix(in float angle, out mat4 rotmat)
|
||||
{
|
||||
rotmat = mat4( cos( angle ), -sin( angle ), 0.0, 0.0,
|
||||
sin( angle ), cos( angle ), 0.0, 0.0,
|
||||
0.0 , 0.0 , 1.0, 0.0,
|
||||
0.0 , 0.0 , 0.0, 1.0 );
|
||||
}
|
||||
|
||||
//////////////////////
|
||||
|
||||
void main(void)
|
||||
{
|
||||
const vec4 sca = vec4(0.005, 0.005, 0.005, 0.005);
|
||||
const vec4 sca2 = vec4(0.02, 0.02, 0.02, 0.02);
|
||||
const vec4 tscale = vec4(0.25, 0.25, 0.25, 0.25);
|
||||
|
||||
mat4 RotationMatrix;
|
||||
|
||||
float relWindspd=0;
|
||||
float relWinddir=0;
|
||||
|
||||
// compute relative wind speed and direction
|
||||
relWind (relWindspd, relWinddir);
|
||||
|
||||
rotationmatrix(relWinddir, RotationMatrix);
|
||||
|
||||
// compute direction to viewer
|
||||
vec3 E = normalize(viewerdir);
|
||||
|
||||
// compute direction to light source
|
||||
vec3 L = normalize(lightdir);
|
||||
|
||||
// half vector
|
||||
vec3 H = normalize(L + E);
|
||||
|
||||
const float water_shininess = 240.0;
|
||||
// approximate cloud cover
|
||||
float cover = 0.0;
|
||||
//bool Status = true;
|
||||
|
||||
float windEffect = relWindspd; //wind speed in kt
|
||||
// float windEffect = sqrt(pow(abs(WindE),2)+pow(abs(WindN),2)) * 0.6; //wind speed in kt
|
||||
float windScale = 15.0/(5.0 + windEffect); //wave scale
|
||||
float waveRoughness = 0.05 + smoothstep(0.0, 50.0, windEffect); //wave roughness filter
|
||||
|
||||
|
||||
if (Status == 1){
|
||||
cover = min(min(min(min(CloudCover0, CloudCover1),CloudCover2),CloudCover3),CloudCover4);
|
||||
} else {
|
||||
// hack to allow for Overcast not to be set by Local Weather
|
||||
|
||||
if (Overcast == 0){
|
||||
cover = 5;
|
||||
} else {
|
||||
cover = Overcast * 5;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//vec4 viewt = normalize(waterTex4);
|
||||
vec4 viewt = vec4(-E, 0.0) * 0.6;
|
||||
|
||||
vec4 disdis = texture2D(water_dudvmap, vec2(waterTex2 * tscale)* windScale * 2.0) * 2.0 - 1.0;
|
||||
vec4 dist = texture2D(water_dudvmap, vec2(waterTex1 + disdis*sca2)* windScale * 2.0) * 2.0 - 1.0;
|
||||
vec4 fdist = normalize(dist);
|
||||
fdist = -fdist;
|
||||
fdist *= sca;
|
||||
|
||||
//normalmap
|
||||
rotationmatrix(-relWinddir, RotationMatrix);
|
||||
|
||||
vec4 nmap0 = texture2D(water_normalmap, vec2((waterTex1 + disdis*sca2) * RotationMatrix ) * windScale * 2.0) * 2.0 - 1.0;
|
||||
vec4 nmap2 = texture2D(water_normalmap, vec2(waterTex2 * tscale * RotationMatrix ) * windScale * 2.0) * 2.0 - 1.0;
|
||||
vec4 nmap3 = texture2D(bowwave_nmap, gl_TexCoord[0].st) * 2.0 - 1.0;
|
||||
vec4 vNorm = normalize(mix(nmap3, nmap0 + nmap2, 0.3 )* waveRoughness);
|
||||
vNorm = -vNorm;
|
||||
|
||||
//load reflection
|
||||
vec4 tmp = vec4(lightdir, 0.0);
|
||||
vec4 refTex = texture2D(water_reflection, vec2(tmp + waterTex1) * 32.0) ;
|
||||
vec4 refTexGrey = texture2D(water_reflection_grey, vec2(tmp + waterTex1) * 32.0) ;
|
||||
vec4 refl ;
|
||||
// cover = 0;
|
||||
|
||||
if(cover >= 1.5){
|
||||
refl= normalize(refTex);
|
||||
}
|
||||
else
|
||||
{
|
||||
refl = normalize(refTexGrey);
|
||||
refl.r *= (0.75 + 0.15 * cover);
|
||||
refl.g *= (0.80 + 0.15 * cover);
|
||||
refl.b *= (0.875 + 0.125 * cover);
|
||||
refl.a *= 1.0;
|
||||
}
|
||||
|
||||
vec3 N0 = vec3(texture2D(water_normalmap, vec2((waterTex1 + disdis*sca2)* RotationMatrix) * windScale * 2.0) * 2.0 - 1.0);
|
||||
vec3 N1 = vec3(texture2D(water_normalmap, vec2(waterTex2 * tscale * RotationMatrix ) * windScale * 2.0) * 2.0 - 1.0);
|
||||
vec3 N2 = vec3(texture2D(bowwave_nmap, gl_TexCoord[0].st)*2.0-1.0);
|
||||
//vec3 Nf = normalize((normal+N0+N1)*waveRoughness);
|
||||
vec3 N = normalize(mix(normal+N2, normal+N0+N1, 0.3)* waveRoughness);
|
||||
N = -N;
|
||||
|
||||
// specular
|
||||
vec3 specular_color = vec3(gl_LightSource[0].diffuse)
|
||||
* pow(max(0.0, dot(N, H)), water_shininess) * 6.0;
|
||||
vec4 specular = vec4(specular_color, 0.5);
|
||||
|
||||
specular = specular * saturation * 0.3;
|
||||
|
||||
//calculate fresnel
|
||||
vec4 invfres = vec4( dot(vNorm, viewt) );
|
||||
vec4 fres = vec4(1.0) + invfres;
|
||||
refl *= fres;
|
||||
|
||||
vec4 alpha0 = texture2D(alpha_tex, gl_TexCoord[0].st);
|
||||
|
||||
//calculate final colour
|
||||
vec4 ambient_light = gl_LightSource[0].diffuse;
|
||||
vec4 finalColor;
|
||||
|
||||
// cover = 0;
|
||||
|
||||
if(cover >= 1.5){
|
||||
finalColor = refl + specular;
|
||||
} else {
|
||||
finalColor = refl;
|
||||
}
|
||||
|
||||
//add foam
|
||||
|
||||
float foamSlope = 0.05 + 0.01 * windScale;
|
||||
//float waveSlope = mix(N0.g, N1.g, 0.25);
|
||||
|
||||
vec4 foam_texel = texture2D(sea_foam, vec2(waterTex2 * tscale) * 50.0);
|
||||
float waveSlope = N.g;
|
||||
|
||||
if (windEffect >= 12.0)
|
||||
if (waveSlope >= foamSlope){
|
||||
finalColor = mix(finalColor, max(finalColor, finalColor + foam_texel), smoothstep(foamSlope, 0.5, N.g));
|
||||
}
|
||||
|
||||
//generate final colour
|
||||
finalColor *= ambient_light+ alpha0 * 0.35;
|
||||
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||
gl_FragColor = vec4(finalColor.rgb, alpha0.a * 1.35);
|
||||
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
// -*-C++-*-
|
||||
|
||||
// Ambient term comes in gl_Color.rgb.
|
||||
#version 120
|
||||
|
||||
varying vec4 diffuse_term;
|
||||
varying vec3 normal;
|
||||
|
||||
uniform sampler2D texture;
|
||||
uniform sampler2D lightmap;
|
||||
uniform float sunangle;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
float luminance(vec3 color)
|
||||
{
|
||||
return dot(vec3(0.212671, 0.715160, 0.072169), color);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 n;
|
||||
float NdotL, NdotHV, fogFactor;
|
||||
vec4 color = gl_Color;
|
||||
vec3 lightDir = gl_LightSource[0].position.xyz;
|
||||
vec3 halfVector = gl_LightSource[0].halfVector.xyz;
|
||||
vec4 texel;
|
||||
vec4 emissive;
|
||||
vec4 fragColor;
|
||||
vec4 specular = vec4(0.0);
|
||||
|
||||
// If gl_Color.a == 0, this is a back-facing polygon and the
|
||||
// normal should be reversed.
|
||||
n = (2.0 * gl_Color.a - 1.0) * normal;
|
||||
n = normalize(n);
|
||||
|
||||
NdotL = dot(n, lightDir);
|
||||
if (NdotL > 0.0) {
|
||||
color += diffuse_term * NdotL;
|
||||
NdotHV = max(dot(n, halfVector), 0.0);
|
||||
if (gl_FrontMaterial.shininess > 0.0)
|
||||
specular.rgb = (gl_FrontMaterial.specular.rgb
|
||||
* gl_LightSource[0].specular.rgb
|
||||
* pow(NdotHV, gl_FrontMaterial.shininess));
|
||||
}
|
||||
color.a = diffuse_term.a;
|
||||
// This shouldn't be necessary, but our lighting becomes very
|
||||
// saturated. Clamping the color before modulating by the texture
|
||||
// is closer to what the OpenGL fixed function pipeline does.
|
||||
color = clamp(color, 0.0, 1.0);
|
||||
texel = texture2D(texture, gl_TexCoord[0].st);
|
||||
emissive = texture2D(lightmap, gl_TexCoord[0].st);
|
||||
|
||||
// The lights are only switched on when the sun is below the horizon
|
||||
fragColor = color * texel + specular + smoothstep(1.6, 1.8, sunangle) * emissive;
|
||||
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||
|
||||
gl_FragColor = fragColor;
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// RANDOM BUILDINGS for the UBERSHADER vertex shader
|
||||
// Licence: GPL v2
|
||||
// © Emilian Huminiuc and Vivian Meazza 2011
|
||||
#version 120
|
||||
#extension GL_EXT_draw_instanced : enable
|
||||
|
||||
varying vec4 diffuseColor;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 eyeVec;
|
||||
varying vec3 normal;
|
||||
|
||||
uniform int refl_dynamic;
|
||||
uniform int nmap_enabled;
|
||||
uniform int shader_qual;
|
||||
|
||||
attribute vec3 instancePosition; // (x,y,z)
|
||||
attribute vec3 instanceScale; // (width, depth, height)
|
||||
attribute vec3 attrib1; // Generic packed attributes
|
||||
attribute vec3 attrib2;
|
||||
|
||||
const float c_precision = 128.0;
|
||||
const float c_precisionp1 = c_precision + 1.0;
|
||||
|
||||
vec3 float2vec(float value) {
|
||||
vec3 val;
|
||||
val.x = mod(value, c_precisionp1) / c_precision;
|
||||
val.y = mod(floor(value / c_precisionp1), c_precisionp1) / c_precision;
|
||||
val.z = floor(value / (c_precisionp1 * c_precisionp1)) / c_precision;
|
||||
return val;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
// Unpack generic attributes
|
||||
vec3 attr1 = float2vec(attrib1.x);
|
||||
vec3 attr2 = float2vec(attrib1.z);
|
||||
vec3 attr3 = float2vec(attrib2.x);
|
||||
|
||||
// Determine the rotation for the building.
|
||||
float sr = sin(6.28 * attr1.x);
|
||||
float cr = cos(6.28 * attr1.x);
|
||||
|
||||
vec3 position = gl_Vertex.xyz;
|
||||
// Adjust the very top of the roof to match the rooftop scaling. This shapes
|
||||
// the rooftop - gambled, gabled etc. These vertices are identified by gl_Color.z
|
||||
position.x = (1.0 - gl_Color.z) * position.x + gl_Color.z * ((position.x + 0.5) * attr3.z - 0.5);
|
||||
position.y = (1.0 - gl_Color.z) * position.y + gl_Color.z * (position.y * attrib2.y );
|
||||
|
||||
// Adjust pitch of roof to the correct height. These vertices are identified by gl_Color.z
|
||||
// Scale down by the building height (instanceScale.z) because
|
||||
// immediately afterwards we will scale UP the vertex to the correct scale.
|
||||
position.z = position.z + gl_Color.z * attrib1.y / instanceScale.z;
|
||||
position = position * instanceScale.xyz;
|
||||
|
||||
// Rotation of the building and movement into position
|
||||
position.xy = vec2(dot(position.xy, vec2(cr, sr)), dot(position.xy, vec2(-sr, cr)));
|
||||
position = position + instancePosition.xyz;
|
||||
|
||||
gl_Position = gl_ModelViewProjectionMatrix * vec4(position,1.0);
|
||||
vec4 ecPosition = gl_ModelViewMatrix * vec4(position, 1.0);
|
||||
|
||||
eyeVec = ecPosition.xyz;
|
||||
|
||||
// Rotate the normal.
|
||||
normal = gl_Normal;
|
||||
|
||||
// Rotate the normal as per the building.
|
||||
normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr)));
|
||||
vec3 n = normalize(normal);
|
||||
|
||||
vec3 c1 = cross(n, vec3(0.0,0.0,1.0));
|
||||
vec3 c2 = cross(n, vec3(0.0,1.0,0.0));
|
||||
VNormal = normalize(gl_NormalMatrix * normal);
|
||||
|
||||
VTangent = c1;
|
||||
if(length(c2)>length(c1)){
|
||||
VTangent = c2;
|
||||
}
|
||||
|
||||
VBinormal = cross(n, VTangent);
|
||||
|
||||
VTangent = normalize(gl_NormalMatrix * -VTangent);
|
||||
VBinormal = normalize(gl_NormalMatrix * VBinormal);
|
||||
|
||||
// Force no alpha on random buildings
|
||||
diffuseColor = vec4(gl_FrontMaterial.diffuse.rgb,1.0);
|
||||
|
||||
gl_FrontColor = gl_FrontMaterial.emission + vec4(1.0)
|
||||
* (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
|
||||
gl_ClipVertex = ecPosition;
|
||||
|
||||
// Texture coordinates are stored as:
|
||||
// - a separate offset (x0, y0) for the wall (wtex0x, wtex0y), and roof (rtex0x, rtex0y)
|
||||
// - a semi-shared (x1, y1) so that the front and side of the building can have
|
||||
// different texture mappings
|
||||
//
|
||||
// The vertex color value selects between them:
|
||||
// gl_Color.x=1 indicates front/back walls
|
||||
// gl_Color.y=1 indicates roof
|
||||
// gl_Color.z=1 indicates top roof vertexs (used above)
|
||||
// gl_Color.a=1 indicates sides
|
||||
// Finally, the roof texture is on the right of the texture sheet
|
||||
float wtex0x = attr1.y; // Front/Side texture X0
|
||||
float wtex0y = attr1.z; // Front/Side texture Y0
|
||||
float rtex0x = attr2.z; // Roof texture X0
|
||||
float rtex0y = attr3.x; // Roof texture Y0
|
||||
float wtex1x = attr2.x; // Front/Roof texture X1
|
||||
float stex1x = attr3.y; // Side texture X1
|
||||
float wtex1y = attr2.y; // Front/Roof/Side texture Y1
|
||||
vec2 tex0 = vec2(sign(gl_MultiTexCoord0.x) * (gl_Color.x*wtex0x + gl_Color.y*rtex0x + gl_Color.a*wtex0x),
|
||||
gl_Color.x*wtex0y + gl_Color.y*rtex0y + gl_Color.a*wtex0y);
|
||||
|
||||
vec2 tex1 = vec2(gl_Color.x*wtex1x + gl_Color.y*wtex1x + gl_Color.a*stex1x,
|
||||
wtex1y);
|
||||
|
||||
gl_TexCoord[0].x = tex0.x + gl_MultiTexCoord0.x * tex1.x;
|
||||
gl_TexCoord[0].y = tex0.y + gl_MultiTexCoord0.y * tex1.y;
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// Author: Frederic Bouvier
|
||||
#version 120
|
||||
//varying float fogCoord;
|
||||
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
|
||||
uniform sampler2D tex_color;
|
||||
uniform sampler2D tex_normal;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec4 ns = texture2D(tex_normal, gl_TexCoord[0].st);
|
||||
vec3 N = ns.rgb * 2.0 - 1.0;
|
||||
N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
|
||||
|
||||
float nDotVP = max(0.0, dot(N, normalize(gl_LightSource[0].position.xyz)));
|
||||
float nDotHV = max(0.0, dot(N, gl_LightSource[0].halfVector.xyz));
|
||||
|
||||
float pf;
|
||||
if (nDotHV == 0.0)
|
||||
pf = 0.0;
|
||||
else
|
||||
pf = pow(nDotHV, gl_FrontMaterial.shininess);
|
||||
|
||||
vec4 Diffuse = gl_LightSource[0].diffuse * nDotVP;
|
||||
vec4 Specular = gl_LightSource[0].specular * pf;
|
||||
|
||||
vec4 color = gl_Color + Diffuse * gl_FrontMaterial.diffuse;
|
||||
color *= texture2D(tex_color, gl_TexCoord[0].xy);
|
||||
|
||||
color += Specular * gl_FrontMaterial.specular * ns.a;
|
||||
color = clamp( color, 0.0, 1.0 );
|
||||
|
||||
|
||||
// float fogFactor;
|
||||
// const float LOG2 = 1.442695;
|
||||
// fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||
// fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||
// gl_FragColor = mix(gl_Fog.color, color, fogFactor);
|
||||
|
||||
color.rgb = fog_Func(color.rgb, fogType);
|
||||
gl_FragColor = color;
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// Author: Frederic Bouvier
|
||||
#version 120
|
||||
|
||||
//varying float fogCoord;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
|
||||
attribute vec3 tangent;
|
||||
attribute vec3 binormal;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
// vec4 pos = gl_ModelViewMatrix * gl_Vertex;
|
||||
// fogCoord = pos.z / pos.w;
|
||||
|
||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
VTangent = normalize(gl_NormalMatrix * tangent);
|
||||
VBinormal = normalize(gl_NormalMatrix * binormal);
|
||||
|
||||
gl_FrontColor = gl_FrontLightModelProduct.sceneColor + gl_LightSource[0].ambient * gl_FrontMaterial.ambient;
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
gl_Position = ftransform();
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#version 120
|
||||
|
||||
uniform sampler2D baseTexture;
|
||||
|
||||
varying float fogFactor;
|
||||
varying float distanceFactor;
|
||||
varying vec2 texCoord;
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 base = texture2D( baseTexture, gl_TexCoord[0].st);
|
||||
vec4 finalColor = base * gl_Color;
|
||||
gl_FragColor.rgb = mix(gl_Fog.color.rgb, finalColor.rgb, fogFactor);
|
||||
gl_FragColor.a = mix(0.0, finalColor.a, distanceFactor);
|
||||
}
|
||||
|
|
@ -1,99 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
|
||||
varying float fogFactor;
|
||||
varying float distanceFactor;
|
||||
|
||||
uniform sampler3D Noise;
|
||||
|
||||
uniform float scale_x;
|
||||
uniform float scale_y;
|
||||
uniform float scale_z;
|
||||
|
||||
uniform float offset_x;
|
||||
uniform float offset_y;
|
||||
uniform float offset_z;
|
||||
|
||||
uniform float fade_max;
|
||||
uniform float fade_min;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 rawpos = gl_Vertex;
|
||||
|
||||
float shade = 0.9;
|
||||
float cloud_height = 30000.0;
|
||||
|
||||
// map noise vectors
|
||||
vec4 noisevec = texture3D(Noise, rawpos.xyz);
|
||||
float noise0 = (noisevec.r * 2.0) - 1.0;
|
||||
float noise1 =(noisevec.g * 2.0) - 1.0;
|
||||
vec2 noise2 = noisevec.xy;
|
||||
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
//gl_TexCoord[0] = gl_MultiTexCoord0 + vec4(textureIndexX, textureIndexY, 0.0, 0.0);
|
||||
vec4 ep = gl_ModelViewMatrixInverse * vec4(0.0,0.0,0.0,1.0);
|
||||
vec4 l = gl_ModelViewMatrixInverse * vec4(0.0,0.0,1.0,1.0);
|
||||
vec3 u = normalize(ep.xyz - l.xyz);
|
||||
|
||||
// Find a rotation matrix that rotates 1,0,0 into u. u, r and w are
|
||||
// the columns of that matrix.
|
||||
vec3 absu = abs(u);
|
||||
vec3 r = normalize(vec3(-u.y, u.x, 0.0));
|
||||
vec3 w = cross(u, r);
|
||||
|
||||
// Do the matrix multiplication by [ u r w pos]. Scale
|
||||
// the x component first
|
||||
gl_Position = vec4(gl_Vertex.x * scale_x, 0.0, 0.0, 1.0);
|
||||
gl_Position.xyz += gl_Vertex.x * u;
|
||||
gl_Position.xyz += gl_Vertex.y * r * scale_y;
|
||||
gl_Position.xyz += gl_Vertex.z * w * scale_z;
|
||||
|
||||
// Adjust the position post-rotation and scaling
|
||||
gl_Position.yz -= 3.0/2.0;
|
||||
|
||||
// Offset in y and z directions using a random noise factor
|
||||
float offset_Y = (noise0 * offset_y) + offset_y/2.0;
|
||||
float offset_Z = (noise0 * offset_z) + offset_z/2.0;
|
||||
|
||||
distanceFactor = 1.0 - clamp(abs(noise0), fade_min, fade_max);
|
||||
// distanceFactor = 0.5;
|
||||
|
||||
gl_Position.y += offset_Y;
|
||||
gl_Position.z += offset_Z;
|
||||
|
||||
gl_Position.xyz += gl_Color.xyz;
|
||||
|
||||
// Determine a lighting normal based on the vertex position from the
|
||||
// center of the cloud, so that sprite on the opposite side of the cloud to the sun are darker.
|
||||
float n = dot(normalize(-gl_LightSource[0].position.xyz),
|
||||
normalize(mat3x3(gl_ModelViewMatrix) * (- gl_Position.xyz)));;
|
||||
|
||||
// Determine the position - used for fog and shading calculations
|
||||
vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Position);
|
||||
float fogCoord = abs(ecPosition.z);
|
||||
float fract = smoothstep(0.0, cloud_height, gl_Position.z + cloud_height);
|
||||
|
||||
// Final position of the sprite
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Position;
|
||||
|
||||
// Calculate the total offset distance in the yx plane, normalised
|
||||
/*float distance = normalize(sqrt(pow(gl_Position.y, 2) + pow(gl_Position.z, 2)));
|
||||
distanceFactor = 1.0 - clamp(distance, 0.5, 1.0);*/
|
||||
// Determine the shading of the sprite based on its vertical position and position relative to the sun.
|
||||
n = min(smoothstep(-0.5, 0.0, n), fract);
|
||||
|
||||
// Determine the shading based on a mixture from the backlight to the front
|
||||
vec4 backlight = gl_LightSource[0].diffuse * shade;
|
||||
|
||||
gl_FrontColor = mix(backlight, gl_LightSource[0].diffuse, n);
|
||||
gl_FrontColor += gl_FrontLightModelProduct.sceneColor;
|
||||
|
||||
// As we get within 100m of the sprite, it is faded out. Equally at large distances it also fades out.
|
||||
gl_FrontColor.a = min(smoothstep(10.0, 100.0, fogCoord), 1.0 - smoothstep(60000.0, 80000.0, fogCoord));
|
||||
gl_BackColor = gl_FrontColor;
|
||||
|
||||
// Fog doesn't affect clouds as much as other objects.
|
||||
fogFactor = exp( -gl_Fog.density * fogCoord);
|
||||
fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
#version 120
|
||||
|
||||
varying vec4 rawpos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 Normal;
|
||||
|
||||
uniform sampler3D NoiseTex;
|
||||
uniform sampler2D SampleTex;
|
||||
uniform sampler1D ColorsTex;
|
||||
|
||||
varying vec4 constantColor;
|
||||
|
||||
uniform float snowlevel; // From /sim/rendering/snow-level-m
|
||||
|
||||
const float scale = 1.0;
|
||||
|
||||
#define BLA 1
|
||||
#define BLA2 0
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
float getShadowing();
|
||||
vec3 getClusteredLightsContribution(vec3 p, vec3 n, vec3 texel);
|
||||
|
||||
void main (void)
|
||||
{
|
||||
|
||||
vec4 basecolor = texture2D(SampleTex, rawpos.xy*0.000144);
|
||||
basecolor = texture1D(ColorsTex, basecolor.r+0.00);
|
||||
|
||||
vec4 noisevec = texture3D(NoiseTex, (rawpos.xyz)*0.01*scale);
|
||||
|
||||
vec4 nvL = texture3D(NoiseTex, (rawpos.xyz)*0.00066*scale);
|
||||
vec4 km = floor((rawpos)/1000.0);
|
||||
|
||||
float fogFactor;
|
||||
float fogCoord = ecPosition.z;
|
||||
const float LOG2 = 1.442695;
|
||||
fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||
// float biasFactor = exp2(-0.00000002 * fogCoord * fogCoord * LOG2);
|
||||
float biasFactor = fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||
|
||||
float n=0.06;
|
||||
n += nvL[0]*0.4;
|
||||
n += nvL[1]*0.6;
|
||||
n += nvL[2]*2.0;
|
||||
n += nvL[3]*4.0;
|
||||
n += noisevec[0]*0.1;
|
||||
n += noisevec[1]*0.4;
|
||||
|
||||
n += noisevec[2]*0.8;
|
||||
n += noisevec[3]*2.1;
|
||||
n = mix(0.6, n, biasFactor);
|
||||
|
||||
// good
|
||||
vec4 c1;
|
||||
c1 = basecolor * vec4(smoothstep(0.0, 1.15, n), smoothstep(0.0, 1.2, n), smoothstep(0.1, 1.3, n), 1.0);
|
||||
|
||||
//"steep = gray"
|
||||
c1 = mix(vec4(n-0.42, n-0.44, n-0.51, 1.0), c1, smoothstep(0.970, 0.990, abs(normalize(Normal).z)+nvL[2]*1.3));
|
||||
|
||||
//"snow"
|
||||
c1 = mix(c1, clamp(n+nvL[2]*4.1+vec4(0.1, 0.1, nvL[2]*2.2, 1.0), 0.7, 1.0), smoothstep(snowlevel+300.0, snowlevel+360.0, (rawpos.z)+nvL[1]*3000.0));
|
||||
|
||||
vec3 diffuse = gl_Color.rgb * max(0.0, dot(VNormal, gl_LightSource[0].position.xyz)) * getShadowing();
|
||||
vec4 ambient_light = constantColor + gl_LightSource[0].diffuse * vec4(diffuse, 1.0);
|
||||
|
||||
c1 *= ambient_light;
|
||||
vec4 finalColor = c1;
|
||||
finalColor.rgb += getClusteredLightsContribution(ecPosition.xyz, VNormal, basecolor.rgb);
|
||||
|
||||
// if(gl_Fog.density == 1.0)
|
||||
// fogFactor=1.0;
|
||||
//
|
||||
// gl_FragColor = mix(gl_Fog.color ,finalColor, fogFactor);
|
||||
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||
gl_FragColor = finalColor;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
#version 120
|
||||
|
||||
varying vec4 rawpos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 Normal;
|
||||
varying vec4 constantColor;
|
||||
|
||||
void setupShadows(vec4 eyeSpacePos);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
|
||||
rawpos = gl_Vertex;
|
||||
ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
Normal = normalize(gl_Normal);
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
|
||||
constantColor = gl_FrontMaterial.emission
|
||||
+ gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
|
||||
gl_Position = ftransform();
|
||||
|
||||
setupShadows(ecPosition);
|
||||
}
|
|
@ -1,146 +0,0 @@
|
|||
// -*-C++-*-
|
||||
// © Vivian Meazza - 2011
|
||||
|
||||
// Shader that uses OpenGL state values to do per-pixel lighting
|
||||
//
|
||||
// The only light used is gl_LightSource[0], which is assumed to be
|
||||
// directional.
|
||||
//
|
||||
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
||||
// equivalent to osg::Material::DIFFUSE.
|
||||
|
||||
#version 120
|
||||
#define fps2kts 0.5925
|
||||
|
||||
#define MODE_OFF 0
|
||||
#define MODE_DIFFUSE 1
|
||||
#define MODE_AMBIENT_AND_DIFFUSE 2
|
||||
|
||||
// The ambient term of the lighting equation that doesn't depend on
|
||||
// the surface normal is passed in gl_{Front,Back}Color. The alpha
|
||||
// component is set to 1 for front, 0 for back in order to work around
|
||||
// bugs with gl_FrontFacing in the fragment shader.
|
||||
varying vec4 diffuse_term;
|
||||
varying vec3 normal;
|
||||
//varying float fogCoord;
|
||||
varying vec4 ecPosition;
|
||||
|
||||
uniform int colorMode;
|
||||
uniform float osg_SimulationTime;
|
||||
uniform float Offset, AmpFactor, WindE, WindN, spd, hdg;
|
||||
uniform sampler3D Noise;
|
||||
|
||||
////fog "include"////////
|
||||
//uniform int fogType;
|
||||
//
|
||||
//void fog_Func(int type);
|
||||
/////////////////////////
|
||||
|
||||
void setupShadows(vec4 eyeSpacePos);
|
||||
|
||||
/////// functions /////////
|
||||
|
||||
float normalize_range(float _val)
|
||||
{
|
||||
if (_val > 180.0)
|
||||
return _val - 360.0;
|
||||
else
|
||||
return _val;
|
||||
}
|
||||
|
||||
void relWind(out float rel_wind_speed_kts, out float rel_wind_from_rad)
|
||||
{
|
||||
//calculate speed north and east in kts
|
||||
float speed_north_kts = cos(radians(hdg)) * spd ;
|
||||
float speed_east_kts = sin(radians(hdg)) * spd ;
|
||||
|
||||
//calculate the relative wind speed north and east in kts
|
||||
float rel_wind_speed_from_east_kts = WindE*fps2kts + speed_east_kts;
|
||||
float rel_wind_speed_from_north_kts = WindN*fps2kts + speed_north_kts;
|
||||
|
||||
//combine relative speeds north and east to get relative windspeed in kts
|
||||
rel_wind_speed_kts = sqrt(pow(abs(rel_wind_speed_from_east_kts), 2.0)
|
||||
+ pow(abs(rel_wind_speed_from_north_kts), 2.0));
|
||||
|
||||
//calculate the relative wind direction
|
||||
float rel_wind_from_deg = degrees(atan(rel_wind_speed_from_east_kts, rel_wind_speed_from_north_kts));
|
||||
//rel_wind_from_rad = atan(rel_wind_speed_from_east_kts, rel_wind_speed_from_north_kts);
|
||||
float rel_wind = rel_wind_from_deg - hdg;
|
||||
rel_wind = normalize_range(rel_wind);
|
||||
rel_wind_from_rad = radians(rel_wind);
|
||||
}
|
||||
|
||||
void rotationmatrix(in float angle, out mat4 rotmat)
|
||||
{
|
||||
rotmat = mat4( cos( angle ), -sin( angle ), 0.0, 0.0,
|
||||
sin( angle ), cos( angle ), 0.0, 0.0,
|
||||
0.0 , 0.0 , 1.0, 0.0,
|
||||
0.0 , 0.0 , 0.0, 1.0 );
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
mat4 RotationMatrix;
|
||||
|
||||
float relWindspd=0.0;
|
||||
float relWinddir=0.0;
|
||||
|
||||
// compute relative wind speed and direction
|
||||
relWind (relWindspd, relWinddir);
|
||||
|
||||
// map noise vector
|
||||
vec4 noisevec = texture3D(Noise, gl_Vertex.xyz);
|
||||
|
||||
//waving effect
|
||||
float tsec = osg_SimulationTime;
|
||||
vec4 pos = gl_Vertex;
|
||||
vec4 oldpos = gl_Vertex;
|
||||
|
||||
float freq = (10.0 * relWindspd) + 10.0;
|
||||
pos.y = sin((pos.x * 5.0 + tsec * freq )/5.0) * 0.5 ;
|
||||
pos.y += sin((pos.z * 5.0 + tsec * freq/2.0)/5.0) * 0.125 ;
|
||||
|
||||
pos.y *= pow(pos.x - Offset, 2.0) * AmpFactor;
|
||||
|
||||
//rotate the flag to align with relative wind
|
||||
rotationmatrix(-relWinddir, RotationMatrix);
|
||||
pos *= RotationMatrix;
|
||||
gl_Position = gl_ModelViewProjectionMatrix * pos;
|
||||
|
||||
//do the colour and fog
|
||||
ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
normal = gl_NormalMatrix * gl_Normal;
|
||||
vec4 ambient_color, diffuse_color;
|
||||
|
||||
if (colorMode == MODE_DIFFUSE) {
|
||||
diffuse_color = gl_Color;
|
||||
ambient_color = gl_FrontMaterial.ambient;
|
||||
} else if (colorMode == MODE_AMBIENT_AND_DIFFUSE) {
|
||||
diffuse_color = gl_Color;
|
||||
ambient_color = gl_Color;
|
||||
} else {
|
||||
diffuse_color = gl_FrontMaterial.diffuse;
|
||||
ambient_color = gl_FrontMaterial.ambient;
|
||||
}
|
||||
|
||||
diffuse_term = diffuse_color * gl_LightSource[0].diffuse;
|
||||
vec4 ambient_term = ambient_color * gl_LightSource[0].ambient;
|
||||
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
if (gl_FrontMaterial.diffuse.a < 1.0)
|
||||
diffuse_term.a = gl_FrontMaterial.diffuse.a;
|
||||
else
|
||||
diffuse_term.a = gl_Color.a;
|
||||
|
||||
// Another hack for supporting two-sided lighting without using
|
||||
// gl_FrontFacing in the fragment shader.
|
||||
gl_FrontColor.rgb = ambient_term.rgb; gl_FrontColor.a = 0.0;
|
||||
gl_BackColor.rgb = ambient_term.rgb; gl_FrontColor.a = 1.0;
|
||||
// fogCoord = abs(ecPosition.z / ecPosition.w);
|
||||
|
||||
//fog_Func(fogType);
|
||||
setupShadows(ecPosition);
|
||||
}
|
|
@ -1,197 +0,0 @@
|
|||
#version 120
|
||||
|
||||
varying vec4 rawpos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 Normal;
|
||||
|
||||
uniform sampler3D NoiseTex;
|
||||
uniform sampler2D SampleTex;
|
||||
uniform sampler1D ColorsTex;
|
||||
uniform sampler2D SampleTex2;
|
||||
uniform sampler2D NormalTex;
|
||||
uniform float depth_factor;
|
||||
|
||||
uniform float red, green, blue, alpha;
|
||||
|
||||
uniform float quality_level; // From /sim/rendering/quality-level
|
||||
uniform float snowlevel; // From /sim/rendering/snow-level-m
|
||||
|
||||
const float scale = 1.0;
|
||||
int linear_search_steps = 10;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
float getShadowing();
|
||||
vec3 getClusteredLightsContribution(vec3 p, vec3 n, vec3 texel);
|
||||
|
||||
float ray_intersect(sampler2D reliefMap, vec2 dp, vec2 ds)
|
||||
{
|
||||
|
||||
float size = 1.0 / float(linear_search_steps);
|
||||
float depth = 0.0;
|
||||
float best_depth = 1.0;
|
||||
|
||||
for(int i = 0; i < linear_search_steps - 1; ++i)
|
||||
{
|
||||
depth += size;
|
||||
float t = texture2D(reliefMap, dp + ds * depth).a;
|
||||
if(best_depth > 0.996)
|
||||
if(depth >= t)
|
||||
best_depth = depth;
|
||||
}
|
||||
depth = best_depth;
|
||||
|
||||
const int binary_search_steps = 5;
|
||||
|
||||
for(int i = 0; i < binary_search_steps; ++i)
|
||||
{
|
||||
size *= 0.5;
|
||||
float t = texture2D(reliefMap, dp + ds * depth).a;
|
||||
if(depth >= t)
|
||||
{
|
||||
best_depth = depth;
|
||||
depth -= 2.0 * size;
|
||||
}
|
||||
depth += size;
|
||||
}
|
||||
|
||||
return(best_depth);
|
||||
}
|
||||
|
||||
|
||||
void main (void)
|
||||
{
|
||||
float bump = 1.0;
|
||||
|
||||
if ( quality_level >= 3.5 ) {
|
||||
linear_search_steps = 20;
|
||||
}
|
||||
vec2 uv, dp, ds;
|
||||
vec3 N;
|
||||
float d;
|
||||
if ( bump > 0.9 && quality_level >= 2.0 )
|
||||
{
|
||||
vec3 V = normalize(ecPosition.xyz);
|
||||
float a = dot(VNormal, -V);
|
||||
vec2 s = vec2(dot(V, VTangent), dot(V, VBinormal));
|
||||
s *= depth_factor / a;
|
||||
ds = s;
|
||||
dp = gl_TexCoord[0].st;
|
||||
d = ray_intersect(NormalTex, dp, ds);
|
||||
|
||||
uv = dp + ds * d;
|
||||
N = texture2D(NormalTex, uv).xyz * 2.0 - 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
uv = gl_TexCoord[0].st;
|
||||
N = vec3(0.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
|
||||
vec4 basecolor = texture2D(SampleTex, rawpos.xy*0.000344);
|
||||
vec4 basecolor2 = texture2D(SampleTex2, rawpos.xy*0.000144);
|
||||
|
||||
basecolor = texture1D(ColorsTex, basecolor.r+0.0);
|
||||
|
||||
vec4 noisevec = texture3D(NoiseTex, (rawpos.xyz)*0.01*scale);
|
||||
|
||||
vec4 nvL = texture3D(NoiseTex, (rawpos.xyz)*0.00066*scale);
|
||||
|
||||
float vegetationlevel = (rawpos.z)+nvL[2]*3000.0;
|
||||
|
||||
const float LOG2 = 1.442695;
|
||||
float fogCoord = abs(ecPosition.z / ecPosition.w);
|
||||
float fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||
float biasFactor = exp2(-0.00000002 * fogCoord * fogCoord * LOG2);
|
||||
|
||||
float n = 0.06;
|
||||
n += nvL[0]*0.4;
|
||||
n += nvL[1]*0.6;
|
||||
n += nvL[2]*2.0;
|
||||
n += nvL[3]*4.0;
|
||||
n += noisevec[0]*0.1;
|
||||
n += noisevec[1]*0.4;
|
||||
|
||||
n += noisevec[2]*0.8;
|
||||
n += noisevec[3]*2.1;
|
||||
|
||||
//very low n/biasFactor mix, to keep forest color
|
||||
n = mix(0.05, n, biasFactor);
|
||||
|
||||
vec4 c1;
|
||||
c1 = basecolor * vec4(smoothstep(-1.3, 0.5, n), smoothstep(-1.3, 0.5, n), smoothstep(-2.0, 0.9, n), 0.0);
|
||||
|
||||
vec4 c2;
|
||||
c2 = basecolor2 * vec4(smoothstep(-1.3, 0.5, n), smoothstep(-1.3, 0.5, n), smoothstep(-2.0, 0.9, n), 0.0);
|
||||
|
||||
N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
|
||||
vec3 l = gl_LightSource[0].position.xyz;
|
||||
vec3 diffuse;
|
||||
|
||||
//draw floor where !steep, and another blurb for smoothing transitions
|
||||
vec4 c3, c4, c5, c3a, c4a, c5a;
|
||||
float subred = 1.0 - red; float subgreen = 1.0 - green; float subblue = 1.0 - blue;
|
||||
c3 = mix(vec4(n-subred, n-subgreen, -n-subblue, 0.0), c1, smoothstep(0.990, 0.970, abs(normalize(Normal).z)+nvL[2]*1.3));
|
||||
c4 = mix(vec4(n-subred, n-subgreen-0.6, -n-subblue, 0.0), c1, smoothstep(0.990, 0.890, abs(normalize(Normal).z)+nvL[2]*0.9));
|
||||
c4a = mix(vec4(n-subred+0.12, n-subgreen-0.52, -n-subblue, 0.3), c1, smoothstep(0.990, 0.970, abs(normalize(Normal).z)+nvL[2]*1.32));
|
||||
c5 = mix(c3, c4, 1.0);
|
||||
c5a = mix(c3, c4a, 1.0);
|
||||
|
||||
|
||||
if (vegetationlevel <= 2200.0) {
|
||||
c1 = mix(c2, c5, clamp(0.65, n*0.1, 0.5));
|
||||
diffuse = gl_Color.rgb * max(0.7, dot(N, l)) * max(0.9, dot(VNormal, gl_LightSource[0].position.xyz));
|
||||
}
|
||||
|
||||
if (vegetationlevel > 2200.0 && vegetationlevel < 2300.0) {
|
||||
c1 = mix(c2, c5, clamp(0.65, n*0.5, 0.35));
|
||||
diffuse = gl_Color.rgb * max(0.7, dot(N, l)) * max(0.9, dot(VNormal, gl_LightSource[0].position.xyz));
|
||||
}
|
||||
|
||||
if (vegetationlevel >= 2300.0 && vegetationlevel < 2480.0) {
|
||||
c1 = mix(c2, c5a, clamp(0.65, n*0.5, 0.30));
|
||||
diffuse = gl_Color.rgb * max(0.85, dot(N, l)) * max(0.9, dot(VNormal, gl_LightSource[0].position.xyz));
|
||||
}
|
||||
|
||||
if (vegetationlevel >= 2480.0 && vegetationlevel < 2530.0) {
|
||||
c1 = mix(c2, c5a, clamp(0.65, n*0.5, 0.20));
|
||||
diffuse = gl_Color.rgb * max(0.85, dot(N, l)) * max(0.9, dot(VNormal, gl_LightSource[0].position.xyz));
|
||||
}
|
||||
|
||||
if (vegetationlevel >= 2530.0 && vegetationlevel < 2670.0) {
|
||||
c1 = mix(c2, c5, clamp(0.65, n*0.5, 0.10));
|
||||
diffuse = gl_Color.rgb * max(0.85, dot(N, l)) * max(0.9, dot(VNormal, gl_LightSource[0].position.xyz));
|
||||
}
|
||||
|
||||
if (vegetationlevel >= 2670.0) {
|
||||
c1 = mix(c2, c5, clamp(0.0, n*0.1, 0.4));
|
||||
diffuse = gl_Color.rgb * max(0.85, dot(N, l)) * max(0.9, dot(VNormal, gl_LightSource[0].position.xyz));
|
||||
}
|
||||
|
||||
|
||||
//adding snow and permanent snow/glacier
|
||||
if (vegetationlevel > snowlevel) {
|
||||
c3 = mix(vec4(n+1.0, n+1.0, n+1.0, 0.0), c1, smoothstep(0.990, 0.965, abs(normalize(Normal).z)+nvL[2]*1.3));
|
||||
c4 = mix(vec4(n+1.0, n+1.0, n+1.0, 0.0), c1, smoothstep(0.990, 0.965, abs(normalize(Normal).z)+nvL[2]*0.9));
|
||||
c5 = mix(c3, c4, 1.0);
|
||||
c1 = mix(c1, c5, clamp(0.65, n*0.5, 0.6));
|
||||
diffuse = gl_Color.rgb * max(0.8, dot(N, l)) * max(0.9, dot(VNormal, gl_LightSource[0].position.xyz));
|
||||
}
|
||||
|
||||
vec4 ambient_light = gl_LightSource[0].diffuse * vec4(diffuse, 0.0) * getShadowing();
|
||||
|
||||
c1 *= ambient_light;
|
||||
vec4 finalColor = c1;
|
||||
finalColor.rgb += getClusteredLightsContribution(ecPosition.xyz, VNormal, basecolor.rgb);
|
||||
|
||||
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||
gl_FragColor = finalColor;
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
#version 120
|
||||
varying vec4 rawpos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 Normal;
|
||||
varying vec4 constantColor;
|
||||
|
||||
attribute vec3 tangent;
|
||||
attribute vec3 binormal;
|
||||
|
||||
// ////fog "include"////////
|
||||
// uniform int fogType;
|
||||
//
|
||||
// void fog_Func(int type);
|
||||
// /////////////////////////
|
||||
|
||||
void setupShadows(vec4 eyeSpacePos);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
rawpos = gl_Vertex;
|
||||
ecPosition = gl_ModelViewMatrix * rawpos;
|
||||
Normal = normalize(gl_Normal);
|
||||
VNormal = gl_NormalMatrix * gl_Normal;
|
||||
VTangent = gl_NormalMatrix * tangent;
|
||||
VBinormal = gl_NormalMatrix * binormal;
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
constantColor = gl_FrontMaterial.emission
|
||||
+ gl_FrontColor * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
// fog_Func(fogType);
|
||||
setupShadows(ecPosition);
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
#version 120
|
||||
|
||||
// "landmass" effect with forest construction using a geometry
|
||||
// shader. The landmass effect includes a bumpmap effect as well as
|
||||
// variation by altitude.
|
||||
//
|
||||
// The fragment shader needs position and normals in model and eye
|
||||
// coordinates. This vertex shader calculates the positions and
|
||||
// normals of the forest polygons so the geometry shader can do as
|
||||
// little as possible.
|
||||
|
||||
// Input for the geometry shader. "raw" means terrain model
|
||||
// coordinates; that's a tile-local coordinate system, with z as local
|
||||
// up. "ec" means eye coordinates.
|
||||
|
||||
// model position of original terrain poly; the bottom of the forest.
|
||||
varying vec4 rawposIn;
|
||||
// model normal
|
||||
varying vec3 NormalIn;
|
||||
varying vec4 ecPosIn;
|
||||
varying vec3 ecNormalIn;
|
||||
// eye spacce tangent and binormal
|
||||
varying vec3 VTangentIn;
|
||||
varying vec3 VBinormalIn;
|
||||
// screen-space position of top
|
||||
// constant color component
|
||||
varying vec4 constantColorIn;
|
||||
|
||||
attribute vec3 tangent;
|
||||
attribute vec3 binormal;
|
||||
|
||||
uniform float canopy_height;
|
||||
|
||||
////fog "include"////////
|
||||
// uniform int fogType;
|
||||
//
|
||||
// void fog_Func(int type);
|
||||
/////////////////////////
|
||||
|
||||
void main(void)
|
||||
{
|
||||
rawposIn = gl_Vertex;
|
||||
ecPosIn = gl_ModelViewMatrix * gl_Vertex;
|
||||
NormalIn = normalize(gl_Normal);
|
||||
//rawTopIn = rawposIn + vec4(0.0, 0.0, canopy_height, 0.0);
|
||||
//ecTopIn = gl_ModelViewMatrix * rawTopIn;
|
||||
ecNormalIn = gl_NormalMatrix * NormalIn;
|
||||
VTangentIn = gl_NormalMatrix * tangent;
|
||||
VBinormalIn = gl_NormalMatrix * binormal;
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
gl_Position = ftransform();
|
||||
//positionTopIn = gl_ModelViewProjectionMatrix * rawTopIn;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
constantColorIn = gl_FrontMaterial.emission
|
||||
+ gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
|
||||
// fog_Func(fogType);
|
||||
}
|
|
@ -1,152 +0,0 @@
|
|||
#version 120
|
||||
|
||||
varying vec4 rawpos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 Normal;
|
||||
varying vec4 constantColor;
|
||||
|
||||
uniform sampler3D NoiseTex;
|
||||
uniform sampler2D BaseTex;
|
||||
uniform sampler2D NormalTex;
|
||||
uniform float depth_factor;
|
||||
uniform float quality_level; // From /sim/rendering/quality-level
|
||||
uniform float snowlevel; // From /sim/rendering/snow-level-m
|
||||
|
||||
const float scale = 1.0;
|
||||
int linear_search_steps = 10;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
float ray_intersect(sampler2D reliefMap, vec2 dp, vec2 ds)
|
||||
{
|
||||
|
||||
float size = 1.0 / float(linear_search_steps);
|
||||
float depth = 0.0;
|
||||
float best_depth = 1.0;
|
||||
|
||||
for(int i = 0; i < linear_search_steps - 1; ++i)
|
||||
{
|
||||
depth += size;
|
||||
float t = texture2D(reliefMap, dp + ds * depth).a;
|
||||
if(best_depth > 0.996)
|
||||
if(depth >= t)
|
||||
best_depth = depth;
|
||||
}
|
||||
depth = best_depth;
|
||||
|
||||
const int binary_search_steps = 5;
|
||||
|
||||
for(int i = 0; i < binary_search_steps; ++i)
|
||||
{
|
||||
size *= 0.5;
|
||||
float t = texture2D(reliefMap, dp + ds * depth).a;
|
||||
if(depth >= t)
|
||||
{
|
||||
best_depth = depth;
|
||||
depth -= 2.0 * size;
|
||||
}
|
||||
depth += size;
|
||||
}
|
||||
|
||||
return(best_depth);
|
||||
}
|
||||
|
||||
void main (void)
|
||||
{
|
||||
float bump = 1.0;
|
||||
|
||||
if ( quality_level >= 3.0 ) {
|
||||
linear_search_steps = 20;
|
||||
}
|
||||
|
||||
vec2 uv, dp = vec2(0, 0), ds = vec2(0, 0);
|
||||
vec3 N;
|
||||
float d = 0;
|
||||
if ( bump > 0.9 && quality_level > 2.0 && quality_level <= 4.0)
|
||||
{
|
||||
vec3 V = normalize(ecPosition.xyz);
|
||||
float a = dot(VNormal, -V);
|
||||
vec2 s = vec2(dot(V, VTangent), dot(V, VBinormal));
|
||||
|
||||
// prevent a divide by zero
|
||||
if (a > -1e-3 && a < 1e-3) a = 1e-3;
|
||||
s *= depth_factor / a;
|
||||
ds = s;
|
||||
dp = gl_TexCoord[0].st;
|
||||
d = ray_intersect(NormalTex, dp, ds);
|
||||
|
||||
uv = dp + ds * d;
|
||||
N = texture2D(NormalTex, uv).xyz * 2.0 - 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
uv = gl_TexCoord[0].st;
|
||||
N = vec3(0.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
vec4 noisevec = texture3D(NoiseTex, (rawpos.xyz)*0.01*scale);
|
||||
vec4 nvL = texture3D(NoiseTex, (rawpos.xyz)*0.00066*scale);
|
||||
|
||||
float fogFactor;
|
||||
float fogCoord = ecPosition.z;
|
||||
const float LOG2 = 1.442695;
|
||||
fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||
float biasFactor = fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||
|
||||
float n=0.06;
|
||||
n += nvL[0]*0.4;
|
||||
n += nvL[1]*0.6;
|
||||
n += nvL[2]*2.0;
|
||||
n += nvL[3]*4.0;
|
||||
n += noisevec[0]*0.1;
|
||||
n += noisevec[1]*0.4;
|
||||
|
||||
n += noisevec[2]*0.8;
|
||||
n += noisevec[3]*2.1;
|
||||
n = mix(0.6, n, biasFactor);
|
||||
// good
|
||||
vec4 c1 = texture2D(BaseTex, uv);
|
||||
//brown
|
||||
//c1 = mix(c1, vec4(n-0.46, n-0.45, n-0.53, 1.0), smoothstep(0.50, 0.55, nvL[2]*6.6));
|
||||
//"steep = gray"
|
||||
c1 = mix(vec4(n-0.30, n-0.29, n-0.37, 1.0), c1, smoothstep(0.970, 0.990, abs(normalize(Normal).z)+nvL[2]*1.3));
|
||||
//"snow"
|
||||
c1 = mix(c1, clamp(n+nvL[2]*4.1+vec4(0.1, 0.1, nvL[2]*2.2, 1.0), 0.7, 1.0), smoothstep(snowlevel+300.0, snowlevel+360.0, (rawpos.z)+nvL[1]*3000.0));
|
||||
|
||||
N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
|
||||
vec3 l = gl_LightSource[0].position.xyz;
|
||||
vec3 diffuse = gl_Color.rgb * max(0.0, dot(N, l));
|
||||
float shadow_factor = 1.0;
|
||||
|
||||
// Shadow
|
||||
if ( quality_level >= 3.0 ) {
|
||||
dp += ds * d;
|
||||
vec3 sl = normalize( vec3( dot( l, VTangent ), dot( l, VBinormal ), dot( -l, VNormal ) ) );
|
||||
ds = sl.xy * depth_factor / sl.z;
|
||||
dp -= ds * d;
|
||||
float dl = ray_intersect(NormalTex, dp, ds);
|
||||
if ( dl < d - 0.05 )
|
||||
shadow_factor = dot( constantColor.xyz, vec3( 1.0, 1.0, 1.0 ) ) * 0.25;
|
||||
}
|
||||
// end shadow
|
||||
|
||||
vec4 ambient_light = constantColor + gl_LightSource[0].diffuse * shadow_factor * vec4(diffuse, 1.0);
|
||||
|
||||
c1 *= ambient_light;
|
||||
vec4 finalColor = c1;
|
||||
|
||||
//if(gl_Fog.density == 1.0)
|
||||
// fogFactor=1.0;
|
||||
|
||||
// gl_FragColor = mix(gl_Fog.color ,finalColor, fogFactor);
|
||||
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||
gl_FragColor = finalColor;
|
||||
|
||||
}
|
|
@ -1,124 +0,0 @@
|
|||
#version 120
|
||||
#extension GL_EXT_geometry_shader4 : enable
|
||||
|
||||
// Geometry shader that creates a prism from a terrain triangle,
|
||||
// resulting in a forest effect.
|
||||
//
|
||||
// A geometry shader should do as little computation as possible.
|
||||
|
||||
// See landmass-g.vert for a description of the inputs.
|
||||
varying in vec4 rawposIn[3];
|
||||
varying in vec3 NormalIn[3];
|
||||
varying in vec4 ecPosIn[3];
|
||||
varying in vec3 ecNormalIn[3];
|
||||
varying in vec3 VTangentIn[3];
|
||||
varying in vec3 VBinormalIn[3];
|
||||
varying in vec4 constantColorIn[3];
|
||||
|
||||
uniform float canopy_height;
|
||||
|
||||
// model position
|
||||
varying out vec4 rawpos;
|
||||
// eye position
|
||||
varying out vec4 ecPosition;
|
||||
// eye space surface matrix
|
||||
varying out vec3 VNormal;
|
||||
varying out vec3 VTangent;
|
||||
varying out vec3 VBinormal;
|
||||
// model normal
|
||||
varying out vec3 Normal;
|
||||
varying out vec4 constantColor;
|
||||
varying out float bump;
|
||||
|
||||
// Emit one vertex of the forest geometry.
|
||||
// parameters:
|
||||
// i - index into original terrain triangle
|
||||
void doVertex(in int i, in vec4 pos, in vec4 ecpos, in vec4 screenpos,
|
||||
in vec3 rawNormal, in vec3 normal, in float s)
|
||||
{
|
||||
rawpos = pos;
|
||||
ecPosition = ecpos;
|
||||
Normal = rawNormal;
|
||||
VNormal = normal;
|
||||
VTangent = VTangentIn[i];
|
||||
VBinormal = VBinormalIn[i];
|
||||
bump = s;
|
||||
|
||||
gl_FrontColor = gl_FrontColorIn[i];
|
||||
constantColor = constantColorIn[i];
|
||||
gl_Position = screenpos;
|
||||
gl_TexCoord[0] = gl_TexCoordIn[i][0];
|
||||
EmitVertex();
|
||||
}
|
||||
|
||||
vec3 rawSideNormal[3];
|
||||
vec3 sideNormal[3];
|
||||
|
||||
// Emit a vertex for a forest side triangle
|
||||
void doSideVertex(in int vertIdx, in int sideIdx, vec4 pos, in vec4 ecpos,
|
||||
in vec4 screenpos)
|
||||
{
|
||||
doVertex(vertIdx, pos, ecpos, screenpos, rawSideNormal[sideIdx],
|
||||
sideNormal[sideIdx], 0.0);
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 rawTopDisp = vec4(0.0, 0.0, canopy_height, 0.0);
|
||||
vec4 ecTopDisp = gl_ModelViewMatrix * rawTopDisp;
|
||||
vec4 mvpTopDisp = gl_ModelViewProjectionMatrix * rawTopDisp;
|
||||
// model forest top
|
||||
vec4 rawTopIn[3];
|
||||
vec4 ecTopIn[3];
|
||||
vec4 positionTopIn[3];
|
||||
rawSideNormal[0] = normalize(cross((rawposIn[1] - rawposIn[0]).xyz,
|
||||
NormalIn[0]));
|
||||
rawSideNormal[1] = normalize(cross((rawposIn[2] - rawposIn[1]).xyz,
|
||||
NormalIn[1]));
|
||||
rawSideNormal[2] = normalize(cross((rawposIn[0] - rawposIn[2]).xyz,
|
||||
NormalIn[2]));
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
sideNormal[i] = gl_NormalMatrix * rawSideNormal[i];
|
||||
rawTopIn[i] = rawposIn[i] + rawTopDisp;
|
||||
ecTopIn[i] = ecPosIn[i] + ecTopDisp;
|
||||
positionTopIn[i] = gl_PositionIn[i] + mvpTopDisp;
|
||||
}
|
||||
if (canopy_height > 0.01) {
|
||||
// Sides
|
||||
doSideVertex(0, 0, rawTopIn[0], ecTopIn[0], positionTopIn[0]);
|
||||
doSideVertex(0, 0, rawposIn[0], ecPosIn[0], gl_PositionIn[0]);
|
||||
doSideVertex(1, 0, rawTopIn[1], ecTopIn[1], positionTopIn[1]);
|
||||
doSideVertex(1, 0, rawposIn[1], ecPosIn[1], gl_PositionIn[1]);
|
||||
|
||||
doSideVertex(2, 1, rawTopIn[2], ecTopIn[2], positionTopIn[2]);
|
||||
doSideVertex(2, 1, rawposIn[2], ecPosIn[2], gl_PositionIn[2]);
|
||||
|
||||
doSideVertex(0, 2, rawTopIn[0], ecTopIn[0], positionTopIn[0]);
|
||||
doSideVertex(0, 2, rawposIn[0], ecPosIn[0], gl_PositionIn[0]);
|
||||
// Degenerate triangles; avoids EndPrimitive()
|
||||
doSideVertex(0, 2, rawposIn[0], ecPosIn[0], gl_PositionIn[0]);
|
||||
doVertex(0, rawTopIn[0], ecTopIn[0], positionTopIn[0], NormalIn[0],
|
||||
ecNormalIn[0], 1.0);
|
||||
// Top
|
||||
}
|
||||
doVertex(0, rawTopIn[0], ecTopIn[0], positionTopIn[0], NormalIn[0],
|
||||
ecNormalIn[0], 1.0);
|
||||
doVertex(1, rawTopIn[1], ecTopIn[1], positionTopIn[1], NormalIn[1],
|
||||
ecNormalIn[1], 1.0);
|
||||
doVertex(2, rawTopIn[2], ecTopIn[2], positionTopIn[2], NormalIn[2],
|
||||
ecNormalIn[2], 1.0);
|
||||
// Don't render "bottom" triangle for now; it's hidden.
|
||||
#if 0
|
||||
// degenerate
|
||||
doVertex(2, rawTopIn[2], ecTopIn[2], positionTopIn[2], NormalIn[2],
|
||||
ecNormalIn[2], 1.0);
|
||||
// bottom
|
||||
doVertex(0, rawposIn[0], ecPosIn[0], gl_PositionIn[0], NormalIn[0],
|
||||
ecNormalIn[0], 1.0);
|
||||
doVertex(1, rawposIn[1], ecPosIn[1], gl_PositionIn[1], NormalIn[1],
|
||||
ecNormalIn[1], 1.0);
|
||||
doVertex(2, rawposIn[2], ecPosIn[2], gl_PositionIn[2], NormalIn[2],
|
||||
ecNormalIn[2], 1.0);
|
||||
#endif
|
||||
EndPrimitive();
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
#version 120
|
||||
|
||||
varying vec4 rawpos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 Normal;
|
||||
varying vec4 constantColor;
|
||||
|
||||
attribute vec3 tangent;
|
||||
attribute vec3 binormal;
|
||||
|
||||
// ////fog "include" /////
|
||||
// uniform int fogType;
|
||||
//
|
||||
// void fog_Func(int type);
|
||||
//
|
||||
// //////////////////////
|
||||
|
||||
void main(void)
|
||||
{
|
||||
rawpos = gl_Vertex;
|
||||
ecPosition = gl_ModelViewMatrix * rawpos;
|
||||
Normal = normalize(gl_Normal);
|
||||
VNormal = gl_NormalMatrix * gl_Normal;
|
||||
VTangent = gl_NormalMatrix * tangent;
|
||||
VBinormal = gl_NormalMatrix * binormal;
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
constantColor = gl_FrontMaterial.emission
|
||||
+ gl_FrontColor * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
// fog_Func(fogType);
|
||||
}
|
|
@ -1,15 +0,0 @@
|
|||
#version 120
|
||||
//varying float fogCoord;
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 fragColor = gl_FrontMaterial.ambient;
|
||||
// float fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||
// gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
||||
gl_FragColor = fragColor;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
#version 120
|
||||
// varying float fogCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
// vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Vertex);
|
||||
|
||||
gl_Position = ftransform();
|
||||
// fogCoord = abs(ecPosition.z);
|
||||
}
|
|
@ -1,75 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
|
||||
// Ambient term comes in gl_Color.rgb.
|
||||
//
|
||||
// See http://wiki.flightgear.org/index.php/Howto:_Lightmap for details on
|
||||
// how to use it.
|
||||
|
||||
varying vec4 diffuse_term;
|
||||
varying vec3 normal;
|
||||
//varying float fogCoord;
|
||||
|
||||
uniform sampler2D texture;
|
||||
|
||||
// lightmap options
|
||||
uniform float condition;
|
||||
uniform float lightmap_factor;
|
||||
uniform sampler2D lightmap_texture;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
|
||||
float luminance(vec3 color)
|
||||
{
|
||||
return dot(vec3(0.212671, 0.715160, 0.072169), color);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 n, halfV;
|
||||
float NdotL, NdotHV, fogFactor;
|
||||
vec4 color = gl_Color;
|
||||
vec3 lightDir = gl_LightSource[0].position.xyz;
|
||||
vec3 halfVector = gl_LightSource[0].halfVector.xyz;
|
||||
vec4 texel;
|
||||
vec4 fragColor;
|
||||
vec4 specular = vec4(0.0);
|
||||
n = normalize(normal);
|
||||
// If gl_Color.a == 0, this is a back-facing polygon and the
|
||||
// normal should be reversed.
|
||||
|
||||
n = (2.0 * gl_Color.a - 1.0) * n;
|
||||
NdotL = max(dot(n, lightDir), 0.0);
|
||||
if (NdotL > 0.0) {
|
||||
color += diffuse_term * NdotL;
|
||||
halfV = halfVector;
|
||||
NdotHV = max(dot(n, halfV), 0.0);
|
||||
if (gl_FrontMaterial.shininess > 0.0)
|
||||
specular.rgb = (gl_FrontMaterial.specular.rgb
|
||||
* gl_LightSource[0].specular.rgb
|
||||
* pow(NdotHV, gl_FrontMaterial.shininess));
|
||||
}
|
||||
color.a = diffuse_term.a;
|
||||
// This shouldn't be necessary, but our lighting becomes very
|
||||
// saturated. Clamping the color before modulating by the texture
|
||||
// is closer to what the OpenGL fixed function pipeline does.
|
||||
color = clamp(color, 0.0, 1.0);
|
||||
texel = texture2D(texture, gl_TexCoord[0].st);
|
||||
fragColor = color * texel + specular;
|
||||
|
||||
// The lightmap function
|
||||
if ( condition >= 1.0 ) {
|
||||
vec3 lightmapTexel = texture2D(lightmap_texture, gl_TexCoord[0].st).rgb * lightmap_factor;
|
||||
fragColor.rgb = max(fragColor.rgb, lightmapTexel * gl_FrontMaterial.diffuse.rgb * texel.rgb);
|
||||
}
|
||||
|
||||
// fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||
// gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
||||
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||
gl_FragColor = fragColor;
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
|
||||
// Shader that uses OpenGL state values to do per-pixel lighting
|
||||
//
|
||||
// The only light used is gl_LightSource[0], which is assumed to be
|
||||
// directional.
|
||||
//
|
||||
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
||||
// equivalent to osg::Material::DIFFUSE.
|
||||
//
|
||||
// See http://wiki.flightgear.org/index.php/Howto:_Lightmap for details on
|
||||
// how to use it.
|
||||
|
||||
#define MODE_OFF 0
|
||||
#define MODE_DIFFUSE 1
|
||||
#define MODE_AMBIENT_AND_DIFFUSE 2
|
||||
|
||||
// The constant term of the lighting equation that doesn't depend on
|
||||
// the surface normal is passed in gl_{Front,Back}Color. The alpha
|
||||
// component is set to 1 for front, 0 for back in order to work around
|
||||
// bugs with gl_FrontFacing in the fragment shader.
|
||||
varying vec4 diffuse_term;
|
||||
varying vec3 normal;
|
||||
//varying float fogCoord;
|
||||
uniform int colorMode;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
normal = gl_NormalMatrix * gl_Normal;
|
||||
vec4 ambient_color, diffuse_color;
|
||||
if (colorMode == MODE_DIFFUSE) {
|
||||
diffuse_color = gl_Color;
|
||||
ambient_color = gl_FrontMaterial.ambient;
|
||||
} else if (colorMode == MODE_AMBIENT_AND_DIFFUSE) {
|
||||
diffuse_color = gl_Color;
|
||||
ambient_color = gl_Color;
|
||||
} else {
|
||||
diffuse_color = gl_FrontMaterial.diffuse;
|
||||
ambient_color = gl_FrontMaterial.ambient;
|
||||
}
|
||||
diffuse_term = diffuse_color * gl_LightSource[0].diffuse;
|
||||
vec4 constant_term = gl_FrontMaterial.emission + ambient_color *
|
||||
(gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
if (gl_FrontMaterial.diffuse.a < 1.0)
|
||||
diffuse_term.a = gl_FrontMaterial.diffuse.a;
|
||||
else
|
||||
diffuse_term.a = gl_Color.a;
|
||||
// Another hack for supporting two-sided lighting without using
|
||||
// gl_FrontFacing in the fragment shader.
|
||||
gl_FrontColor.rgb = constant_term.rgb; gl_FrontColor.a = 1.0;
|
||||
gl_BackColor.rgb = constant_term.rgb; gl_BackColor.a = 0.0;
|
||||
//fogCoord = abs(ecPosition.z / ecPosition.w);
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
|
||||
// Shader for use with material animations
|
||||
varying vec4 diffuse, constantColor, matSpecular;
|
||||
varying vec3 normal;
|
||||
//varying float fogCoord, alpha;
|
||||
varying float alpha;
|
||||
|
||||
uniform sampler2D texture;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 n, halfV;
|
||||
float NdotL, NdotHV, fogFactor;
|
||||
vec4 color = constantColor;
|
||||
vec3 lightDir = gl_LightSource[0].position.xyz;
|
||||
vec3 halfVector = gl_LightSource[0].halfVector.xyz;
|
||||
vec4 texel;
|
||||
vec4 fragColor;
|
||||
vec4 specular = vec4(0.0);
|
||||
n = normalize(normal);
|
||||
if (!gl_FrontFacing)
|
||||
n = -n;
|
||||
NdotL = max(dot(n, lightDir), 0.0);
|
||||
if (NdotL > 0.0) {
|
||||
color += diffuse * NdotL;
|
||||
halfV = normalize(halfVector);
|
||||
NdotHV = max(dot(n, halfV), 0.0);
|
||||
if (gl_FrontMaterial.shininess > 0.0)
|
||||
specular.rgb = (matSpecular.rgb
|
||||
* gl_LightSource[0].specular.rgb
|
||||
* pow(NdotHV, gl_FrontMaterial.shininess));
|
||||
}
|
||||
color.a = alpha;
|
||||
// This shouldn't be necessary, but our lighting becomes very
|
||||
// saturated. Clamping the color before modulating by the texture
|
||||
// is closer to what the OpenGL fixed function pipeline does.
|
||||
color = clamp(color, 0.0, 1.0);
|
||||
texel = texture2D(texture, gl_TexCoord[0].st);
|
||||
fragColor = color * texel + specular;
|
||||
//fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||
//gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
||||
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||
gl_FragColor = fragColor;
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
|
||||
// Shader that uses OpenGL state values to do per-pixel lighting
|
||||
//
|
||||
// The only light used is gl_LightSource[0], which is assumed to be
|
||||
// directional.
|
||||
//
|
||||
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
||||
// equivalent to osg::Material::DIFFUSE.
|
||||
vec4 ambientColor();
|
||||
vec4 diffuseColor();
|
||||
vec4 specularColor();
|
||||
vec4 emissionColor();
|
||||
|
||||
varying vec4 diffuse, constantColor, matSpecular;
|
||||
varying vec3 normal;
|
||||
//varying float alpha, fogCoord;
|
||||
varying float alpha;
|
||||
|
||||
void main()
|
||||
{
|
||||
//vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
//vec3 ecPosition3 = vec3(gl_ModelViewMatrix * gl_Vertex) / ecPosition.w;
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
normal = gl_NormalMatrix * gl_Normal;
|
||||
diffuse = diffuseColor() * gl_LightSource[0].diffuse;
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
if (gl_FrontMaterial.diffuse.a < 1.0)
|
||||
alpha = gl_FrontMaterial.diffuse.a;
|
||||
else
|
||||
alpha = diffuse.a;
|
||||
constantColor = emissionColor()
|
||||
+ ambientColor() * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
//fogCoord = abs(ecPosition3.z);
|
||||
matSpecular = specularColor();
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
|
||||
vec4 ambientColor()
|
||||
{
|
||||
return gl_FrontMaterial.ambient;
|
||||
}
|
||||
|
||||
vec4 diffuseColor()
|
||||
{
|
||||
return gl_Color;
|
||||
}
|
||||
|
||||
vec4 specularColor()
|
||||
{
|
||||
return gl_FrontMaterial.specular;
|
||||
}
|
||||
|
||||
vec4 emissionColor()
|
||||
{
|
||||
return gl_FrontMaterial.emission;
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
|
||||
vec4 ambientColor()
|
||||
{
|
||||
return gl_FrontMaterial.ambient;
|
||||
}
|
||||
|
||||
vec4 diffuseColor()
|
||||
{
|
||||
return gl_FrontMaterial.diffuse;
|
||||
}
|
||||
|
||||
vec4 specularColor()
|
||||
{
|
||||
return gl_FrontMaterial.specular;
|
||||
}
|
||||
|
||||
vec4 emissionColor()
|
||||
{
|
||||
return gl_FrontMaterial.emission;
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
|
||||
// Ambient term comes in gl_Color.rgb.
|
||||
varying vec4 diffuse_term;
|
||||
varying vec3 normal;
|
||||
//varying float fogCoord;
|
||||
|
||||
uniform sampler2D texture;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
float luminance(vec3 color)
|
||||
{
|
||||
return dot(vec3(0.212671, 0.715160, 0.072169), color);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 n, halfV;
|
||||
float NdotL, NdotHV, fogFactor;
|
||||
vec4 color = gl_FrontLightModelProduct.sceneColor + gl_Color;
|
||||
vec3 lightDir = gl_LightSource[0].position.xyz;
|
||||
vec3 halfVector = gl_LightSource[0].halfVector.xyz;
|
||||
vec4 texel;
|
||||
vec4 fragColor;
|
||||
vec4 specular = vec4(0.0);
|
||||
// If gl_Color.a == 0, this is a back-facing polygon and the
|
||||
// normal should be reversed.
|
||||
n = (2.0 * gl_Color.a - 1.0) * normal;
|
||||
n = normalize(n);
|
||||
NdotL = dot(n, lightDir);
|
||||
if (NdotL > 0.0) {
|
||||
color += diffuse_term * NdotL;
|
||||
halfV = normalize(halfVector);
|
||||
NdotHV = max(dot(n, halfV), 0.0);
|
||||
if (gl_FrontMaterial.shininess > 0.0)
|
||||
specular.rgb = (gl_FrontMaterial.specular.rgb
|
||||
* gl_LightSource[0].specular.rgb
|
||||
* pow(NdotHV, gl_FrontMaterial.shininess));
|
||||
}
|
||||
color.a = diffuse_term.a;
|
||||
// This shouldn't be necessary, but our lighting becomes very
|
||||
// saturated. Clamping the color before modulating by the texture
|
||||
// is closer to what the OpenGL fixed function pipeline does.
|
||||
color = clamp(color, 0.0, 1.0);
|
||||
texel = texture2D(texture, gl_TexCoord[0].st);
|
||||
fragColor = color * texel + specular;
|
||||
//fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||
//gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
||||
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||
gl_FragColor = fragColor;
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
// -*-C++-*-
|
||||
|
||||
// Shader that uses OpenGL state values to do per-pixel lighting
|
||||
//
|
||||
// The only light used is gl_LightSource[0], which is assumed to be
|
||||
// directional.
|
||||
//
|
||||
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
||||
// equivalent to osg::Material::DIFFUSE.
|
||||
#version 120
|
||||
|
||||
#define MODE_OFF 0
|
||||
#define MODE_DIFFUSE 1
|
||||
#define MODE_AMBIENT_AND_DIFFUSE 2
|
||||
|
||||
// The ambient term of the lighting equation that doesn't depend on
|
||||
// the surface normal is passed in gl_{Front,Back}Color. The alpha
|
||||
// component is set to 1 for front, 0 for back in order to work around
|
||||
// bugs with gl_FrontFacing in the fragment shader.
|
||||
varying vec4 diffuse_term;
|
||||
varying vec3 normal;
|
||||
//varying float fogCoord;
|
||||
|
||||
uniform int colorMode;
|
||||
|
||||
void main()
|
||||
{
|
||||
//vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
normal = gl_NormalMatrix * gl_Normal;
|
||||
vec4 ambient_color, diffuse_color;
|
||||
if (colorMode == MODE_DIFFUSE) {
|
||||
diffuse_color = gl_Color;
|
||||
ambient_color = gl_FrontMaterial.ambient;
|
||||
} else if (colorMode == MODE_AMBIENT_AND_DIFFUSE) {
|
||||
diffuse_color = gl_Color;
|
||||
ambient_color = gl_Color;
|
||||
} else {
|
||||
diffuse_color = gl_FrontMaterial.diffuse;
|
||||
ambient_color = gl_FrontMaterial.ambient;
|
||||
}
|
||||
diffuse_term = diffuse_color * gl_LightSource[0].diffuse;
|
||||
vec4 ambient_term = ambient_color * gl_LightSource[0].ambient;
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
if (gl_FrontMaterial.diffuse.a < 1.0)
|
||||
diffuse_term.a = gl_FrontMaterial.diffuse.a;
|
||||
else
|
||||
diffuse_term.a = gl_Color.a;
|
||||
// Another hack for supporting two-sided lighting without using
|
||||
// gl_FrontFacing in the fragment shader.
|
||||
gl_FrontColor.rgb = ambient_term.rgb; gl_FrontColor.a = 1.0;
|
||||
gl_BackColor.rgb = ambient_term.rgb; gl_FrontColor.a = 0.0;
|
||||
//fogCoord = abs(ecPosition.z / ecPosition.w);
|
||||
}
|
|
@ -1,141 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// Author: Vivian Meazza.
|
||||
|
||||
#version 120
|
||||
|
||||
varying vec3 rawpos;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 Normal;
|
||||
varying vec3 vViewVec;
|
||||
varying vec3 reflVec;
|
||||
|
||||
varying vec4 Diffuse;
|
||||
varying float alpha;
|
||||
//varying float fogCoord;
|
||||
|
||||
uniform samplerCube Environment;
|
||||
uniform sampler2D Rainbow;
|
||||
uniform sampler2D BaseTex;
|
||||
uniform sampler2D Fresnel;
|
||||
uniform sampler2D Map;
|
||||
uniform sampler2D NormalTex;
|
||||
uniform sampler3D Noise;
|
||||
|
||||
uniform float refl_correction;
|
||||
uniform float rainbowiness;
|
||||
uniform float fresneliness;
|
||||
uniform float noisiness;
|
||||
uniform float ambient_correction;
|
||||
uniform float reflect_map;
|
||||
uniform float normalmap_dds;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec3 halfV;
|
||||
float NdotL, NdotHV;
|
||||
|
||||
vec3 lightDir = gl_LightSource[0].position.xyz;
|
||||
vec3 halfVector = gl_LightSource[0].halfVector.xyz;
|
||||
|
||||
|
||||
vec4 color = gl_Color;
|
||||
vec4 specular = vec4(0.0);
|
||||
vec4 ns = texture2D(NormalTex, gl_TexCoord[0].st);
|
||||
vec3 n = ns.rgb * 2.0 - 1.0;
|
||||
n = normalize(n.x * VTangent + n.y * VBinormal + n.z * VNormal);
|
||||
|
||||
//fix dds normal
|
||||
if (normalmap_dds > 0.0) {
|
||||
n = -n;
|
||||
}
|
||||
|
||||
NdotL = max(0.0, dot(n, lightDir));
|
||||
|
||||
// calculate the specular light
|
||||
if (NdotL > 0.0) {
|
||||
color += Diffuse * NdotL;
|
||||
halfV = normalize(halfVector);
|
||||
NdotHV = max(dot(n, halfV), 0.0);
|
||||
if (gl_FrontMaterial.shininess > 0.0)
|
||||
specular.rgb = (gl_FrontMaterial.specular.rgb * ns.a
|
||||
* gl_LightSource[0].specular.rgb
|
||||
* pow(NdotHV, gl_FrontMaterial.shininess));
|
||||
}
|
||||
|
||||
//color.a = alpha;
|
||||
vec4 texel = texture2D(BaseTex, gl_TexCoord[0].st);
|
||||
//vec4 texelcolor = color * texel + specular;
|
||||
color.a = texel.a * alpha;
|
||||
color = clamp(color, 0.0, 1.0);
|
||||
|
||||
// calculate the fog factor
|
||||
// const float LOG2 = 1.442695;
|
||||
// float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||
// fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||
//
|
||||
// if(gl_Fog.density == 1.0)
|
||||
// fogFactor=1.0;
|
||||
|
||||
vec3 normal = normalize(VNormal);
|
||||
vec3 viewVec = normalize(vViewVec);
|
||||
|
||||
// Map a rainbowish color
|
||||
float v = dot(viewVec, normal);
|
||||
vec4 rainbow = texture2D(Rainbow, vec2(v, 0.0));
|
||||
|
||||
// Map a fresnel effect
|
||||
vec4 fresnel = texture2D(Fresnel, vec2(v, 0.0));
|
||||
|
||||
// map the refection of the environment
|
||||
vec4 reflection = textureCube(Environment, reflVec);
|
||||
|
||||
// set the user shininess offse
|
||||
float transparency_offset = clamp(refl_correction, -1.0, 1.0);
|
||||
float reflFactor = 0.0;
|
||||
|
||||
if(reflect_map > 0.0){
|
||||
// map the shininess of the object with user input
|
||||
vec4 map = texture2D(Map, gl_TexCoord[0].st);
|
||||
//float pam = (map.a * -2) + 1; //reverse map
|
||||
reflFactor = map.a + transparency_offset;
|
||||
} else {
|
||||
// set the reflectivity proportional to shininess with user input
|
||||
reflFactor = (gl_FrontMaterial.shininess / 128.0) * ns.a + transparency_offset;
|
||||
}
|
||||
|
||||
reflFactor = clamp(reflFactor, 0.0, 1.0);
|
||||
|
||||
// set ambient adjustment to remove bluiness with user input
|
||||
float ambient_offset = clamp(ambient_correction, -1.0, 1.0);
|
||||
vec4 ambient_Correction = vec4(gl_LightSource[0].ambient.rg, gl_LightSource[0].ambient.b * 0.6, 0.5) * ambient_offset ;
|
||||
ambient_Correction = clamp(ambient_Correction, -1.0, 1.0);
|
||||
|
||||
// map noise vector
|
||||
vec4 noisevec = texture3D(Noise, rawpos.xyz);
|
||||
|
||||
// add fringing fresnel and rainbow effects and modulate by reflection
|
||||
vec4 reflcolor = mix(reflection, rainbow, rainbowiness * v);
|
||||
vec4 reflfrescolor = mix(reflcolor, fresnel, fresneliness * v);
|
||||
vec4 noisecolor = mix(reflfrescolor, noisevec, noisiness);
|
||||
vec4 raincolor = vec4(noisecolor.rgb * reflFactor, 1.0);
|
||||
|
||||
vec4 mixedcolor = mix(texel, raincolor, reflFactor);
|
||||
|
||||
// the final reflection
|
||||
vec4 reflColor = vec4(color.rgb * mixedcolor.rgb + specular.rgb + ambient_Correction.rgb, color.a);
|
||||
|
||||
reflColor = clamp(reflColor, 0.0, 1.0);
|
||||
|
||||
// gl_FragColor = mix(gl_Fog.color, reflColor, fogFactor);
|
||||
reflColor.rgb = fog_Func(reflColor.rgb, fogType);
|
||||
gl_FragColor = reflColor;
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// © Emilian Huminiuc and Vivian Meazza 2011
|
||||
#version 120
|
||||
|
||||
varying vec3 rawpos;
|
||||
varying float fogCoord;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 Normal;
|
||||
varying vec3 vViewVec;
|
||||
varying vec3 reflVec;
|
||||
|
||||
varying vec4 Diffuse;
|
||||
varying float alpha;
|
||||
|
||||
uniform mat4 osg_ViewMatrixInverse;
|
||||
|
||||
attribute vec3 tangent;
|
||||
attribute vec3 binormal;
|
||||
|
||||
////fog "include"////////
|
||||
// uniform int fogType;
|
||||
//
|
||||
// void fog_Func(int type);
|
||||
/////////////////////////
|
||||
|
||||
void main(void)
|
||||
{
|
||||
rawpos = gl_Vertex.xyz / gl_Vertex.w;
|
||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
ecPosition.xyz = ecPosition.xyz / ecPosition.w;
|
||||
//fogCoord = ecPosition.z;
|
||||
//fog_Func(fogType);
|
||||
|
||||
vec3 n = normalize(gl_Normal);
|
||||
vec3 t = cross(gl_Normal, vec3(1.0,0.0,0.0));
|
||||
vec3 b = cross(n,t);
|
||||
|
||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
VTangent = normalize(gl_NormalMatrix * tangent);
|
||||
VBinormal = normalize(gl_NormalMatrix * binormal);
|
||||
Normal = normalize(gl_Normal);
|
||||
|
||||
Diffuse = gl_Color * gl_LightSource[0].diffuse;
|
||||
//Diffuse= gl_Color.rgb * max(0.0, dot(normalize(VNormal), gl_LightSource[0].position.xyz));
|
||||
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
if (gl_FrontMaterial.diffuse.a < 1.0)
|
||||
alpha = gl_FrontMaterial.diffuse.a;
|
||||
else
|
||||
alpha = gl_Color.a;
|
||||
|
||||
// Vertex in eye coordinates
|
||||
vec3 vertVec = ecPosition.xyz;
|
||||
|
||||
vViewVec.x = dot(t, vertVec);
|
||||
vViewVec.y = dot(b, vertVec);
|
||||
vViewVec.z = dot(n, vertVec);
|
||||
|
||||
// calculate the reflection vector
|
||||
vec4 reflect_eye = vec4(reflect(vertVec, VNormal), 0.0);
|
||||
reflVec = normalize(gl_ModelViewMatrixInverse * reflect_eye).xyz;
|
||||
|
||||
gl_FrontColor = gl_FrontMaterial.emission + gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
}
|
|
@ -1,139 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// Author: Vivian Meazza.
|
||||
// additions by Emilian Huminuc
|
||||
|
||||
#version 120
|
||||
|
||||
varying vec3 rawpos;
|
||||
varying vec3 VNormal;
|
||||
varying vec4 constantColor;
|
||||
varying vec3 vViewVec;
|
||||
varying vec3 reflVec;
|
||||
|
||||
varying vec4 Diffuse;
|
||||
varying float alpha;
|
||||
//varying float fogCoord;
|
||||
|
||||
uniform samplerCube Environment;
|
||||
uniform sampler2D Rainbow;
|
||||
uniform sampler2D BaseTex;
|
||||
uniform sampler2D Fresnel;
|
||||
uniform sampler2D Map;
|
||||
uniform sampler3D Noise;
|
||||
uniform sampler2D Lightmap;
|
||||
|
||||
uniform float refl_correction;
|
||||
uniform float rainbowiness;
|
||||
uniform float fresneliness;
|
||||
uniform float noisiness;
|
||||
uniform float ambient_correction;
|
||||
uniform float lightmap_factor;
|
||||
|
||||
uniform int light_map;
|
||||
uniform int reflect_map;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec3 n, halfV;
|
||||
float NdotL, NdotHV;
|
||||
vec4 color = constantColor;
|
||||
vec4 specular = vec4(0.0);
|
||||
n = normalize(VNormal);
|
||||
vec3 lightDir = gl_LightSource[0].position.xyz;
|
||||
vec3 halfVector = gl_LightSource[0].halfVector.xyz;
|
||||
|
||||
NdotL = dot(n, lightDir);
|
||||
|
||||
// calculate the specular light
|
||||
if (NdotL > 0.0) {
|
||||
color += Diffuse * NdotL;
|
||||
halfV = normalize(halfVector);
|
||||
NdotHV = max(dot(n, halfV), 0.0);
|
||||
if (gl_FrontMaterial.shininess > 0.0)
|
||||
specular.rgb = (gl_FrontMaterial.specular.rgb
|
||||
* gl_LightSource[0].specular.rgb
|
||||
* pow(NdotHV, gl_FrontMaterial.shininess));
|
||||
}
|
||||
|
||||
vec4 texel = texture2D(BaseTex, gl_TexCoord[0].st);
|
||||
// vec4 texelcolor = color * texel + specular;
|
||||
color.a = texel.a * alpha;
|
||||
color = clamp(color, 0.0, 1.0);
|
||||
|
||||
// calculate the fog factor
|
||||
// const float LOG2 = 1.442695;
|
||||
// float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||
// fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||
//
|
||||
// if(gl_Fog.density == 1.0)
|
||||
// fogFactor=1.0;
|
||||
|
||||
vec3 normal = normalize(VNormal);
|
||||
vec3 viewVec = normalize(vViewVec);
|
||||
|
||||
// Map a rainbowish color
|
||||
float v = dot(viewVec, normal);
|
||||
vec4 rainbow = texture2D(Rainbow, vec2(v, 0.0));
|
||||
|
||||
// Map a fresnel effect
|
||||
vec4 fresnel = texture2D(Fresnel, vec2(v, 0.0));
|
||||
|
||||
// map the refection of the environment
|
||||
vec4 reflection = textureCube(Environment, reflVec);
|
||||
|
||||
// set the user shininess offset
|
||||
float transparency_offset = clamp(refl_correction, -1.0, 1.0);
|
||||
float reflFactor = 0.0;
|
||||
|
||||
if(reflect_map > 0){
|
||||
// map the shininess of the object with user input
|
||||
vec4 map = texture2D(Map, gl_TexCoord[0].st);
|
||||
//float pam = (map.a * -2) + 1; //reverse map
|
||||
reflFactor = map.a + transparency_offset;
|
||||
} else {
|
||||
// set the reflectivity proportional to shininess with user
|
||||
// input
|
||||
reflFactor = (gl_FrontMaterial.shininess / 128.0) + transparency_offset;
|
||||
}
|
||||
|
||||
reflFactor = clamp(reflFactor, 0.0, 1.0);
|
||||
|
||||
// set ambient adjustment to remove bluiness with user input
|
||||
float ambient_offset = clamp(ambient_correction, -1.0, 1.0);
|
||||
vec4 ambient_Correction = vec4(gl_LightSource[0].ambient.rg, gl_LightSource[0].ambient.b * 0.6, 0.5) * ambient_offset ;
|
||||
// vec4 ambient_Correction = vec4(ambient_Correction.rgb, 0.5);
|
||||
ambient_Correction = clamp(ambient_Correction, -1.0, 1.0);
|
||||
|
||||
// map noise vector
|
||||
vec4 noisevec = texture3D(Noise, rawpos.xyz);
|
||||
|
||||
// add fringing fresnel and rainbow effects and modulate by reflection
|
||||
vec4 reflcolor = mix(reflection, rainbow, rainbowiness * v);
|
||||
vec4 reflfrescolor = mix(reflcolor, fresnel, fresneliness * v);
|
||||
vec4 noisecolor = mix(reflfrescolor, noisevec, noisiness);
|
||||
vec4 raincolor = vec4(noisecolor.rgb, 1.0) * reflFactor;
|
||||
|
||||
vec4 mixedcolor = mix(texel, raincolor, reflFactor);
|
||||
|
||||
// the final reflection
|
||||
vec4 reflColor = vec4(color.rgb * mixedcolor.rgb + specular.rgb + ambient_Correction.rgb, color.a);
|
||||
reflColor = clamp(reflColor, 0.0, 1.0);
|
||||
|
||||
// add a lightmap
|
||||
|
||||
if ( light_map >= 1 ) {
|
||||
vec3 lightmapTexel = texture2D(Lightmap, gl_TexCoord[0].st).rgb * lightmap_factor;
|
||||
reflColor.rgb = max(reflColor.rgb, lightmapTexel * gl_FrontMaterial.diffuse.rgb * mixedcolor.rgb);
|
||||
}
|
||||
|
||||
// gl_FragColor = mix(gl_Fog.color, reflColor, fogFactor);
|
||||
reflColor.rgb = fog_Func(reflColor.rgb, fogType);
|
||||
gl_FragColor = reflColor;
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// Author: Vivian Meazza.
|
||||
#version 120
|
||||
|
||||
varying vec3 rawpos;
|
||||
varying vec3 VNormal;
|
||||
varying vec4 constantColor;
|
||||
varying vec3 vViewVec;
|
||||
varying vec3 reflVec;
|
||||
|
||||
varying vec4 Diffuse;
|
||||
varying float alpha;
|
||||
//varying float fogCoord;
|
||||
|
||||
uniform mat4 osg_ViewMatrixInverse;
|
||||
|
||||
//attribute vec3 tangent, binormal, normal;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
rawpos = gl_Vertex.xyz / gl_Vertex.w;
|
||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
ecPosition.xyz = ecPosition.xyz / ecPosition.w;
|
||||
|
||||
vec3 t = normalize(cross(gl_Normal, vec3(1.0,0.0,0.0)));
|
||||
vec3 b = normalize(cross(gl_Normal,t));
|
||||
vec3 n = normalize(gl_Normal);
|
||||
|
||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
|
||||
Diffuse = gl_Color * gl_LightSource[0].diffuse;
|
||||
//Diffuse= gl_Color.rgb * max(0.0, dot(normalize(VNormal), gl_LightSource[0].position.xyz));
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
if (gl_FrontMaterial.diffuse.a < 1.0)
|
||||
alpha = gl_FrontMaterial.diffuse.a;
|
||||
else
|
||||
alpha = gl_Color.a;
|
||||
|
||||
//fogCoord = abs(ecPosition.z);
|
||||
|
||||
// Vertex in eye coordinates
|
||||
vec3 vertVec = ecPosition.xyz;
|
||||
|
||||
vViewVec.x = dot(t, vertVec);
|
||||
vViewVec.y = dot(b, vertVec);
|
||||
vViewVec.z = dot(n, vertVec);
|
||||
|
||||
// calculate the reflection vector
|
||||
vec4 reflect_eye = vec4(reflect(vertVec, VNormal), 0.0);
|
||||
reflVec = normalize(gl_ModelViewMatrixInverse * reflect_eye).xyz;
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
constantColor = gl_FrontMaterial.emission
|
||||
+ gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
}
|
|
@ -1,139 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// © Emilian Huminiuc and Vivian Meazza 2011
|
||||
|
||||
#version 120
|
||||
|
||||
varying vec3 rawpos;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 vViewVec;
|
||||
varying vec3 reflVec;
|
||||
varying vec3 vertVec;
|
||||
|
||||
varying vec4 Diffuse;
|
||||
varying float alpha;
|
||||
//varying float fogCoord;
|
||||
|
||||
uniform samplerCube Environment;
|
||||
uniform sampler2D Rainbow;
|
||||
uniform sampler2D BaseTex;
|
||||
uniform sampler2D Fresnel;
|
||||
uniform sampler2D Map;
|
||||
uniform sampler2D NormalTex;
|
||||
uniform sampler3D Noise;
|
||||
|
||||
uniform float spec_adjust;
|
||||
uniform float rainbowiness;
|
||||
uniform float fresneliness;
|
||||
uniform float noisiness;
|
||||
uniform float ambient_correction;
|
||||
uniform float normalmap_dds;
|
||||
|
||||
//uniform int fogType;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
float getShadowing();
|
||||
vec3 getClusteredLightsContribution(vec3 p, vec3 n, vec3 texel);
|
||||
|
||||
void main (void)
|
||||
{
|
||||
//vec3 halfV;
|
||||
//float NdotL, NdotHV;
|
||||
|
||||
vec4 texel = texture2D(BaseTex, gl_TexCoord[0].st);
|
||||
vec4 nmap = texture2D(NormalTex, gl_TexCoord[0].st * 8.0);
|
||||
vec4 map = texture2D(Map, gl_TexCoord[0].st * 8.0);
|
||||
vec4 specNoise = texture3D(Noise, rawpos.xyz * 0.0045);
|
||||
vec4 noisevec = texture3D(Noise, rawpos.xyz);
|
||||
|
||||
vec3 lightDir = gl_LightSource[0].position.xyz;
|
||||
vec3 halfVector = gl_LightSource[0].halfVector.xyz;
|
||||
vec3 N;
|
||||
float pf;
|
||||
|
||||
N = nmap.rgb * 2.0 - 1.0;
|
||||
N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
|
||||
if (normalmap_dds > 0)
|
||||
N = -N;
|
||||
|
||||
float lightness = dot(texel.rgb, vec3( 0.3, 0.59, 0.11 ));
|
||||
// calculate the specular light
|
||||
float refl_correction = spec_adjust * 2.5 - 1.0;
|
||||
float shininess = max (0.35, refl_correction);
|
||||
float nDotVP = max(0.0, dot(N, normalize(gl_LightSource[0].position.xyz)));
|
||||
float nDotHV = max(0.0, dot(N, normalize(gl_LightSource[0].halfVector.xyz)));
|
||||
|
||||
if (nDotVP == 0.0)
|
||||
pf = 0.0;
|
||||
else
|
||||
pf = pow(nDotHV, /*gl_FrontMaterial.*/shininess);
|
||||
|
||||
float shadowmap = getShadowing();
|
||||
vec4 Diffuse = gl_LightSource[0].diffuse * nDotVP * shadowmap;
|
||||
//vec4 Specular = vec4(vec3(0.5*shininess), 1.0)* gl_LightSource[0].specular * pf;
|
||||
vec4 Specular = vec4(1.0)* lightness * gl_LightSource[0].specular * pf * shadowmap;
|
||||
|
||||
vec4 color = gl_Color + Diffuse * gl_FrontMaterial.diffuse;
|
||||
//color += Specular * vec4(vec3(0.5*shininess), 1.0) * nmap.a;
|
||||
float nFactor = 1.0 - N.z;
|
||||
color += Specular * vec4(1.0) * nmap.a * nFactor;
|
||||
color.a = texel.a * alpha;
|
||||
color = clamp(color, 0.0, 1.0);
|
||||
|
||||
vec3 viewVec = normalize(vViewVec);
|
||||
|
||||
// Map a rainbowish color
|
||||
float v = abs(dot(viewVec, normalize(VNormal)));
|
||||
vec4 rainbow = texture2D(Rainbow, vec2(v, 0.0));
|
||||
|
||||
// Map a fresnel effect
|
||||
vec4 fresnel = texture2D(Fresnel, vec2(v, 0.0));
|
||||
|
||||
// map the refection of the environment
|
||||
vec4 reflection = textureCube(Environment, reflVec * dot(N,VNormal));
|
||||
|
||||
|
||||
// set the user shininess offset
|
||||
float transparency_offset = clamp(refl_correction, -1.0, 1.0);
|
||||
float reflFactor = 0.0;
|
||||
|
||||
float MixFactor = specNoise.r * specNoise.g * specNoise.b * 350.0;
|
||||
|
||||
MixFactor = 0.75 * smoothstep(0.0, 1.0, MixFactor);
|
||||
|
||||
reflFactor = max(map.a * (texel.r + texel.g), 1.0 - MixFactor) * (1.0- N.z) + transparency_offset ;
|
||||
|
||||
reflFactor =0.75 * smoothstep(0.05, 1.0, reflFactor);
|
||||
|
||||
// set ambient adjustment to remove bluiness with user input
|
||||
float ambient_offset = clamp(ambient_correction, -1.0, 1.0);
|
||||
vec4 ambient_Correction = vec4(gl_LightSource[0].ambient.rg, gl_LightSource[0].ambient.b * 0.6, 0.5) * ambient_offset ;
|
||||
ambient_Correction = clamp(ambient_Correction, -1.0, 1.0);
|
||||
|
||||
// add fringing fresnel and rainbow effects and modulate by reflection
|
||||
vec4 reflcolor = mix(reflection, rainbow, rainbowiness * v);
|
||||
reflcolor += Specular * nmap.a * nFactor;
|
||||
vec4 reflfrescolor = mix(reflcolor, fresnel, fresneliness * v);
|
||||
vec4 noisecolor = mix(reflfrescolor, noisevec, noisiness);
|
||||
vec4 raincolor = vec4(noisecolor.rgb * reflFactor, 1.0);
|
||||
raincolor += Specular * nmap.a * nFactor;
|
||||
|
||||
|
||||
vec4 mixedcolor = mix(texel, raincolor * (1.0 - refl_correction * (1.0 - lightness)), reflFactor); //* (1.0 - 0.5 * transparency_offset )
|
||||
|
||||
// the final reflection
|
||||
vec4 fragColor = vec4(color.rgb * mixedcolor.rgb + ambient_Correction.rgb * (1.0 - refl_correction * (1.0 - 0.8 * lightness)) * nFactor, color.a);
|
||||
fragColor += Specular * nmap.a * nFactor;
|
||||
|
||||
fragColor.rgb += getClusteredLightsContribution(vertVec, N, texel.rgb);
|
||||
|
||||
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||
gl_FragColor = fragColor;
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// © Emilian Huminiuc and Vivian Meazza 2011
|
||||
#version 120
|
||||
|
||||
varying vec3 rawpos;
|
||||
varying float fogCoord;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 Normal;
|
||||
varying vec3 vViewVec;
|
||||
varying vec3 reflVec;
|
||||
varying vec3 vertVec;
|
||||
|
||||
varying vec4 Diffuse;
|
||||
varying float alpha;
|
||||
|
||||
uniform mat4 osg_ViewMatrixInverse;
|
||||
|
||||
attribute vec3 tangent;
|
||||
attribute vec3 binormal;
|
||||
|
||||
////fog "include"////////
|
||||
// uniform int fogType;
|
||||
//
|
||||
// void fog_Func(int type);
|
||||
/////////////////////////
|
||||
|
||||
void setupShadows(vec4 eyeSpacePos);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
rawpos = gl_Vertex.xyz / gl_Vertex.w;
|
||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
ecPosition.xyz = ecPosition.xyz / ecPosition.w;
|
||||
//fogCoord = ecPosition.z;
|
||||
//fog_Func(fogType);
|
||||
|
||||
vec3 n = normalize(gl_Normal);
|
||||
vec3 t = cross(gl_Normal, vec3(1.0,0.0,0.0));
|
||||
vec3 b = cross(n,t);
|
||||
|
||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
VTangent = normalize(gl_NormalMatrix * tangent);
|
||||
VBinormal = normalize(gl_NormalMatrix * binormal);
|
||||
Normal = normalize(gl_Normal);
|
||||
|
||||
Diffuse = gl_Color * gl_LightSource[0].diffuse;
|
||||
//Diffuse= gl_Color.rgb * max(0.0, dot(normalize(VNormal), gl_LightSource[0].position.xyz));
|
||||
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
if (gl_FrontMaterial.diffuse.a < 1.0)
|
||||
alpha = gl_FrontMaterial.diffuse.a;
|
||||
else
|
||||
alpha = gl_Color.a;
|
||||
|
||||
// Vertex in eye coordinates
|
||||
vertVec = ecPosition.xyz;
|
||||
|
||||
vViewVec.x = dot(t, vertVec);
|
||||
vViewVec.y = dot(b, vertVec);
|
||||
vViewVec.z = dot(n, vertVec);
|
||||
|
||||
// calculate the reflection vector
|
||||
vec4 reflect_eye = vec4(reflect(vertVec, VNormal), 0.0);
|
||||
reflVec = normalize(gl_ModelViewMatrixInverse * reflect_eye).xyz;
|
||||
|
||||
gl_FrontColor = gl_FrontMaterial.emission + gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
setupShadows(ecPosition);
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
varying vec4 diffuse, constantColor;
|
||||
varying vec3 normal, lightDir, halfVector;
|
||||
//varying float fogCoord, alpha;
|
||||
varying float alpha;
|
||||
|
||||
uniform sampler2D texture;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
float luminance(vec3 color)
|
||||
{
|
||||
return dot(vec3(0.212671, 0.715160, 0.072169), color);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec3 n, halfV;
|
||||
float NdotL, NdotHV, fogFactor;
|
||||
vec4 color = gl_FrontMaterial.emission
|
||||
+ gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
vec3 lightDir = gl_LightSource[0].position.xyz;
|
||||
vec3 halfVector = gl_LightSource[0].halfVector.xyz;
|
||||
vec4 texel;
|
||||
vec4 fragColor;
|
||||
vec4 specular = vec4(0.0);
|
||||
|
||||
n = normalize(normal);
|
||||
NdotL = max(dot(n, lightDir), 0.0);
|
||||
if (NdotL > 0.0) {
|
||||
color += diffuse * NdotL;
|
||||
halfV = normalize(halfVector);
|
||||
NdotHV = max(dot(n, halfV), 0.0);
|
||||
if (gl_FrontMaterial.shininess > 0.0)
|
||||
specular.rgb = (gl_FrontMaterial.specular.rgb
|
||||
* gl_LightSource[0].specular.rgb
|
||||
* pow(NdotHV, gl_FrontMaterial.shininess));
|
||||
}
|
||||
color.a = alpha;
|
||||
|
||||
|
||||
// This shouldn't be necessary, but our lighting becomes very
|
||||
// saturated. Clamping the color before modulating by the texture
|
||||
// is closer to what the OpenGL fixed function pipeline does.
|
||||
color = clamp(color, 0.0, 1.0);
|
||||
texel = texture2D(texture, gl_TexCoord[0].st);
|
||||
fragColor = color * texel + specular;
|
||||
|
||||
// Store pixel's luminance in the alpha value
|
||||
if(alpha > 0.95) {
|
||||
float lum = 1.0 - (luminance(fragColor.rgb) * 3.0);
|
||||
float tex_lum = luminance(texel.rgb);
|
||||
fragColor.a = tex_lum * clamp(lum, 0.01, 1.0);
|
||||
}
|
||||
|
||||
// fogFactor = exp(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord);
|
||||
// gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);
|
||||
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||
gl_FragColor = fragColor;
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#version 120
|
||||
|
||||
uniform sampler2D baseTexture;
|
||||
varying float fogFactor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 base = texture2D( baseTexture, gl_TexCoord[0].st);
|
||||
vec4 finalColor = base * gl_Color;
|
||||
gl_FragColor.rgb = mix(gl_Fog.color.rgb, finalColor.rgb, fogFactor );
|
||||
gl_FragColor.a = mix(0.0, finalColor.a, fogFactor);
|
||||
}
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
|
||||
varying float fogFactor;
|
||||
|
||||
//attribute vec3 usrAttr3;
|
||||
//attribute vec3 usrAttr4;
|
||||
|
||||
//float textureIndexX = usrAttr3.r;
|
||||
//float textureIndexY = usrAttr3.g;
|
||||
//float wScale = usrAttr3.b;
|
||||
//float hScale = usrAttr4.r;
|
||||
//float shade = usrAttr4.g;
|
||||
//float cloud_height = usrAttr4.b;
|
||||
|
||||
//float shade = usrAttr3.r;
|
||||
//float cloud_height = usrAttr3.g;
|
||||
//float scale = usrAttr3.b;
|
||||
|
||||
float shading;
|
||||
|
||||
float shade = 0.3;
|
||||
float cloud_height = 1000.0;
|
||||
float scale = 0.5;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
//shade = 0.1 * shade;
|
||||
//scale = 0.1 * scale;
|
||||
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
vec4 ep = gl_ModelViewMatrixInverse * vec4(0.0,0.0,0.0,1.0);
|
||||
vec4 l = gl_ModelViewMatrixInverse * vec4(0.0,0.0,1.0,1.0);
|
||||
vec3 view = normalize(ep.xyz - l.xyz);
|
||||
|
||||
vec4 posh = gl_ModelViewMatrixInverse * normalize(vec4(gl_Vertex.x,gl_Vertex.y,gl_Vertex.z,1.0));
|
||||
vec3 pos = normalize(ep.xyz - posh.xyz);
|
||||
|
||||
mat4 sprime = mat4(1.0,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0);
|
||||
mat4 scale = gl_ModelViewMatrix * sprime * gl_ModelViewMatrixInverse;
|
||||
|
||||
float dist = sqrt(gl_Vertex.x * gl_Vertex.x + gl_Vertex.y * gl_Vertex.y + gl_Vertex.z * gl_Vertex.z);
|
||||
//vec3 u = normalize(smoothstep(500.0, 1500.0, dist) * pos + (1.0 - smoothstep(500.0, 1500.0, dist)) * view);
|
||||
//vec3 u = normalize(mix(pos, view, smoothstep(500.0,1500.0,dist)));
|
||||
vec3 u = view;
|
||||
|
||||
// Find a rotation matrix that rotates 1,0,0 into u. u, r and w are
|
||||
// the columns of that matrix.
|
||||
vec3 absu = abs(u);
|
||||
vec3 r = normalize(vec3(-u.y, u.x, 0.0));
|
||||
vec3 w = cross(u, r);
|
||||
|
||||
// Do the matrix multiplication by [ u r w pos]. Assume no
|
||||
// scaling in the homogeneous component of pos.
|
||||
gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
gl_Position.xyz = gl_Vertex.x * u;
|
||||
gl_Position.xyz += gl_Vertex.y * r * 1.0;
|
||||
gl_Position.xyz += gl_Vertex.z * w * scale;
|
||||
//gl_Position.xyz += gl_Vertex.y * r * wScale;
|
||||
//gl_Position.xyz += gl_Vertex.z * w * hScale;
|
||||
gl_Position.xyz += gl_Color.xyz;
|
||||
|
||||
// Determine a lighting normal based on the vertex position from the
|
||||
// center of the cloud, so that sprite on the opposite side of the cloud to the sun are darker.
|
||||
float n = dot(normalize(-gl_LightSource[0].position.xyz),
|
||||
normalize(mat3x3(gl_ModelViewMatrix) * (- gl_Position.xyz)));;
|
||||
|
||||
// Determine the position - used for fog and shading calculations
|
||||
vec3 ecPosition = vec3(gl_ModelViewMatrix * gl_Position);
|
||||
float fogCoord = abs(ecPosition.z);
|
||||
float fract = smoothstep(0.0, cloud_height, gl_Position.z + cloud_height);
|
||||
|
||||
// Final position of the sprite
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Position;
|
||||
|
||||
// Determine the shading of the sprite based on its vertical position and position relative to the sun.
|
||||
n = min(smoothstep(-0.5, 0.0, n), fract);
|
||||
// Determine the shading based on a mixture from the backlight to the front
|
||||
vec4 backlight = gl_LightSource[0].diffuse * shade;
|
||||
|
||||
gl_FrontColor = mix(backlight, gl_LightSource[0].diffuse, n);
|
||||
gl_FrontColor += gl_FrontLightModelProduct.sceneColor;
|
||||
|
||||
// As we get within 100m of the sprite, it is faded out. Equally at large distances it also fades out.
|
||||
gl_FrontColor.a = min(smoothstep(10.0, 100.0, fogCoord), 1.0 - smoothstep(15000.0, 20000.0, fogCoord));
|
||||
gl_BackColor = gl_FrontColor;
|
||||
|
||||
// Fog doesn't affect clouds as much as other objects.
|
||||
fogFactor = exp( -gl_Fog.density * fogCoord * 0.2);
|
||||
fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||
}
|
|
@ -1,176 +0,0 @@
|
|||
// -*-C++-*-
|
||||
// Texture switching based on face slope and snow level
|
||||
// based on earlier work by Frederic Bouvier, Tim Moore, and Yves Sablonier.
|
||||
// © Emilian Huminiuc 2011
|
||||
|
||||
#version 120
|
||||
|
||||
varying float RawPosZ;
|
||||
varying vec3 WorldPos;
|
||||
varying vec3 normal;
|
||||
varying vec3 Vnormal;
|
||||
varying vec4 eyePos;
|
||||
|
||||
uniform float SnowLevel;
|
||||
uniform float Transitions;
|
||||
uniform float InverseSlope;
|
||||
uniform float RainNorm;
|
||||
|
||||
uniform float CloudCover0;
|
||||
uniform float CloudCover1;
|
||||
uniform float CloudCover2;
|
||||
uniform float CloudCover3;
|
||||
uniform float CloudCover4;
|
||||
|
||||
uniform sampler2D BaseTex;
|
||||
uniform sampler2D SecondTex;
|
||||
uniform sampler2D ThirdTex;
|
||||
uniform sampler2D SnowTex;
|
||||
|
||||
uniform sampler3D NoiseTex;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
float getShadowing();
|
||||
vec3 getClusteredLightsContribution(vec3 p, vec3 n, vec3 texel);
|
||||
|
||||
void main()
|
||||
{
|
||||
float pf = 0.0;
|
||||
|
||||
vec3 lightDir = gl_LightSource[0].position.xyz;
|
||||
vec3 halfVector = gl_LightSource[0].halfVector.xyz;
|
||||
|
||||
vec4 texel = vec4(0.0);
|
||||
vec4 specular = vec4(0.0);
|
||||
|
||||
float cover = min(min(min(min(CloudCover0, CloudCover1),CloudCover2),CloudCover3),CloudCover4);
|
||||
|
||||
vec4 Noise = texture3D(NoiseTex, WorldPos.xyz*0.0011);
|
||||
vec4 Noise2 = texture3D(NoiseTex, WorldPos.xyz * 0.00008);
|
||||
float MixFactor = Noise.r * Noise.g * Noise.b; //Mixing Factor to create a more organic looking boundary
|
||||
float MixFactor2 = Noise2.r * Noise2.g * Noise2.b;
|
||||
MixFactor *= 300.0;
|
||||
MixFactor2 *= 300.0;
|
||||
MixFactor = clamp(MixFactor, 0.0, 1.0);
|
||||
MixFactor2 = clamp(MixFactor2, 0.0, 1.0);
|
||||
float L1 = 0.90 - 0.02 * MixFactor; //first transition slope
|
||||
float L2 = 0.78 + 0.04 * MixFactor; //Second transition slope
|
||||
|
||||
// If gl_Color.a == 0, this is a back-facing polygon and the
|
||||
// Vnormal should be reversed.
|
||||
// vec3 n = (2.0 * gl_Color.a - 1.0) * Vnormal;
|
||||
vec3 n = normalize(Vnormal);
|
||||
|
||||
float nDotVP = max(0.0, dot(n, normalize(gl_LightSource[0].position.xyz)));
|
||||
float nDotHV = max(0.0, dot(n, normalize(gl_LightSource[0].halfVector.xyz)));
|
||||
vec4 Diffuse = gl_LightSource[0].diffuse * nDotVP * getShadowing();
|
||||
|
||||
if (nDotVP > 0.0)
|
||||
pf = pow(nDotHV, gl_FrontMaterial.shininess);
|
||||
|
||||
if (gl_FrontMaterial.shininess > 0.0)
|
||||
specular = gl_FrontMaterial.specular * gl_LightSource[0].diffuse * pf;
|
||||
|
||||
// vec4 diffuseColor = gl_FrontMaterial.emission +
|
||||
// vec4(1.0) * (gl_LightModel.ambient + gl_LightSource[0].ambient) +
|
||||
// Diffuse * gl_FrontMaterial.diffuse;
|
||||
vec4 ambientColor = gl_LightModel.ambient + gl_LightSource[0].ambient;
|
||||
//vec4 diffuseColor = gl_Color + Diffuse * gl_FrontMaterial.diffuse + ambientColor;
|
||||
vec4 diffuseColor = vec4(Diffuse) + ambientColor; //ATI workaround
|
||||
diffuseColor += specular * gl_FrontMaterial.specular;
|
||||
|
||||
// This shouldn't be necessary, but our lighting becomes very
|
||||
// saturated. Clamping the color before modulating by the texture
|
||||
// is closer to what the OpenGL fixed function pipeline does.
|
||||
diffuseColor = clamp(diffuseColor, 0.0, 1.0);
|
||||
|
||||
|
||||
//Select texture based on slope
|
||||
float slope = normalize(normal).z;
|
||||
|
||||
//pull the texture fetch outside flow control to fix aliasing artefacts :(
|
||||
vec4 baseTexel = texture2D(BaseTex, gl_TexCoord[0].st);
|
||||
vec4 secondTexel = texture2D(SecondTex, gl_TexCoord[0].st);
|
||||
vec4 thirdTexel = texture2D(ThirdTex, gl_TexCoord[0].st);
|
||||
vec4 snowTexel = texture2D(SnowTex, gl_TexCoord[0].st);
|
||||
|
||||
//Normal transition. For more abrupt faces apply another texture (or 2).
|
||||
if (InverseSlope == 0.0) {
|
||||
//Do we do an intermediate transition
|
||||
if (Transitions >= 1.5) {
|
||||
if (slope >= L1) {
|
||||
texel = baseTexel;
|
||||
}
|
||||
if (slope >= L2 && slope < L1){
|
||||
texel = mix(secondTexel, baseTexel, smoothstep(L2, L1 - 0.06 * MixFactor, slope));
|
||||
}
|
||||
if (slope < L2){
|
||||
texel = mix(thirdTexel, secondTexel, smoothstep(L2 - 0.13 * MixFactor, L2, slope));
|
||||
}
|
||||
// Just one transition
|
||||
} else if (Transitions < 1.5) {
|
||||
if (slope >= L1) {
|
||||
texel = baseTexel;
|
||||
}
|
||||
if (slope < L1) {
|
||||
texel = mix(thirdTexel, baseTexel, smoothstep(L2 - 0.13 * MixFactor, L1, slope));
|
||||
}
|
||||
}
|
||||
|
||||
//Invert the transition: keep original texture on abrupt slopes and switch to another on flatter terrain
|
||||
} else if (InverseSlope > 0.0) {
|
||||
//Interemdiate transition ?
|
||||
if (Transitions >= 1.5) {
|
||||
if (slope >= L1 + 0.1) {
|
||||
texel = thirdTexel;
|
||||
}
|
||||
if (slope >= L2 && slope < L1 + 0.1){
|
||||
texel = mix(secondTexel, thirdTexel, smoothstep(L2 + 0.06 * MixFactor, L1 + 0.1, slope));
|
||||
}
|
||||
if (slope <= L2){
|
||||
texel = mix(baseTexel, secondTexel, smoothstep(L2 - 0.06 * MixFactor, L2, slope));
|
||||
}
|
||||
//just one
|
||||
} else if (Transitions < 1.5) {
|
||||
if (slope > L1 + 0.1) {
|
||||
texel = thirdTexel;
|
||||
}
|
||||
if (slope <= L1 + 0.1){
|
||||
texel = mix(baseTexel, thirdTexel, smoothstep(L2 - 0.06 * MixFactor, L1 + 0.1, slope));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//darken textures with wetness
|
||||
float wetness = 1.0 - 0.3 * RainNorm;
|
||||
texel.rgb = texel.rgb * wetness;
|
||||
|
||||
float altitude = RawPosZ;
|
||||
//Snow texture for areas higher than SnowLevel
|
||||
if (altitude >= SnowLevel - (1000.0 * slope + 300.0 * MixFactor) && slope > L2 - 0.12) {
|
||||
texel = mix(texel, mix(texel, snowTexel, smoothstep(L2 - 0.09 * MixFactor, L2, slope)),
|
||||
smoothstep(SnowLevel - (1000.0 * slope + 300.0 * MixFactor),
|
||||
SnowLevel - (1000.0 * slope - 150.0 * MixFactor),
|
||||
altitude)
|
||||
);
|
||||
}
|
||||
|
||||
vec4 fragColor = diffuseColor * texel + specular;
|
||||
fragColor.rgb += getClusteredLightsContribution(eyePos.xyz, n, texel.rgb);
|
||||
|
||||
if(cover >= 2.5){
|
||||
fragColor.rgb = fragColor.rgb * 1.2;
|
||||
} else {
|
||||
fragColor.rg = fragColor.rg * (0.6 + 0.2 * cover);
|
||||
fragColor.b = fragColor.b * (0.5 + 0.25 * cover);
|
||||
}
|
||||
|
||||
fragColor.rgb *= 1.2 - 0.6 * MixFactor * MixFactor2;
|
||||
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||
gl_FragColor = fragColor;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
// -*-C++-*-
|
||||
// -*-C++-*-
|
||||
// Texture switching based on face slope and snow level
|
||||
// based on earlier work by Frederic Bouvier, Tim Moore, and Yves Sablonier.
|
||||
// © Emilian Huminiuc 2011
|
||||
|
||||
|
||||
#version 120
|
||||
|
||||
varying float RawPosZ;
|
||||
varying vec3 WorldPos;
|
||||
varying vec4 eyePos;
|
||||
varying vec3 normal;
|
||||
varying vec3 Vnormal;
|
||||
|
||||
uniform mat4 osg_ViewMatrixInverse;
|
||||
|
||||
void setupShadows(vec4 eyeSpacePos);
|
||||
|
||||
void main()
|
||||
{
|
||||
RawPosZ = gl_Vertex.z;
|
||||
eyePos = gl_ModelViewMatrix * gl_Vertex;
|
||||
WorldPos = (osg_ViewMatrixInverse * eyePos).xyz;
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
normal = normalize(gl_Normal);
|
||||
Vnormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
setupShadows(eyePos);
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
#version 120
|
||||
uniform sampler2D baseTexture;
|
||||
|
||||
|
||||
void main(void)
|
||||
{
|
||||
vec4 base = texture2D( baseTexture, gl_TexCoord[0].st);
|
||||
if (base.a <= 0.01)
|
||||
discard;
|
||||
|
||||
gl_FragColor = vec4 (1.0, 1.0, 1.0, 1.0);
|
||||
}
|
|
@ -1,293 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// UBERSHADER - default forward rendering - fragment shader
|
||||
// Licence: GPL v2
|
||||
// Authors: Frederic Bouvier and Gijs de Rooy
|
||||
// with major additions and revisions by
|
||||
// Emilian Huminiuc and Vivian Meazza 2011
|
||||
#version 120
|
||||
|
||||
varying vec4 diffuseColor;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 rawpos;
|
||||
varying vec3 eyeVec;
|
||||
varying vec3 eyeDir;
|
||||
|
||||
uniform sampler2D BaseTex;
|
||||
uniform sampler2D LightMapTex;
|
||||
uniform sampler2D NormalTex;
|
||||
uniform sampler2D ReflGradientsTex;
|
||||
uniform sampler2D ReflMapTex;
|
||||
uniform sampler3D ReflNoiseTex;
|
||||
uniform samplerCube Environment;
|
||||
|
||||
uniform int dirt_enabled;
|
||||
uniform int dirt_multi;
|
||||
uniform int lightmap_enabled;
|
||||
uniform int lightmap_multi;
|
||||
uniform int nmap_dds;
|
||||
uniform int nmap_enabled;
|
||||
uniform int refl_enabled;
|
||||
uniform int refl_dynamic;
|
||||
uniform int refl_map;
|
||||
|
||||
uniform float amb_correction;
|
||||
uniform float dirt_b_factor;
|
||||
uniform float dirt_g_factor;
|
||||
uniform float dirt_r_factor;
|
||||
uniform float lightmap_a_factor;
|
||||
uniform float lightmap_b_factor;
|
||||
uniform float lightmap_g_factor;
|
||||
uniform float lightmap_r_factor;
|
||||
uniform float nmap_tile;
|
||||
uniform float refl_correction;
|
||||
uniform float refl_fresnel;
|
||||
uniform float refl_noise;
|
||||
uniform float refl_rainbow;
|
||||
|
||||
uniform vec3 lightmap_r_color;
|
||||
uniform vec3 lightmap_g_color;
|
||||
uniform vec3 lightmap_b_color;
|
||||
uniform vec3 lightmap_a_color;
|
||||
|
||||
uniform vec3 dirt_r_color;
|
||||
uniform vec3 dirt_g_color;
|
||||
uniform vec3 dirt_b_color;
|
||||
|
||||
///reflection orientation
|
||||
uniform mat4 osg_ViewMatrixInverse;
|
||||
uniform float latDeg;
|
||||
uniform float lonDeg;
|
||||
|
||||
///fog include//////////////////////
|
||||
uniform int fogType;
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
////////////////////////////////////
|
||||
|
||||
float getShadowing();
|
||||
vec3 getClusteredLightsContribution(vec3 p, vec3 n, vec3 texel);
|
||||
|
||||
|
||||
//////rotation matrices/////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
mat3 rotX(in float angle)
|
||||
{
|
||||
mat3 rotmat = mat3(
|
||||
1.0, 0.0, 0.0,
|
||||
0.0, cos(angle), -sin(angle),
|
||||
0.0, sin(angle), cos(angle)
|
||||
);
|
||||
return rotmat;
|
||||
}
|
||||
|
||||
mat3 rotY(in float angle)
|
||||
{
|
||||
mat3 rotmat = mat3(
|
||||
cos(angle), 0.0, sin(angle),
|
||||
0.0, 1.0, 0.0,
|
||||
-sin(angle), 0.0, cos(angle)
|
||||
);
|
||||
return rotmat;
|
||||
}
|
||||
|
||||
mat3 rotZ(in float angle)
|
||||
{
|
||||
mat3 rotmat = mat3(
|
||||
cos(angle), -sin(angle), 0.0,
|
||||
sin(angle), cos(angle), 0.0,
|
||||
0.0, 0.0, 1.0
|
||||
);
|
||||
return rotmat;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec4 texel = texture2D(BaseTex, gl_TexCoord[0].st);
|
||||
vec4 nmap = texture2D(NormalTex, gl_TexCoord[0].st * nmap_tile);
|
||||
vec4 reflmap = texture2D(ReflMapTex, gl_TexCoord[0].st);
|
||||
vec4 noisevec = texture3D(ReflNoiseTex, rawpos.xyz);
|
||||
vec4 lightmapTexel = texture2D(LightMapTex, gl_TexCoord[0].st);
|
||||
|
||||
vec3 mixedcolor;
|
||||
vec3 N = vec3(0.0,0.0,1.0);
|
||||
float pf = 0.0;
|
||||
|
||||
///BEGIN bump //////////////////////////////////////////////////////////////////
|
||||
if (nmap_enabled > 0 ){
|
||||
N = nmap.rgb * 2.0 - 1.0;
|
||||
N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
|
||||
if (nmap_dds > 0)
|
||||
N = -N;
|
||||
} else {
|
||||
N = normalize(VNormal);
|
||||
}
|
||||
///END bump ////////////////////////////////////////////////////////////////////
|
||||
vec3 viewN = normalize((gl_ModelViewMatrixTranspose * vec4(N,0.0)).xyz);
|
||||
vec3 viewVec = normalize(eyeVec);
|
||||
float v = abs(dot(viewVec, viewN));// Map a rainbowish color
|
||||
vec4 fresnel = texture2D(ReflGradientsTex, vec2(v, 0.75));
|
||||
vec4 rainbow = texture2D(ReflGradientsTex, vec2(v, 0.25));
|
||||
|
||||
mat4 reflMatrix = gl_ModelViewMatrixInverse;
|
||||
vec3 wRefVec = reflect(viewVec,N);
|
||||
|
||||
////dynamic reflection /////////////////////////////
|
||||
if (refl_dynamic > 0){
|
||||
reflMatrix = osg_ViewMatrixInverse;
|
||||
|
||||
vec3 wVertVec = normalize(reflMatrix * vec4(viewVec,0.0)).xyz;
|
||||
vec3 wNormal = normalize(reflMatrix * vec4(N,0.0)).xyz;
|
||||
|
||||
float latRad = radians(90.-latDeg);
|
||||
float lonRad = radians(lonDeg);
|
||||
|
||||
mat3 rotCorrY = rotY(latRad);
|
||||
mat3 rotCorrZ = rotZ(lonRad);
|
||||
mat3 reflCorr = rotCorrY * rotCorrZ;
|
||||
wRefVec = reflect(wVertVec,wNormal);
|
||||
wRefVec = normalize(reflCorr * wRefVec);
|
||||
} else { ///static reflection
|
||||
wRefVec = normalize(reflMatrix * vec4(wRefVec,0.0)).xyz;
|
||||
}
|
||||
|
||||
vec3 reflection = textureCube(Environment, wRefVec).xyz;
|
||||
|
||||
vec3 E = eyeDir;
|
||||
E = normalize(E);
|
||||
|
||||
vec3 L = normalize((gl_ModelViewMatrixInverse * gl_LightSource[0].position).xyz);
|
||||
vec3 H = normalize(L + E);
|
||||
|
||||
N = viewN;
|
||||
|
||||
float nDotVP = dot(N,L);
|
||||
float nDotHV = dot(N,H);
|
||||
float eDotLV = max(0.0, dot(-E,L));
|
||||
|
||||
//glare on the backside of tranparent objects
|
||||
if ((gl_Color.a < .999 || texel.a < 1.0) && nDotVP < 0.0) {
|
||||
nDotVP = dot(-N, L);
|
||||
nDotHV = dot(-N, H);
|
||||
}
|
||||
|
||||
nDotVP = max(0.0, nDotVP);
|
||||
nDotHV = max(0.0, nDotHV);
|
||||
|
||||
if (nDotVP == 0.0)
|
||||
pf = 0.0;
|
||||
else
|
||||
pf = pow(nDotHV, gl_FrontMaterial.shininess);
|
||||
|
||||
float shadowmap = getShadowing();
|
||||
vec4 Diffuse = gl_LightSource[0].diffuse * nDotVP * shadowmap;
|
||||
vec4 Specular = gl_FrontMaterial.specular * gl_LightSource[0].diffuse * pf * shadowmap;
|
||||
|
||||
vec4 color = gl_Color + Diffuse*diffuseColor;
|
||||
color = clamp( color, 0.0, 1.0 );
|
||||
color.a = texel.a * diffuseColor.a;
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//BEGIN reflect
|
||||
////////////////////////////////////////////////////////////////////
|
||||
if (refl_enabled > 0 ){
|
||||
float reflFactor = 0.0;
|
||||
float transparency_offset = clamp(refl_correction, -1.0, 1.0);// set the user shininess offset
|
||||
|
||||
if(refl_map > 0){
|
||||
// map the shininess of the object with user input
|
||||
reflFactor = reflmap.a + transparency_offset;
|
||||
} else if (nmap_enabled > 0) {
|
||||
// set the reflectivity proportional to shininess with user input
|
||||
reflFactor = gl_FrontMaterial.shininess * 0.0078125 * nmap.a + transparency_offset;
|
||||
} else {
|
||||
reflFactor = gl_FrontMaterial.shininess* 0.0078125 + transparency_offset;
|
||||
}
|
||||
reflFactor = clamp(reflFactor, 0.0, 1.0);
|
||||
|
||||
// add fringing fresnel and rainbow effects and modulate by reflection
|
||||
vec3 reflcolor = mix(reflection, rainbow.rgb, refl_rainbow * v);
|
||||
vec3 reflfrescolor = mix(reflcolor, fresnel.rgb, refl_fresnel * v);
|
||||
vec3 noisecolor = mix(reflfrescolor, noisevec.rgb, refl_noise);
|
||||
vec3 raincolor = noisecolor * reflFactor;
|
||||
raincolor += Specular.rgb;
|
||||
raincolor *= gl_LightSource[0].diffuse.rgb;
|
||||
mixedcolor = mix(texel.rgb, raincolor, reflFactor);
|
||||
} else {
|
||||
mixedcolor = texel.rgb;
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
//END reflect
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
if (color.a<1.0){
|
||||
color.a += .1 * eDotLV;
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//begin DIRT
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
if (dirt_enabled >= 1){
|
||||
vec3 dirtFactorIn = vec3 (dirt_r_factor, dirt_g_factor, dirt_b_factor);
|
||||
vec3 dirtFactor = reflmap.rgb * dirtFactorIn.rgb;
|
||||
mixedcolor.rgb = mix(mixedcolor.rgb, dirt_r_color, smoothstep(0.0, 1.0, dirtFactor.r));
|
||||
if (color.a < 1.0) {
|
||||
color.a += dirtFactor.r * eDotLV;
|
||||
}
|
||||
if (dirt_multi > 0) {
|
||||
mixedcolor.rgb = mix(mixedcolor.rgb, dirt_g_color, smoothstep(0.0, 1.0, dirtFactor.g));
|
||||
mixedcolor.rgb = mix(mixedcolor.rgb, dirt_b_color, smoothstep(0.0, 1.0, dirtFactor.b));
|
||||
if (color.a < 1.0) {
|
||||
color.a += dirtFactor.g * eDotLV;
|
||||
color.a += dirtFactor.b * eDotLV;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
//END Dirt
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// set ambient adjustment to remove bluiness with user input
|
||||
float ambient_offset = clamp(amb_correction, -1.0, 1.0);
|
||||
vec4 ambient = gl_LightModel.ambient + gl_LightSource[0].ambient;
|
||||
|
||||
vec3 ambient_Correction = vec3(ambient.rg, ambient.b * 0.6);
|
||||
|
||||
ambient_Correction *= ambient_offset;
|
||||
ambient_Correction = clamp(ambient_Correction, -1.0, 1.0);
|
||||
|
||||
vec4 fragColor = vec4(color.rgb * mixedcolor + ambient_Correction.rgb, color.a);
|
||||
|
||||
fragColor += Specular * nmap.a;
|
||||
|
||||
fragColor.rgb += getClusteredLightsContribution(eyeVec, N, texel.rgb);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// BEGIN lightmap
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
if ( lightmap_enabled >= 1 ) {
|
||||
vec3 lightmapcolor = vec3(0.0);
|
||||
vec4 lightmapFactor = vec4(lightmap_r_factor, lightmap_g_factor,
|
||||
lightmap_b_factor, lightmap_a_factor);
|
||||
lightmapFactor = lightmapFactor * lightmapTexel;
|
||||
if (lightmap_multi > 0 ){
|
||||
lightmapcolor = lightmap_r_color * lightmapFactor.r +
|
||||
lightmap_g_color * lightmapFactor.g +
|
||||
lightmap_b_color * lightmapFactor.b +
|
||||
lightmap_a_color * lightmapFactor.a ;
|
||||
} else {
|
||||
lightmapcolor = lightmapTexel.rgb * lightmap_r_color * lightmapFactor.r;
|
||||
}
|
||||
fragColor.rgb = max(fragColor.rgb, lightmapcolor * smoothstep(0.0, 1.0, mixedcolor*.5 + lightmapcolor*.5));
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// END lightmap
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
fragColor.rgb = fog_Func(fragColor.rgb, fogType);
|
||||
|
||||
gl_FragColor = fragColor;
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// UBERSHADER - vertex shader
|
||||
// Licence: GPL v2
|
||||
// © Emilian Huminiuc and Vivian Meazza 2011
|
||||
#version 120
|
||||
|
||||
varying vec4 diffuseColor;
|
||||
varying vec3 VBinormal;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 rawpos;
|
||||
varying vec3 eyeVec;
|
||||
varying vec3 eyeDir;
|
||||
|
||||
attribute vec3 tangent;
|
||||
attribute vec3 binormal;
|
||||
|
||||
uniform int nmap_enabled;
|
||||
|
||||
void setupShadows(vec4 eyeSpacePos);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
rawpos = gl_Vertex.xyz;
|
||||
vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
eyeVec = ecPosition.xyz;
|
||||
eyeDir = gl_ModelViewMatrixInverse[3].xyz - gl_Vertex.xyz;
|
||||
|
||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
|
||||
vec3 n = normalize(gl_Normal);
|
||||
|
||||
// generate "fake" binormals/tangents
|
||||
vec3 c1 = cross(n, vec3(0.0,0.0,1.0));
|
||||
vec3 c2 = cross(n, vec3(0.0,1.0,0.0));
|
||||
vec3 tempTangent = c1;
|
||||
|
||||
if(length(c2)>length(c1)){
|
||||
tempTangent = c2;
|
||||
}
|
||||
|
||||
vec3 tempBinormal = cross(n, tempTangent);
|
||||
|
||||
if (nmap_enabled > 0){
|
||||
tempTangent = tangent;
|
||||
tempBinormal = binormal;
|
||||
}
|
||||
|
||||
VTangent = normalize(gl_NormalMatrix * tempTangent);
|
||||
VBinormal = normalize(gl_NormalMatrix * tempBinormal);
|
||||
|
||||
diffuseColor = gl_Color;
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
if (gl_FrontMaterial.diffuse.a < 1.0)
|
||||
diffuseColor.a = gl_FrontMaterial.diffuse.a;
|
||||
|
||||
gl_FrontColor = gl_FrontMaterial.emission + gl_Color
|
||||
* (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
|
||||
gl_Position = ftransform();
|
||||
gl_ClipVertex = ecPosition;
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
|
||||
setupShadows(ecPosition);
|
||||
}
|
|
@ -1,612 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// Author: Frederic Bouvier.
|
||||
// Adapted from the paper by F. Policarpo et al. : Real-time Relief Mapping on Arbitrary Polygonal Surfaces
|
||||
// Adapted from the paper and sources by M. Drobot in GPU Pro : Quadtree Displacement Mapping with Height Blending
|
||||
|
||||
#version 120
|
||||
|
||||
#extension GL_ATI_shader_texture_lod : enable
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
|
||||
#define TEXTURE_MIP_LEVELS 10
|
||||
#define TEXTURE_PIX_COUNT 1024 //pow(2,TEXTURE_MIP_LEVELS)
|
||||
#define BINARY_SEARCH_COUNT 10
|
||||
#define BILINEAR_SMOOTH_FACTOR 2.0
|
||||
|
||||
varying vec3 worldPos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec4 constantColor;
|
||||
varying vec3 light_diffuse;
|
||||
varying vec3 relPos;
|
||||
|
||||
varying float yprime_alt;
|
||||
varying float mie_angle;
|
||||
varying float steepness;
|
||||
|
||||
uniform sampler2D BaseTex;
|
||||
uniform sampler2D NormalTex;
|
||||
uniform sampler2D QDMTex;
|
||||
uniform sampler2D BackgroundTex;
|
||||
uniform sampler2D OverlayTex;
|
||||
uniform sampler2D GradientTex;
|
||||
uniform float depth_factor;
|
||||
uniform float tile_size;
|
||||
uniform float quality_level;
|
||||
uniform float visibility;
|
||||
uniform float avisibility;
|
||||
uniform float scattering;
|
||||
uniform float terminator;
|
||||
uniform float terrain_alt;
|
||||
uniform float hazeLayerAltitude;
|
||||
uniform float overcast;
|
||||
uniform float eye_alt;
|
||||
uniform float mysnowlevel;
|
||||
uniform float dust_cover_factor;
|
||||
uniform float wetness;
|
||||
uniform float fogstructure;
|
||||
uniform float cloud_self_shading;
|
||||
uniform float air_pollution;
|
||||
uniform float blend_bias;
|
||||
uniform float urban_domain_size;
|
||||
uniform float urban_domain_fraction;
|
||||
uniform float landing_light1_offset;
|
||||
uniform float landing_light2_offset;
|
||||
uniform float landing_light3_offset;
|
||||
|
||||
uniform vec3 night_color;
|
||||
|
||||
uniform bool random_buildings;
|
||||
uniform bool osm_buildings;
|
||||
|
||||
uniform int cloud_shadow_flag;
|
||||
uniform int use_searchlight;
|
||||
uniform int use_landing_light;
|
||||
uniform int use_alt_landing_light;
|
||||
uniform int gquality_level;
|
||||
uniform int tquality_level;
|
||||
uniform int urban_blend;
|
||||
uniform int urban_domains;
|
||||
|
||||
const float scale = 1.0;
|
||||
int linear_search_steps = 10;
|
||||
int GlobalIterationCount = 0;
|
||||
int gIterationCap = 64;
|
||||
|
||||
const float EarthRadius = 5800000.0;
|
||||
const float terminator_width = 200000.0;
|
||||
|
||||
float alt;
|
||||
float eShade;
|
||||
|
||||
float shadow_func (in float x, in float y, in float noise, in float dist);
|
||||
float Noise2D(in vec2 coord, in float wavelength);
|
||||
float Noise3D(in vec3 coord, in float wavelength);
|
||||
float VoronoiNoise2D(in vec2 coord, in float wavelength, in float xrand, in float yrand);
|
||||
float fog_func (in float targ, in float alt);
|
||||
float rayleigh_in_func(in float dist, in float air_pollution, in float avisibility, in float eye_alt, in float vertex_alt);
|
||||
float alt_factor(in float eye_alt, in float vertex_alt);
|
||||
float light_distance_fading(in float dist);
|
||||
float fog_backscatter(in float avisibility);
|
||||
|
||||
|
||||
|
||||
vec3 rayleigh_out_shift(in vec3 color, in float outscatter);
|
||||
vec3 get_hazeColor(in float light_arg);
|
||||
vec3 searchlight();
|
||||
vec3 landing_light(in float offset, in float offsetv);
|
||||
vec3 filter_combined (in vec3 color) ;
|
||||
|
||||
float getShadowing();
|
||||
|
||||
void QDM(inout vec3 p, inout vec3 v)
|
||||
{
|
||||
const int MAX_LEVEL = TEXTURE_MIP_LEVELS;
|
||||
const float NODE_COUNT = TEXTURE_PIX_COUNT;
|
||||
const float TEXEL_SPAN_HALF = 1.0 / NODE_COUNT / 2.0;
|
||||
|
||||
float fDeltaNC = TEXEL_SPAN_HALF * depth_factor;
|
||||
|
||||
vec3 p2 = p;
|
||||
float level = MAX_LEVEL;
|
||||
vec2 dirSign = (sign(v.xy) + 1.0) * 0.5;
|
||||
GlobalIterationCount = 0;
|
||||
float d = 0.0;
|
||||
|
||||
while (level >= 0.0 && GlobalIterationCount < gIterationCap)
|
||||
{
|
||||
vec4 uv = vec4(p2.xyz, level);
|
||||
d = texture2DLod(QDMTex, uv.xy, uv.w).w;
|
||||
|
||||
if (d > p2.z)
|
||||
{
|
||||
//predictive point of ray traversal
|
||||
vec3 tmpP2 = p + v * d;
|
||||
|
||||
//current node count
|
||||
float nodeCount = pow(2.0, (MAX_LEVEL - level));
|
||||
//current and predictive node ID
|
||||
vec4 nodeID = floor(vec4(p2.xy, tmpP2.xy)*nodeCount);
|
||||
|
||||
//check if we are crossing the current cell
|
||||
if (nodeID.x != nodeID.z || nodeID.y != nodeID.w)
|
||||
{
|
||||
//calculate distance to nearest bound
|
||||
vec2 a = p2.xy - p.xy;
|
||||
vec2 p3 = (nodeID.xy + dirSign) / nodeCount;
|
||||
vec2 b = p3.xy - p.xy;
|
||||
|
||||
vec2 dNC = (b.xy * p2.z) / a.xy;
|
||||
//take the nearest cell
|
||||
d = min(d,min(dNC.x, dNC.y))+fDeltaNC;
|
||||
|
||||
level++;
|
||||
}
|
||||
p2 = p + v * d;
|
||||
}
|
||||
level--;
|
||||
GlobalIterationCount++;
|
||||
}
|
||||
|
||||
//
|
||||
// Manual Bilinear filtering
|
||||
//
|
||||
float rayLength = length(p2.xy - p.xy) + fDeltaNC;
|
||||
|
||||
float dA = p2.z * (rayLength - BILINEAR_SMOOTH_FACTOR * TEXEL_SPAN_HALF) / rayLength;
|
||||
float dB = p2.z * (rayLength + BILINEAR_SMOOTH_FACTOR * TEXEL_SPAN_HALF) / rayLength;
|
||||
|
||||
vec4 p2a = vec4(p + v * dA, 0.0);
|
||||
vec4 p2b = vec4(p + v * dB, 0.0);
|
||||
dA = texture2DLod(NormalTex, p2a.xy, p2a.w).w;
|
||||
dB = texture2DLod(NormalTex, p2b.xy, p2b.w).w;
|
||||
|
||||
dA = abs(p2a.z - dA);
|
||||
dB = abs(p2b.z - dB);
|
||||
|
||||
p2 = mix(p2a.xyz, p2b.xyz, dA / (dA + dB));
|
||||
|
||||
p = p2;
|
||||
}
|
||||
|
||||
float ray_intersect_QDM(vec2 dp, vec2 ds)
|
||||
{
|
||||
vec3 p = vec3( dp, 0.0 );
|
||||
vec3 v = vec3( ds, 1.0 );
|
||||
QDM( p, v );
|
||||
return p.z;
|
||||
}
|
||||
|
||||
float ray_intersect_relief(vec2 dp, vec2 ds)
|
||||
{
|
||||
float size = 1.0 / float(linear_search_steps);
|
||||
float depth = 0.0;
|
||||
float best_depth = 1.0;
|
||||
|
||||
for(int i = 0; i < linear_search_steps - 1; ++i)
|
||||
{
|
||||
depth += size;
|
||||
float t = step(0.95, texture2D(NormalTex, dp + ds * depth).a);
|
||||
if(best_depth > 0.996)
|
||||
if(depth >= t)
|
||||
best_depth = depth;
|
||||
}
|
||||
depth = best_depth;
|
||||
|
||||
const int binary_search_steps = 5;
|
||||
|
||||
for(int i = 0; i < binary_search_steps; ++i)
|
||||
{
|
||||
size *= 0.5;
|
||||
float t = step(0.95, texture2D(NormalTex, dp + ds * depth).a);
|
||||
if(depth >= t)
|
||||
{
|
||||
best_depth = depth;
|
||||
depth -= 2.0 * size;
|
||||
}
|
||||
depth += size;
|
||||
}
|
||||
|
||||
return(best_depth);
|
||||
}
|
||||
|
||||
float ray_intersect(vec2 dp, vec2 ds)
|
||||
{
|
||||
if (( random_buildings ) || ( osm_buildings ))
|
||||
return 0.0;
|
||||
else if ( quality_level >= 4.0 )
|
||||
return ray_intersect_QDM( dp, ds );
|
||||
else
|
||||
return ray_intersect_relief( dp, ds );
|
||||
}
|
||||
|
||||
void main (void)
|
||||
{
|
||||
if ( quality_level >= 3.0 ) {
|
||||
linear_search_steps = 20;
|
||||
}
|
||||
|
||||
float depthfactor = depth_factor;
|
||||
if (( random_buildings ) || (osm_buildings))
|
||||
depthfactor = 0.0;
|
||||
|
||||
float steepness_factor = 1.0 -smoothstep(0.85, 0.9, steepness);
|
||||
|
||||
vec3 shadedFogColor = vec3(0.55, 0.67, 0.88);
|
||||
float effective_scattering = min(scattering, cloud_self_shading);
|
||||
vec3 normal = normalize(VNormal);
|
||||
vec3 tangent = normalize(VTangent);
|
||||
vec3 binormal = normalize(cross(normal, tangent));
|
||||
vec3 ecPos3 = ecPosition.xyz / ecPosition.w;
|
||||
vec3 V = normalize(ecPos3);
|
||||
vec3 s = vec3(dot(V, tangent), dot(V, binormal), dot(normal, -V));
|
||||
vec2 ds = s.xy * depthfactor / s.z;
|
||||
vec2 dp = gl_TexCoord[0].st - ds;
|
||||
float d = ray_intersect(dp, ds);
|
||||
|
||||
vec2 uv = dp + ds * d * (1.0-steepness_factor);
|
||||
|
||||
vec2 samplePos = (relPos + (gl_ModelViewMatrixInverse * vec4(0.0,0.0,0.0,1.0)).xyz).xy;
|
||||
|
||||
float vnoise = 0;
|
||||
|
||||
if (urban_domains == 1)
|
||||
{
|
||||
vnoise = VoronoiNoise2D(samplePos, urban_domain_size, 1.5, 1.5);
|
||||
float dir = 2.0 * 3.1415 * vnoise;
|
||||
|
||||
mat2 rotMat = mat2 (cos(dir), sin(dir), -sin(dir), cos(dir));
|
||||
uv = rotMat * uv;
|
||||
}
|
||||
|
||||
vec3 N = texture2D(NormalTex, uv).xyz * 2.0 - 1.0;
|
||||
|
||||
|
||||
|
||||
float emis = N.z;
|
||||
N.z = sqrt(1.0 - min(1.0,dot(N.xy, N.xy)));
|
||||
float Nz = N.z;
|
||||
N = normalize(N.x * tangent + N.y * binormal + N.z * normal);
|
||||
|
||||
N = mix(N, normal, steepness_factor);
|
||||
if ((vnoise > urban_domain_fraction) && (urban_blend == 1)) {N = mix(N,normal, 0.8);}
|
||||
|
||||
|
||||
vec3 l = gl_LightSource[0].position.xyz;
|
||||
vec3 diffuse = gl_Color.rgb * max(0.0, dot(N, l));
|
||||
|
||||
float dist = length(relPos);
|
||||
if (cloud_shadow_flag == 1)
|
||||
{diffuse = diffuse * shadow_func(relPos.x, relPos.y, 1.0, dist);}
|
||||
|
||||
diffuse *= getShadowing();
|
||||
|
||||
|
||||
float shadow_factor = 1.0;
|
||||
|
||||
// Shadow
|
||||
if ( quality_level >= 2.0 ) {
|
||||
dp += ds * d;
|
||||
vec3 sl = normalize( vec3( dot( l, tangent ), dot( l, binormal ), dot( -l, normal ) ) );
|
||||
ds = sl.xy * depthfactor / sl.z;
|
||||
dp -= ds * d;
|
||||
float dl = ray_intersect(dp, ds);
|
||||
if ( dl < d - 0.05 )
|
||||
shadow_factor = dot( constantColor.xyz, vec3( 1.0, 1.0, 1.0 ) ) * 0.25;
|
||||
|
||||
shadow_factor = mix(shadow_factor, 1.0, steepness_factor);
|
||||
|
||||
if (vnoise > urban_domain_fraction) {shadow_factor = 0.5 * (1.0 +shadow_factor);}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// end shadow
|
||||
|
||||
vec4 ambient_light = constantColor + vec4 (light_diffuse,1.0) * vec4(diffuse, 1.0);
|
||||
float reflectance = ambient_light.r * 0.3 + ambient_light.g * 0.59 + ambient_light.b * 0.11;
|
||||
if ( shadow_factor < 1.0 )
|
||||
ambient_light = constantColor + vec4(light_diffuse,1.0) * shadow_factor * vec4(diffuse, 1.0);
|
||||
float emission_factor = (1.0 - smoothstep(0.15, 0.25, reflectance)) * emis;
|
||||
vec4 tc = texture2D(BaseTex, uv);
|
||||
emission_factor *= 0.5*pow(tc.r+0.8*tc.g+0.2*tc.b, 2.0) -0.2;
|
||||
ambient_light += (emission_factor * vec4(night_color, 0.0));
|
||||
|
||||
|
||||
|
||||
vec4 baseTexel = texture2D(BaseTex, uv);
|
||||
|
||||
vec4 finalColor = baseTexel;
|
||||
|
||||
// blending effect
|
||||
|
||||
if (urban_blend == 1)
|
||||
{
|
||||
vec4 backgroundTexel = texture2D(BackgroundTex, uv);
|
||||
float vbias = 0.0;
|
||||
if (vnoise > urban_domain_fraction) {vbias = 0.5 + 0.5 * vnoise;}
|
||||
|
||||
finalColor.rgb = mix(backgroundTexel.rgb, baseTexel.rgb, clamp(baseTexel.a - blend_bias - vbias, 0.0, 1.0));
|
||||
}
|
||||
|
||||
// steepness
|
||||
|
||||
vec4 gradientTexel = texture2D(GradientTex, uv);
|
||||
|
||||
if (gradientTexel.a > 0.0)
|
||||
{
|
||||
finalColor.rgb = mix(finalColor.rgb, gradientTexel.rgb, steepness_factor);
|
||||
}
|
||||
|
||||
// texel postprocessing by shader effects
|
||||
|
||||
|
||||
// dust effect
|
||||
|
||||
vec4 dust_color;
|
||||
|
||||
|
||||
float noise_1500m = Noise3D(worldPos.xyz,1500.0);
|
||||
float noise_2000m = Noise3D(worldPos.xyz,2000.0);
|
||||
|
||||
if (gquality_level > 2)
|
||||
{
|
||||
// mix dust
|
||||
dust_color = vec4 (0.76, 0.71, 0.56, 1.0);
|
||||
|
||||
finalColor = mix(finalColor, dust_color, clamp(0.5 * dust_cover_factor + 3.0 * dust_cover_factor * (((noise_1500m - 0.5) * 0.125)+0.125 ),0.0, 1.0) );
|
||||
}
|
||||
|
||||
|
||||
// darken wet terrain
|
||||
|
||||
finalColor.rgb = finalColor.rgb * (1.0 - 0.6 * wetness);
|
||||
|
||||
vec3 secondary_light = vec3 (0.0,0.0,0.0);
|
||||
|
||||
if (use_searchlight == 1)
|
||||
{
|
||||
secondary_light += searchlight();
|
||||
}
|
||||
if (use_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light1_offset, landing_light3_offset);
|
||||
}
|
||||
if (use_alt_landing_light == 1)
|
||||
{
|
||||
secondary_light += landing_light(landing_light2_offset, landing_light3_offset);
|
||||
}
|
||||
ambient_light = clamp(ambient_light,0.0,1.0);
|
||||
ambient_light.rgb +=secondary_light * light_distance_fading(dist);
|
||||
|
||||
|
||||
|
||||
finalColor *= ambient_light;
|
||||
|
||||
vec4 p = vec4( ecPos3 + tile_size * V * (d-1.0) * depthfactor / s.z, 1.0 );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
float lightArg = (terminator-yprime_alt)/100000.0;
|
||||
|
||||
vec3 hazeColor = get_hazeColor(lightArg);
|
||||
|
||||
|
||||
|
||||
// Rayleigh color shifts
|
||||
|
||||
if ((gquality_level > 5) && (tquality_level > 5))
|
||||
{
|
||||
float rayleigh_length = 0.5 * avisibility * (2.5 - 1.9 * air_pollution)/alt_factor(eye_alt, eye_alt+relPos.z);
|
||||
float outscatter = 1.0-exp(-dist/rayleigh_length);
|
||||
finalColor.rgb = rayleigh_out_shift(finalColor.rgb,outscatter);
|
||||
// Rayleigh color shift due to in-scattering
|
||||
float rShade = 1.0 - 0.9 * smoothstep(-terminator_width+ terminator, terminator_width + terminator, yprime_alt + 420000.0);
|
||||
float lightIntensity = length(hazeColor * effective_scattering) * rShade;
|
||||
vec3 rayleighColor = vec3 (0.17, 0.52, 0.87) * lightIntensity;
|
||||
float rayleighStrength = rayleigh_in_func(dist, air_pollution, avisibility/max(lightIntensity,0.05), eye_alt, eye_alt + relPos.z);
|
||||
finalColor.rgb = mix(finalColor.rgb, rayleighColor,rayleighStrength);
|
||||
}
|
||||
|
||||
// here comes the terrain haze model
|
||||
|
||||
|
||||
float delta_z = hazeLayerAltitude - eye_alt;
|
||||
|
||||
float mvisibility = min(visibility,avisibility);
|
||||
|
||||
if (dist > 0.04 * mvisibility)
|
||||
{
|
||||
|
||||
alt = eye_alt;
|
||||
|
||||
|
||||
float transmission;
|
||||
float vAltitude;
|
||||
float delta_zv;
|
||||
float H;
|
||||
float distance_in_layer;
|
||||
float transmission_arg;
|
||||
float intensity;
|
||||
vec3 lightDir = gl_LightSource[0].position.xyz;
|
||||
|
||||
// angle with horizon
|
||||
float ct = dot(vec3(0.0, 0.0, 1.0), relPos)/dist;
|
||||
|
||||
|
||||
// we solve the geometry what part of the light path is attenuated normally and what is through the haze layer
|
||||
|
||||
if (delta_z > 0.0) // we're inside the layer
|
||||
{
|
||||
if (ct < 0.0) // we look down
|
||||
{
|
||||
distance_in_layer = dist;
|
||||
vAltitude = min(distance_in_layer,mvisibility) * ct;
|
||||
delta_zv = delta_z - vAltitude;
|
||||
}
|
||||
else // we may look through upper layer edge
|
||||
{
|
||||
H = dist * ct;
|
||||
if (H > delta_z) {distance_in_layer = dist/H * delta_z;}
|
||||
else {distance_in_layer = dist;}
|
||||
vAltitude = min(distance_in_layer,visibility) * ct;
|
||||
delta_zv = delta_z - vAltitude;
|
||||
}
|
||||
}
|
||||
else // we see the layer from above, delta_z < 0.0
|
||||
{
|
||||
H = dist * -ct;
|
||||
if (H < (-delta_z)) // we don't see into the layer at all, aloft visibility is the only fading
|
||||
{
|
||||
distance_in_layer = 0.0;
|
||||
delta_zv = 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
vAltitude = H + delta_z;
|
||||
distance_in_layer = vAltitude/H * dist;
|
||||
vAltitude = min(distance_in_layer,visibility) * (-ct);
|
||||
delta_zv = vAltitude;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ground haze cannot be thinner than aloft visibility in the model,
|
||||
// so we need to use aloft visibility otherwise
|
||||
|
||||
|
||||
transmission_arg = (dist-distance_in_layer)/avisibility;
|
||||
|
||||
|
||||
float eqColorFactor;
|
||||
|
||||
|
||||
|
||||
if (visibility < avisibility)
|
||||
{
|
||||
if (gquality_level > 3)
|
||||
{
|
||||
transmission_arg = transmission_arg + (distance_in_layer/(1.0 * visibility + 1.0 * visibility * fogstructure * 0.06 * (noise_1500m + noise_2000m -1.0) ));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
transmission_arg = transmission_arg + (distance_in_layer/visibility);
|
||||
}
|
||||
// this combines the Weber-Fechner intensity
|
||||
eqColorFactor = 1.0 - 0.1 * delta_zv/visibility - (1.0 - effective_scattering);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gquality_level > 3)
|
||||
{
|
||||
transmission_arg = transmission_arg + (distance_in_layer/(1.0 * avisibility + 1.0 * avisibility * fogstructure * 0.06 * (noise_1500m + noise_2000m - 1.0) ));
|
||||
}
|
||||
else
|
||||
{
|
||||
transmission_arg = transmission_arg + (distance_in_layer/avisibility);
|
||||
}
|
||||
// this combines the Weber-Fechner intensity
|
||||
eqColorFactor = 1.0 - 0.1 * delta_zv/avisibility - (1.0 - effective_scattering);
|
||||
}
|
||||
|
||||
|
||||
|
||||
transmission = fog_func(transmission_arg, alt);
|
||||
|
||||
// there's always residual intensity, we should never be driven to zero
|
||||
if (eqColorFactor < 0.2) eqColorFactor = 0.2;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// now dim the light for haze
|
||||
eShade = 1.0 - 0.9 * smoothstep(-terminator_width+ terminator, terminator_width + terminator, yprime_alt);
|
||||
|
||||
// Mie-like factor
|
||||
|
||||
if (lightArg < 10.0)
|
||||
{
|
||||
intensity = length(hazeColor);
|
||||
float mie_magnitude = 0.5 * smoothstep(350000.0, 150000.0, terminator-sqrt(2.0 * EarthRadius * terrain_alt));
|
||||
hazeColor = intensity * ((1.0 - mie_magnitude) + mie_magnitude * mie_angle) * normalize(mix(hazeColor, vec3 (0.5, 0.58, 0.65), mie_magnitude * (0.5 - 0.5 * mie_angle)) );
|
||||
}
|
||||
|
||||
|
||||
intensity = length(hazeColor);
|
||||
|
||||
if (intensity > 0.0) // this needs to be a condition, because otherwise hazeColor doesn't come out correctly
|
||||
{
|
||||
// Mie-like factor
|
||||
|
||||
if (lightArg < 10.0)
|
||||
{
|
||||
float mie_magnitude = 0.5 * smoothstep(350000.0, 150000.0, terminator-sqrt(2.0 * EarthRadius * terrain_alt));
|
||||
hazeColor = intensity * ((1.0 - mie_magnitude) + mie_magnitude * mie_angle) * normalize(mix(hazeColor, vec3 (0.5, 0.58, 0.65), mie_magnitude * (0.5 - 0.5 * mie_angle)) );
|
||||
}
|
||||
|
||||
// high altitude desaturation of the haze color
|
||||
hazeColor = intensity * normalize (mix(hazeColor, intensity * vec3 (1.0,1.0,1.0), 0.7* smoothstep(5000.0, 50000.0, alt)));
|
||||
|
||||
// blue hue of haze
|
||||
|
||||
hazeColor.x = hazeColor.x * 0.83;
|
||||
hazeColor.y = hazeColor.y * 0.9;
|
||||
|
||||
|
||||
// additional blue in indirect light
|
||||
float fade_out = max(0.65 - 0.3 *overcast, 0.45);
|
||||
intensity = length(hazeColor);
|
||||
hazeColor = intensity * normalize(mix(hazeColor, 1.5* shadedFogColor, 1.0 -smoothstep(0.25, fade_out,eShade) ));
|
||||
|
||||
// change haze color to blue hue for strong fogging
|
||||
hazeColor = intensity * normalize(mix(hazeColor, shadedFogColor, (1.0-smoothstep(0.5,0.9,eqColorFactor))));
|
||||
|
||||
|
||||
// reduce haze intensity when looking at shaded surfaces, only in terminator region
|
||||
|
||||
float shadow = mix( min(1.0 + dot(VNormal,lightDir),1.0), 1.0, 1.0-smoothstep(0.1, 0.4, transmission));
|
||||
hazeColor = mix(shadow * hazeColor, hazeColor, 0.3 + 0.7* smoothstep(250000.0, 400000.0, terminator));
|
||||
}
|
||||
|
||||
|
||||
// don't let the light fade out too rapidly
|
||||
lightArg = (terminator + 200000.0)/100000.0;
|
||||
float minLightIntensity = min(0.2,0.16 * lightArg + 0.5);
|
||||
vec3 minLight = minLightIntensity * vec3 (0.2, 0.3, 0.4);
|
||||
hazeColor *= eqColorFactor * eShade;
|
||||
hazeColor.rgb = max(hazeColor.rgb, minLight.rgb);
|
||||
|
||||
|
||||
finalColor.rgb = mix( hazeColor +secondary_light * fog_backscatter(mvisibility), finalColor.rgb,transmission);
|
||||
|
||||
}
|
||||
|
||||
|
||||
finalColor.rgb = filter_combined(finalColor.rgb);
|
||||
|
||||
|
||||
gl_FragColor = finalColor;
|
||||
|
||||
|
||||
|
||||
|
||||
if (dot(normal,-V) > 0.1) {
|
||||
vec4 iproj = gl_ProjectionMatrix * p;
|
||||
iproj /= iproj.w;
|
||||
gl_FragDepth = (iproj.z+1.0)/2.0;
|
||||
} else {
|
||||
gl_FragDepth = gl_FragCoord.z;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,289 +0,0 @@
|
|||
// -*-C++-*-
|
||||
#version 120
|
||||
|
||||
// Shader that uses OpenGL state values to do per-pixel lighting
|
||||
//
|
||||
// The only light used is gl_LightSource[0], which is assumed to be
|
||||
// directional.
|
||||
//
|
||||
// Diffuse colors come from the gl_Color, ambient from the material. This is
|
||||
// equivalent to osg::Material::DIFFUSE.
|
||||
// Haze part added by Thorsten Renk, Oct. 2011
|
||||
|
||||
|
||||
#define MODE_OFF 0
|
||||
#define MODE_DIFFUSE 1
|
||||
#define MODE_AMBIENT_AND_DIFFUSE 2
|
||||
|
||||
// The constant term of the lighting equation that doesn't depend on
|
||||
// the surface normal is passed in gl_{Front,Back}Color. The alpha
|
||||
// component is set to 1 for front, 0 for back in order to work around
|
||||
// bugs with gl_FrontFacing in the fragment shader.
|
||||
|
||||
|
||||
varying vec3 relPos;
|
||||
varying vec3 worldPos;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
varying vec4 ecPosition;
|
||||
varying vec4 constantColor;
|
||||
varying vec3 light_diffuse;
|
||||
|
||||
|
||||
varying float yprime_alt;
|
||||
varying float mie_angle;
|
||||
varying float steepness;
|
||||
|
||||
uniform int colorMode;
|
||||
uniform float hazeLayerAltitude;
|
||||
uniform float terminator;
|
||||
uniform float terrain_alt;
|
||||
uniform float avisibility;
|
||||
uniform float visibility;
|
||||
uniform float overcast;
|
||||
uniform float ground_scattering;
|
||||
uniform float eye_alt;
|
||||
uniform float moonlight;
|
||||
|
||||
uniform bool use_IR_vision;
|
||||
|
||||
uniform mat4 osg_ViewMatrixInverse;
|
||||
|
||||
attribute vec3 tangent;//, binormal;
|
||||
|
||||
void setupShadows(vec4 eyeSpacePos);
|
||||
|
||||
float earthShade;
|
||||
|
||||
|
||||
// This is the value used in the skydome scattering shader - use the same here for consistency?
|
||||
const float EarthRadius = 5800000.0;
|
||||
const float terminator_width = 200000.0;
|
||||
|
||||
float light_func (in float x, in float a, in float b, in float c, in float d, in float e)
|
||||
{
|
||||
//x = x - 0.5;
|
||||
|
||||
// use the asymptotics to shorten computations
|
||||
if (x < -15.0) {return 0.0;}
|
||||
|
||||
return e / pow((1.0 + a * exp(-b * (x-c)) ),(1.0/d));
|
||||
}
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
|
||||
vec4 light_ambient;
|
||||
vec3 shadedFogColor = vec3(0.55, 0.67, 0.88);
|
||||
vec3 moonLightColor = vec3 (0.095, 0.095, 0.15) * moonlight;
|
||||
|
||||
//float yprime_alt;
|
||||
float yprime;
|
||||
float lightArg;
|
||||
float intensity;
|
||||
float vertex_alt;
|
||||
float scattering;
|
||||
|
||||
//rawPos = gl_Vertex.xy;
|
||||
worldPos = (osg_ViewMatrixInverse *gl_ModelViewMatrix * gl_Vertex).xyz;
|
||||
steepness = dot(normalize(gl_Normal), vec3 (0.0, 0.0, 1.0));
|
||||
|
||||
// hack: World Scenery 2.0 triangle mesh doesn't yield sensible tangents
|
||||
// and normals, so we pretend that urban terrain is always close
|
||||
// to flat to get rid of back triangles in urban terrain
|
||||
|
||||
//VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
//VTangent = gl_NormalMatrix * tangent;
|
||||
VNormal = gl_NormalMatrix * vec3 (0.0,0.0,1.0);
|
||||
VTangent = gl_NormalMatrix * vec3 (0.0,-1.0,0.0);
|
||||
|
||||
ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
// Normal = normalize(gl_Normal);
|
||||
// VBinormal = gl_NormalMatrix * binormal;
|
||||
|
||||
|
||||
// this code is copied from default.vert
|
||||
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
//normal = gl_NormalMatrix * gl_Normal;
|
||||
vec4 ambient_color, diffuse_color;
|
||||
if (colorMode == MODE_DIFFUSE) {
|
||||
diffuse_color = gl_Color;
|
||||
ambient_color = gl_FrontMaterial.ambient;
|
||||
} else if (colorMode == MODE_AMBIENT_AND_DIFFUSE) {
|
||||
diffuse_color = gl_Color;
|
||||
ambient_color = gl_Color;
|
||||
} else {
|
||||
diffuse_color = gl_FrontMaterial.diffuse;
|
||||
ambient_color = gl_FrontMaterial.ambient;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// here start computations for the haze layer
|
||||
// we need several geometrical quantities
|
||||
|
||||
|
||||
// first current altitude of eye position in model space
|
||||
vec4 ep = gl_ModelViewMatrixInverse * vec4(0.0,0.0,0.0,1.0);
|
||||
|
||||
// and relative position to vector
|
||||
relPos = gl_Vertex.xyz - ep.xyz;
|
||||
|
||||
// unfortunately, we need the distance in the vertex shader, although the more accurate version
|
||||
// is later computed in the fragment shader again
|
||||
float dist = length(relPos);
|
||||
|
||||
|
||||
// altitude of the vertex in question, somehow zero leads to artefacts, so ensure it is at least 100m
|
||||
vertex_alt = max(gl_Vertex.z,100.0);
|
||||
scattering = ground_scattering + (1.0 - ground_scattering) * smoothstep(hazeLayerAltitude -100.0, hazeLayerAltitude + 100.0, vertex_alt);
|
||||
|
||||
|
||||
|
||||
// early culling of vertices which can't be seen due to ground haze despite being in aloft visibility range
|
||||
|
||||
float delta_z = hazeLayerAltitude - eye_alt;
|
||||
|
||||
|
||||
// branch dependent on daytime
|
||||
|
||||
if (terminator < 1000000.0) // the full, sunrise and sunset computation
|
||||
{
|
||||
|
||||
|
||||
// establish coordinates relative to sun position
|
||||
|
||||
vec3 lightFull = (gl_ModelViewMatrixInverse * gl_LightSource[0].position).xyz;
|
||||
vec3 lightHorizon = normalize(vec3(lightFull.x,lightFull.y, 0.0));
|
||||
|
||||
|
||||
|
||||
// yprime is the distance of the vertex into sun direction
|
||||
yprime = -dot(relPos, lightHorizon);
|
||||
|
||||
// this gets an altitude correction, higher terrain gets to see the sun earlier
|
||||
yprime_alt = yprime - sqrt(2.0 * EarthRadius * vertex_alt);
|
||||
|
||||
// two times terminator width governs how quickly light fades into shadow
|
||||
// now the light-dimming factor
|
||||
earthShade = 0.6 * (1.0 - smoothstep(-terminator_width+ terminator, terminator_width + terminator, yprime_alt)) + 0.4;
|
||||
|
||||
// parametrized version of the Flightgear ground lighting function
|
||||
lightArg = (terminator-yprime_alt)/100000.0;
|
||||
|
||||
// directional scattering for low sun
|
||||
if (lightArg < 10.0)
|
||||
{mie_angle = (0.5 * dot(normalize(relPos), normalize(lightFull)) ) + 0.5;}
|
||||
else
|
||||
{mie_angle = 1.0;}
|
||||
|
||||
|
||||
|
||||
|
||||
light_diffuse.b = light_func(lightArg, 1.330e-05, 0.264, 3.827, 1.08e-05, 1.0);
|
||||
light_diffuse.g = light_func(lightArg, 3.931e-06, 0.264, 3.827, 7.93e-06, 1.0);
|
||||
light_diffuse.r = light_func(lightArg, 8.305e-06, 0.161, 3.827, 3.04e-05, 1.0);
|
||||
|
||||
light_diffuse = light_diffuse * scattering;
|
||||
|
||||
light_ambient.r = light_func(lightArg, 0.236, 0.253, 1.073, 0.572, 0.33);
|
||||
light_ambient.g = light_ambient.r * 0.4/0.33;
|
||||
light_ambient.b = light_ambient.r * 0.5/0.33;
|
||||
light_ambient.a = 1.0;
|
||||
|
||||
|
||||
|
||||
// correct ambient light intensity and hue before sunrise
|
||||
if (earthShade < 0.5)
|
||||
{
|
||||
//light_ambient = light_ambient * (0.7 + 0.3 * smoothstep(0.2, 0.5, earthShade));
|
||||
intensity = length(light_ambient.rgb);
|
||||
|
||||
light_ambient.rgb = intensity * normalize(mix(light_ambient.xyz, shadedFogColor, 1.0 -smoothstep(0.4, 0.8,earthShade) ));
|
||||
light_ambient.rgb = light_ambient.rgb + moonLightColor * (1.0 - smoothstep(0.4, 0.5, earthShade));
|
||||
|
||||
intensity = length(light_diffuse.xyz);
|
||||
light_diffuse.xyz = intensity * normalize(mix(light_diffuse.xyz, shadedFogColor, 1.0 -smoothstep(0.4, 0.7,earthShade) ));
|
||||
}
|
||||
|
||||
|
||||
// the haze gets the light at the altitude of the haze top if the vertex in view is below
|
||||
// but the light at the vertex if the vertex is above
|
||||
|
||||
vertex_alt = max(vertex_alt,hazeLayerAltitude);
|
||||
|
||||
if (vertex_alt > hazeLayerAltitude)
|
||||
{
|
||||
if (dist > 0.8 * avisibility)
|
||||
{
|
||||
vertex_alt = mix(vertex_alt, hazeLayerAltitude, smoothstep(0.8*avisibility, avisibility, dist));
|
||||
yprime_alt = yprime -sqrt(2.0 * EarthRadius * vertex_alt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
vertex_alt = hazeLayerAltitude;
|
||||
yprime_alt = yprime -sqrt(2.0 * EarthRadius * vertex_alt);
|
||||
}
|
||||
|
||||
}
|
||||
else // the faster, full-day version without lightfields
|
||||
{
|
||||
//vertex_alt = max(gl_Vertex.z,100.0);
|
||||
|
||||
earthShade = 1.0;
|
||||
mie_angle = 1.0;
|
||||
|
||||
if (terminator > 3000000.0)
|
||||
{light_diffuse = vec3 (1.0, 1.0, 1.0);
|
||||
light_ambient = vec4 (0.33, 0.4, 0.5, 0.0); }
|
||||
else
|
||||
{
|
||||
|
||||
lightArg = (terminator/100000.0 - 10.0)/20.0;
|
||||
light_diffuse.b = 0.78 + lightArg * 0.21;
|
||||
light_diffuse.g = 0.907 + lightArg * 0.091;
|
||||
light_diffuse.r = 0.904 + lightArg * 0.092;
|
||||
|
||||
light_ambient.b = 0.41 + lightArg * 0.08;
|
||||
light_ambient.g = 0.333 + lightArg * 0.06;
|
||||
light_ambient.r = 0.316 + lightArg * 0.016;
|
||||
|
||||
}
|
||||
|
||||
light_diffuse = light_diffuse * scattering;
|
||||
yprime_alt = -sqrt(2.0 * EarthRadius * hazeLayerAltitude);
|
||||
}
|
||||
|
||||
|
||||
// a sky/earth irradiation map model - the sky creates much more diffuse radiation than the ground, so
|
||||
// steep faces end up shaded more
|
||||
|
||||
light_ambient = light_ambient * ((1.0+steepness)/2.0 * 1.2 + (1.0-steepness)/2.0 * 0.2);
|
||||
|
||||
// deeper shadows when there is lots of direct light
|
||||
|
||||
float shade_depth = 1.0 * smoothstep (0.6,0.95,ground_scattering) * (1.0-smoothstep(0.1,0.5,overcast)) * smoothstep(0.4,1.5,earthShade);
|
||||
|
||||
light_ambient.rgb = light_ambient.rgb * (1.0 - shade_depth);
|
||||
light_diffuse.rgb = light_diffuse.rgb * (1.0 + 1.2 * shade_depth);
|
||||
|
||||
if (use_IR_vision)
|
||||
{
|
||||
light_ambient.rgb = max(light_ambient.rgb, vec3 (0.5, 0.5, 0.5));
|
||||
}
|
||||
|
||||
|
||||
// default lighting based on texture and material using the light we have just computed
|
||||
|
||||
gl_FrontColor = gl_Color;
|
||||
constantColor = gl_FrontMaterial.emission
|
||||
+ gl_Color * (gl_LightModel.ambient + light_ambient);
|
||||
|
||||
setupShadows(ecPosition);
|
||||
}
|
||||
|
|
@ -1,258 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// Author: Frederic Bouvier.
|
||||
// Adapted from the paper by F. Policarpo et al. : Real-time Relief Mapping on Arbitrary Polygonal Surfaces
|
||||
// Adapted from the paper and sources by M. Drobot in GPU Pro : Quadtree Displacement Mapping with Height Blending
|
||||
|
||||
#version 120
|
||||
|
||||
#extension GL_ATI_shader_texture_lod : enable
|
||||
#extension GL_ARB_shader_texture_lod : enable
|
||||
|
||||
#define TEXTURE_MIP_LEVELS 10
|
||||
#define TEXTURE_PIX_COUNT 1024 //pow(2,TEXTURE_MIP_LEVELS)
|
||||
#define BINARY_SEARCH_COUNT 10
|
||||
#define BILINEAR_SMOOTH_FACTOR 2.0
|
||||
|
||||
varying vec4 rawpos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 VTangent;
|
||||
//varying vec3 VBinormal;
|
||||
varying vec3 Normal;
|
||||
varying vec4 constantColor;
|
||||
|
||||
uniform sampler3D NoiseTex;
|
||||
uniform sampler2D BaseTex;
|
||||
uniform sampler2D NormalTex;
|
||||
uniform sampler2D QDMTex;
|
||||
uniform float depth_factor;
|
||||
uniform float tile_size;
|
||||
uniform float quality_level;
|
||||
uniform float snowlevel;
|
||||
uniform vec3 night_color;
|
||||
uniform bool random_buildings;
|
||||
uniform bool osm_buildings;
|
||||
|
||||
const float scale = 1.0;
|
||||
int linear_search_steps = 10;
|
||||
int GlobalIterationCount = 0;
|
||||
int gIterationCap = 64;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
float getShadowing();
|
||||
|
||||
void QDM(inout vec3 p, inout vec3 v)
|
||||
{
|
||||
const int MAX_LEVEL = TEXTURE_MIP_LEVELS;
|
||||
const float NODE_COUNT = TEXTURE_PIX_COUNT;
|
||||
const float TEXEL_SPAN_HALF = 1.0 / NODE_COUNT / 2.0;
|
||||
|
||||
float fDeltaNC = TEXEL_SPAN_HALF * depth_factor;
|
||||
|
||||
vec3 p2 = p;
|
||||
float level = MAX_LEVEL;
|
||||
vec2 dirSign = (sign(v.xy) + 1.0) * 0.5;
|
||||
GlobalIterationCount = 0;
|
||||
float d = 0.0;
|
||||
|
||||
while (level >= 0.0 && GlobalIterationCount < gIterationCap)
|
||||
{
|
||||
vec4 uv = vec4(p2.xyz, level);
|
||||
d = texture2DLod(QDMTex, uv.xy, uv.w).w;
|
||||
|
||||
if (d > p2.z)
|
||||
{
|
||||
//predictive point of ray traversal
|
||||
vec3 tmpP2 = p + v * d;
|
||||
|
||||
//current node count
|
||||
float nodeCount = pow(2.0, (MAX_LEVEL - level));
|
||||
//current and predictive node ID
|
||||
vec4 nodeID = floor(vec4(p2.xy, tmpP2.xy)*nodeCount);
|
||||
|
||||
//check if we are crossing the current cell
|
||||
if (nodeID.x != nodeID.z || nodeID.y != nodeID.w)
|
||||
{
|
||||
//calculate distance to nearest bound
|
||||
vec2 a = p2.xy - p.xy;
|
||||
vec2 p3 = (nodeID.xy + dirSign) / nodeCount;
|
||||
vec2 b = p3.xy - p.xy;
|
||||
|
||||
vec2 dNC = (b.xy * p2.z) / a.xy;
|
||||
//take the nearest cell
|
||||
d = min(d,min(dNC.x, dNC.y))+fDeltaNC;
|
||||
|
||||
level++;
|
||||
}
|
||||
p2 = p + v * d;
|
||||
}
|
||||
level--;
|
||||
GlobalIterationCount++;
|
||||
}
|
||||
|
||||
//
|
||||
// Manual Bilinear filtering
|
||||
//
|
||||
float rayLength = length(p2.xy - p.xy) + fDeltaNC;
|
||||
|
||||
float dA = p2.z * (rayLength - BILINEAR_SMOOTH_FACTOR * TEXEL_SPAN_HALF) / rayLength;
|
||||
float dB = p2.z * (rayLength + BILINEAR_SMOOTH_FACTOR * TEXEL_SPAN_HALF) / rayLength;
|
||||
|
||||
vec4 p2a = vec4(p + v * dA, 0.0);
|
||||
vec4 p2b = vec4(p + v * dB, 0.0);
|
||||
dA = texture2DLod(NormalTex, p2a.xy, p2a.w).w;
|
||||
dB = texture2DLod(NormalTex, p2b.xy, p2b.w).w;
|
||||
|
||||
dA = abs(p2a.z - dA);
|
||||
dB = abs(p2b.z - dB);
|
||||
|
||||
p2 = mix(p2a.xyz, p2b.xyz, dA / (dA + dB));
|
||||
|
||||
p = p2;
|
||||
}
|
||||
|
||||
float ray_intersect_QDM(vec2 dp, vec2 ds)
|
||||
{
|
||||
vec3 p = vec3( dp, 0.0 );
|
||||
vec3 v = vec3( ds, 1.0 );
|
||||
QDM( p, v );
|
||||
return p.z;
|
||||
}
|
||||
|
||||
float ray_intersect_relief(vec2 dp, vec2 ds)
|
||||
{
|
||||
float size = 1.0 / float(linear_search_steps);
|
||||
float depth = 0.0;
|
||||
float best_depth = 1.0;
|
||||
|
||||
for(int i = 0; i < linear_search_steps - 1; ++i)
|
||||
{
|
||||
depth += size;
|
||||
float t = step(0.95, texture2D(NormalTex, dp + ds * depth).a);
|
||||
if(best_depth > 0.996)
|
||||
if(depth >= t)
|
||||
best_depth = depth;
|
||||
}
|
||||
depth = best_depth;
|
||||
|
||||
const int binary_search_steps = 5;
|
||||
|
||||
for(int i = 0; i < binary_search_steps; ++i)
|
||||
{
|
||||
size *= 0.5;
|
||||
float t = step(0.95, texture2D(NormalTex, dp + ds * depth).a);
|
||||
if(depth >= t)
|
||||
{
|
||||
best_depth = depth;
|
||||
depth -= 2.0 * size;
|
||||
}
|
||||
depth += size;
|
||||
}
|
||||
|
||||
return(best_depth);
|
||||
}
|
||||
|
||||
float ray_intersect(vec2 dp, vec2 ds)
|
||||
{
|
||||
if (( random_buildings ) || (osm_buildings))
|
||||
{return 0.0;}
|
||||
else if ( quality_level >= 4.0 )
|
||||
{return ray_intersect_QDM( dp, ds );}
|
||||
else
|
||||
{return ray_intersect_relief( dp, ds );}
|
||||
}
|
||||
|
||||
void main (void)
|
||||
{
|
||||
if ( quality_level >= 3.0 ) {
|
||||
linear_search_steps = 20;
|
||||
}
|
||||
|
||||
float depthfactor = depth_factor;
|
||||
if (( random_buildings ) || (osm_buildings)) {depthfactor = 0.0;}
|
||||
|
||||
vec3 normal = normalize(VNormal);
|
||||
vec3 tangent = normalize(VTangent);
|
||||
//vec3 binormal = normalize(VBinormal);
|
||||
vec3 binormal = normalize(cross(normal, tangent));
|
||||
vec3 ecPos3 = ecPosition.xyz / ecPosition.w;
|
||||
vec3 V = normalize(ecPos3);
|
||||
vec3 s = vec3(dot(V, tangent), dot(V, binormal), dot(normal, -V));
|
||||
vec2 ds = s.xy * depthfactor / s.z;
|
||||
vec2 dp = gl_TexCoord[0].st - ds;
|
||||
float d = ray_intersect(dp, ds);
|
||||
|
||||
vec2 uv = dp + ds * d;
|
||||
vec3 N = texture2D(NormalTex, uv).xyz * 2.0 - 1.0;
|
||||
|
||||
|
||||
float emis = N.z;
|
||||
N.z = sqrt(1.0 - min(1.0,dot(N.xy, N.xy)));
|
||||
float Nz = N.z;
|
||||
N = normalize(N.x * tangent + N.y * binormal + N.z * normal);
|
||||
|
||||
vec3 l = gl_LightSource[0].position.xyz;
|
||||
vec3 diffuse = gl_Color.rgb * max(0.0, dot(N, l));
|
||||
diffuse *= getShadowing();
|
||||
float shadow_factor = 1.0;
|
||||
|
||||
// Shadow
|
||||
if ( quality_level >= 2.0 ) {
|
||||
dp += ds * d;
|
||||
vec3 sl = normalize( vec3( dot( l, tangent ), dot( l, binormal ), dot( -l, normal ) ) );
|
||||
ds = sl.xy * depthfactor / sl.z;
|
||||
dp -= ds * d;
|
||||
float dl = ray_intersect(dp, ds);
|
||||
if ( dl < d - 0.05 )
|
||||
shadow_factor = dot( constantColor.xyz, vec3( 1.0, 1.0, 1.0 ) ) * 0.25;
|
||||
}
|
||||
// end shadow
|
||||
|
||||
vec4 ambient_light = constantColor + gl_LightSource[0].diffuse * vec4(diffuse, 1.0);
|
||||
float reflectance = ambient_light.r * 0.3 + ambient_light.g * 0.59 + ambient_light.b * 0.11;
|
||||
if ( shadow_factor < 1.0 )
|
||||
ambient_light = constantColor + gl_LightSource[0].diffuse * shadow_factor * vec4(diffuse, 1.0);
|
||||
float emission_factor = (1.0 - smoothstep(0.15, 0.25, reflectance)) * emis;
|
||||
vec4 tc = texture2D(BaseTex, uv);
|
||||
emission_factor *= 0.5*pow(tc.r+0.8*tc.g+0.2*tc.b, 2.0) -0.2;
|
||||
ambient_light += (emission_factor * vec4(night_color, 0.0));
|
||||
|
||||
vec4 noisevec = texture3D(NoiseTex, (rawpos.xyz)*0.01*scale);
|
||||
vec4 nvL = texture3D(NoiseTex, (rawpos.xyz)*0.00066*scale);
|
||||
|
||||
float n=0.06;
|
||||
n += nvL[0]*0.4;
|
||||
n += nvL[1]*0.6;
|
||||
n += nvL[2]*2.0;
|
||||
n += nvL[3]*4.0;
|
||||
n += noisevec[0]*0.1;
|
||||
n += noisevec[1]*0.4;
|
||||
|
||||
n += noisevec[2]*0.8;
|
||||
n += noisevec[3]*2.1;
|
||||
n = mix(0.6, n, length(ecPosition.xyz) );
|
||||
|
||||
vec4 finalColor = texture2D(BaseTex, uv);
|
||||
finalColor = mix(finalColor, clamp(n+nvL[2]*4.1+vec4(0.1, 0.1, nvL[2]*2.2, 1.0), 0.7, 1.0),
|
||||
step(0.8,Nz)*(1.0-emis)*smoothstep(snowlevel+300.0, snowlevel+360.0, (rawpos.z)+nvL[1]*3000.0));
|
||||
finalColor *= ambient_light;
|
||||
|
||||
vec4 p = vec4( ecPos3 + tile_size * V * (d-1.0) * depthfactor / s.z, 1.0 );
|
||||
|
||||
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||
gl_FragColor = finalColor;
|
||||
|
||||
if (dot(normal,-V) > 0.1) {
|
||||
vec4 iproj = gl_ProjectionMatrix * p;
|
||||
iproj /= iproj.w;
|
||||
gl_FragDepth = (iproj.z+1.0)/2.0;
|
||||
} else {
|
||||
gl_FragDepth = gl_FragCoord.z;
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
// -*- mode: C; -*-
|
||||
// Licence: GPL v2
|
||||
// Author: Frederic Bouvier
|
||||
#version 120
|
||||
|
||||
varying vec4 rawpos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 Normal;
|
||||
varying vec3 VTangent;
|
||||
varying vec3 VBinormal;
|
||||
varying vec4 constantColor;
|
||||
|
||||
attribute vec3 tangent, binormal;
|
||||
|
||||
////fog "include"////////
|
||||
// uniform int fogType;
|
||||
//
|
||||
// void fog_Func(int type);
|
||||
/////////////////////////
|
||||
|
||||
void setupShadows(vec4 eyeSpacePos);
|
||||
|
||||
void main(void)
|
||||
{
|
||||
rawpos = gl_Vertex;
|
||||
ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
Normal = normalize(gl_Normal);
|
||||
VTangent = gl_NormalMatrix * tangent;
|
||||
VBinormal = gl_NormalMatrix * binormal;
|
||||
gl_FrontColor = gl_Color;
|
||||
constantColor = gl_FrontMaterial.emission
|
||||
+ gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient);
|
||||
gl_Position = ftransform();
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
// fog_Func(fogType);
|
||||
setupShadows(ecPosition);
|
||||
}
|
|
@ -1,70 +0,0 @@
|
|||
// This shader is mostly an adaptation of the shader found at
|
||||
// http://www.bonzaisoftware.com/water_tut.html and its glsl conversion
|
||||
// available at http://forum.bonzaisoftware.com/viewthread.php?tid=10
|
||||
// © Michael Horsch - 2005
|
||||
// Major update and revisions - 2011-10-07
|
||||
// © Emilian Huminiuc and Vivian Meazza
|
||||
// Optimisation - 2012-5-05
|
||||
// © Emilian Huminiuc and Vivian Meazza
|
||||
|
||||
#version 120
|
||||
#define fps2kts 0.5925
|
||||
|
||||
varying vec4 waterTex1;
|
||||
varying vec4 waterTex2;
|
||||
varying vec3 viewerdir;
|
||||
varying vec3 lightdir;
|
||||
varying vec3 normal;
|
||||
|
||||
uniform float osg_SimulationTime;
|
||||
uniform float WindE, WindN, spd, hdg;
|
||||
|
||||
/////////////////////////
|
||||
|
||||
|
||||
/////// functions /////////
|
||||
|
||||
void relWind(out float rel_wind_speed_kts, float rel_wind_from_deg)
|
||||
{
|
||||
//calculate the carrier speed north and east in kts
|
||||
float speed_north_kts = cos(radians(hdg)) * spd ;
|
||||
float speed_east_kts = sin(radians(hdg)) * spd ;
|
||||
|
||||
//calculate the relative wind speed north and east in kts
|
||||
float rel_wind_speed_from_east_kts = WindE*fps2kts + speed_east_kts;
|
||||
float rel_wind_speed_from_north_kts = WindN*fps2kts + speed_north_kts;
|
||||
|
||||
//combine relative speeds north and east to get relative windspeed in kts
|
||||
rel_wind_speed_kts = sqrt((rel_wind_speed_from_east_kts * rel_wind_speed_from_east_kts) + (rel_wind_speed_from_north_kts * rel_wind_speed_from_north_kts));
|
||||
|
||||
//calculate the relative wind direction
|
||||
rel_wind_from_deg = degrees(atan(rel_wind_speed_from_east_kts, rel_wind_speed_from_north_kts));
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
|
||||
float relWindspd=0;
|
||||
float relWinddir=0;
|
||||
//compute relative wind speed and direction
|
||||
relWind (relWindspd, relWinddir);
|
||||
|
||||
vec3 N = normalize(gl_Normal);
|
||||
normal = N;
|
||||
|
||||
viewerdir = vec3(gl_ModelViewMatrixInverse[3]) - vec3(gl_Vertex);
|
||||
lightdir = normalize(vec3(gl_ModelViewMatrixInverse * gl_LightSource[0].position));
|
||||
|
||||
vec4 t1 = vec4(osg_SimulationTime*0.005217, 0.0, 0.0, 0.0);
|
||||
vec4 t2 = vec4(osg_SimulationTime*-0.0012, 0.0, 0.0, 0.0);
|
||||
|
||||
float windFactor = -relWindspd * 0.1;
|
||||
// float windFactor = sqrt(pow(abs(WindE),2)+pow(abs(WindN),2)) * 0.6;
|
||||
|
||||
waterTex1 = gl_MultiTexCoord0 + t1 * windFactor;
|
||||
waterTex2 = gl_MultiTexCoord0 + t2 * windFactor;
|
||||
|
||||
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
||||
gl_Position = ftransform();
|
||||
|
||||
}
|
|
@ -1,134 +0,0 @@
|
|||
// This shader is mostly an adaptation of the shader found at
|
||||
// http://www.bonzaisoftware.com/water_tut.html and its glsl conversion
|
||||
// available at http://forum.bonzaisoftware.com/viewthread.php?tid=10
|
||||
// © Michael Horsch - 2005
|
||||
|
||||
#version 120
|
||||
uniform sampler2D water_normalmap;
|
||||
uniform sampler2D water_reflection;
|
||||
uniform sampler2D water_dudvmap;
|
||||
uniform sampler2D water_reflection_grey;
|
||||
|
||||
uniform float saturation;
|
||||
uniform float CloudCover0, CloudCover1, CloudCover2, CloudCover3, CloudCover4;
|
||||
|
||||
varying vec4 waterTex1; //moving texcoords
|
||||
varying vec4 waterTex2; //moving texcoords
|
||||
varying vec4 waterTex4; //viewts
|
||||
//varying vec4 ecPosition;
|
||||
varying vec3 viewerdir;
|
||||
varying vec3 lightdir;
|
||||
varying vec3 normal;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
void main(void)
|
||||
{
|
||||
const vec4 sca = vec4(0.005, 0.005, 0.005, 0.005);
|
||||
const vec4 sca2 = vec4(0.02, 0.02, 0.02, 0.02);
|
||||
const vec4 tscale = vec4(0.25, 0.25, 0.25, 0.25);
|
||||
|
||||
// compute direction to viewer
|
||||
vec3 E = normalize(viewerdir);
|
||||
|
||||
// compute direction to light source
|
||||
vec3 L = normalize(lightdir);
|
||||
|
||||
// half vector
|
||||
vec3 H = normalize(L + E);
|
||||
|
||||
const float water_shininess = 240.0;
|
||||
|
||||
// approximate cloud cover
|
||||
float cover = 0.0;
|
||||
cover = min(min(min(min(CloudCover0, CloudCover1),CloudCover2),CloudCover3),CloudCover4);
|
||||
|
||||
vec4 viewt = normalize(waterTex4);
|
||||
|
||||
vec4 disdis = texture2D(water_dudvmap, vec2(waterTex2 * tscale)) * 2.0 - 1.0;
|
||||
vec4 dist = texture2D(water_dudvmap, vec2(waterTex1 + disdis*sca2)) * 2.0 - 1.0;
|
||||
vec4 fdist = normalize(dist);
|
||||
fdist *= sca;
|
||||
|
||||
//normalmap
|
||||
vec4 nmap0 = texture2D(water_normalmap, vec2(waterTex1+ disdis*sca2)) * 2.0 - 1.0;
|
||||
vec4 nmap2 = texture2D(water_normalmap, vec2(waterTex2 * tscale)) * 2.0 - 1.0;
|
||||
vec4 vNorm = normalize(nmap0 + nmap2);
|
||||
|
||||
//load reflection
|
||||
vec4 tmp = vec4(lightdir, 0.0);
|
||||
vec4 refTex;
|
||||
vec4 baseTex;
|
||||
vec4 greyTex;
|
||||
vec4 refl;
|
||||
vec4 base;
|
||||
vec4 grey;
|
||||
|
||||
baseTex = texture2D(water_reflection, vec2(tmp));
|
||||
base = normalize(baseTex);
|
||||
greyTex = texture2D(water_reflection_grey, vec2(tmp));
|
||||
grey = normalize(greyTex);
|
||||
|
||||
//cover = 3;
|
||||
|
||||
if(cover >= 1.5){
|
||||
refl = mix(base, grey, 0.35);
|
||||
refl.r *= (0.93);
|
||||
refl.g *= (0.95);
|
||||
refl.b *= (1.0);
|
||||
refl.a *= 1.0;
|
||||
|
||||
} else {
|
||||
refl = mix(base, grey, 0.45);
|
||||
refl.r *= (0.70 + 0.15 * cover);
|
||||
refl.g *= (0.80 + 0.15 * cover);
|
||||
refl.b *= (0.85 + 0.125 * cover);
|
||||
refl.a *= 1.0;
|
||||
}
|
||||
|
||||
vec3 N0 = vec3(texture2D(water_normalmap, vec2(waterTex1+ disdis*sca2)) * 2.0 - 1.0);
|
||||
vec3 N1 = vec3(texture2D(water_normalmap, vec2(waterTex2 * tscale)) * 2.0 - 1.0);
|
||||
vec3 N = normalize(normal+N0+N1);
|
||||
|
||||
// specular
|
||||
vec3 specular_color = vec3(gl_LightSource[0].diffuse)
|
||||
* pow(max(0.0, dot(N, H)), water_shininess) * 6.0;
|
||||
vec4 specular = vec4(specular_color, 0.5);
|
||||
specular = specular * saturation;
|
||||
|
||||
//calculate fresnel
|
||||
vec4 invfres = vec4( dot(vNorm, viewt) );
|
||||
vec4 fres = vec4(1.0) + invfres;
|
||||
refl *= fres;
|
||||
|
||||
//calculate the fog factor
|
||||
// float fogFactor;
|
||||
// float fogCoord = ecPosition.z;
|
||||
// const float LOG2 = 1.442695;
|
||||
// fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||
//
|
||||
// if(gl_Fog.density == 1.0)
|
||||
// fogFactor=1.0;
|
||||
|
||||
//calculate final colour
|
||||
vec4 ambient_light = gl_LightSource[0].diffuse;
|
||||
vec4 finalColor;
|
||||
|
||||
//cover = 3;
|
||||
|
||||
if(cover >= 1.5){
|
||||
finalColor = refl + specular;
|
||||
} else {
|
||||
finalColor = refl;
|
||||
}
|
||||
|
||||
finalColor *= ambient_light;
|
||||
|
||||
// gl_FragColor = mix(gl_Fog.color, finalColor, fogFactor);
|
||||
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||
gl_FragColor = finalColor;
|
||||
}
|
|
@ -1,93 +0,0 @@
|
|||
#version 120
|
||||
|
||||
varying vec4 rawpos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 Normal;
|
||||
varying vec3 lightVec;
|
||||
|
||||
uniform sampler3D NoiseTex;
|
||||
uniform float osg_SimulationTime;
|
||||
|
||||
//const float scale = 1.0;
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec4 noisevecS = texture3D(NoiseTex, (rawpos.xyz)*0.0126);
|
||||
vec4 nvLS = texture3D(NoiseTex, (rawpos.xyz)*-0.0003323417);
|
||||
|
||||
vec4 noisevec = texture3D(NoiseTex, (rawpos.xyz)*0.00423+vec3(0.0,0.0,osg_SimulationTime*0.035217));
|
||||
vec4 nvL = texture3D(NoiseTex, (rawpos.xyz)*0.001223417+(0.0,0.0,osg_SimulationTime*-0.0212));
|
||||
|
||||
// float fogFactor;
|
||||
// if (gl_Fog.density == 1.0)
|
||||
// {
|
||||
// fogFactor=1.0;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// float fogCoord = ecPosition.z;
|
||||
// const float LOG2 = 1.442695;
|
||||
// fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
|
||||
// fogFactor = clamp(fogFactor, 0.0, 1.0);
|
||||
// }
|
||||
|
||||
float a=1.0;
|
||||
float n=0.00;
|
||||
n += nvLS[0]*a;
|
||||
a/=2.0;
|
||||
n += nvLS[1]*a;
|
||||
a/=2.0;
|
||||
n += nvLS[2]*a;
|
||||
a/=2.0;
|
||||
n += nvLS[3]*a;
|
||||
|
||||
a=4.0;
|
||||
float na=n;
|
||||
na += nvL[0]*1.1;
|
||||
a*=1.2;
|
||||
na += nvL[1]*a;
|
||||
a*=1.2;
|
||||
na += nvL[2]*a;
|
||||
a*=1.2;
|
||||
na += nvL[3]*a;
|
||||
a=2.0;
|
||||
na += noisevec[0]*a*0.2;
|
||||
a*=1.2;
|
||||
na += noisevec[1]*a;
|
||||
a*=1.2;
|
||||
na += noisevec[2]*a;
|
||||
a*=1.2;
|
||||
na += noisevec[3]*a;
|
||||
|
||||
vec4 c1;
|
||||
c1 = asin(vec4(smoothstep(0.0, 2.2, n), smoothstep(-0.1, 2.10, n), smoothstep(-0.2, 2.0, n), 1.0));
|
||||
|
||||
vec3 Eye = normalize(-ecPosition.xyz);
|
||||
vec3 Reflected = normalize(reflect(-normalize(lightVec), normalize(VNormal+vec3(0.0,0.0,na*0.10-0.24))));
|
||||
|
||||
vec3 bump = normalize(VNormal+vec3(0.0, 0.0, na)-0.9);
|
||||
vec3 bumped = max(normalize(refract(lightVec, normalize(bump), 0.16)), 0.0);
|
||||
|
||||
vec4 ambientColor = gl_LightSource[0].ambient;
|
||||
vec4 light = ambientColor;
|
||||
c1 *= light;
|
||||
|
||||
float bumpFact = (bumped.r+bumped.g+bumped.b);
|
||||
float ReflectedEye = max(dot(Reflected, Eye), 0.0);
|
||||
float eyeFact = pow(ReflectedEye, 20.0);
|
||||
c1 += 0.3 * gl_LightSource[0].diffuse * (1.0-eyeFact) * bumpFact*bumpFact;
|
||||
c1 += 0.4 * gl_LightSource[0].diffuse * eyeFact * 3.0*bumpFact;
|
||||
eyeFact = pow(eyeFact, 20.0);
|
||||
c1 += gl_LightSource[0].specular * eyeFact * 4.0*bumpFact;
|
||||
|
||||
vec4 finalColor = c1;
|
||||
// gl_FragColor = mix(gl_Fog.color, finalColor, fogFactor);
|
||||
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||
gl_FragColor = finalColor;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#version 120
|
||||
|
||||
varying vec4 rawpos;
|
||||
varying vec4 ecPosition;
|
||||
varying vec3 VNormal;
|
||||
varying vec3 Normal;
|
||||
varying vec3 lightVec;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
rawpos = gl_Vertex;
|
||||
ecPosition = gl_ModelViewMatrix * gl_Vertex;
|
||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
Normal = normalize(gl_Normal);
|
||||
lightVec = normalize(gl_LightSource[0].position.xyz/* - ecPosition*/);
|
||||
gl_Position = ftransform();
|
||||
}
|
|
@ -1,222 +0,0 @@
|
|||
// This shader is mostly an adaptation of the shader found at
|
||||
// http://www.bonzaisoftware.com/water_tut.html and its glsl conversion
|
||||
// available at http://forum.bonzaisoftware.com/viewthread.php?tid=10
|
||||
// © Michael Horsch - 2005
|
||||
// Major update and revisions - 2011-10-07
|
||||
// © Emilian Huminiuc and Vivian Meazza
|
||||
// Optimisation - 2012-5-05
|
||||
// Based on ideas by Thorsten Renk
|
||||
// © Emilian Huminiuc and Vivian Meazza
|
||||
|
||||
#version 120
|
||||
|
||||
uniform sampler2D perlin_normalmap;
|
||||
uniform sampler2D sea_foam;
|
||||
uniform sampler2D water_dudvmap;
|
||||
uniform sampler2D water_normalmap;
|
||||
uniform sampler2D water_reflection;
|
||||
uniform sampler2D water_reflection_grey;
|
||||
|
||||
uniform float CloudCover0;
|
||||
uniform float CloudCover1;
|
||||
uniform float CloudCover2;
|
||||
uniform float CloudCover3;
|
||||
uniform float CloudCover4;
|
||||
uniform float Overcast;
|
||||
uniform float WaveAmp;
|
||||
uniform float WaveFreq;
|
||||
uniform float WaveSharp;
|
||||
uniform float WindE;
|
||||
uniform float WindN;
|
||||
uniform float normalmap_dds;
|
||||
uniform float osg_SimulationTime;
|
||||
uniform float saturation;
|
||||
|
||||
uniform int Status;
|
||||
|
||||
varying vec3 lightdir;
|
||||
varying vec3 normal;
|
||||
varying vec3 viewerdir;
|
||||
varying vec4 waterTex1; //moving texcoords
|
||||
varying vec4 waterTex2; //moving texcoords
|
||||
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
/////// functions /////////
|
||||
|
||||
void rotationmatrix(in float angle, out mat4 rotmat)
|
||||
{
|
||||
rotmat = mat4( cos( angle ), -sin( angle ), 0.0, 0.0,
|
||||
sin( angle ), cos( angle ), 0.0, 0.0,
|
||||
0.0 , 0.0 , 1.0, 0.0,
|
||||
0.0 , 0.0 , 0.0, 1.0 );
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
const vec4 sca = vec4(0.005, 0.005, 0.005, 0.005);
|
||||
const vec4 sca2 = vec4(0.02, 0.02, 0.02, 0.02);
|
||||
const vec4 tscale = vec4(0.25, 0.25, 0.25, 0.25);
|
||||
|
||||
mat4 RotationMatrix;
|
||||
// compute direction to viewer
|
||||
vec3 E = normalize(viewerdir);
|
||||
|
||||
// compute direction to light source
|
||||
vec3 L = normalize(lightdir);
|
||||
|
||||
// half vector
|
||||
vec3 H = normalize(L + E);
|
||||
|
||||
vec3 Normal = normalize(normal);
|
||||
|
||||
const float water_shininess = 240.0;
|
||||
|
||||
// approximate cloud cover
|
||||
float cover = 0.0;
|
||||
//bool Status = true;
|
||||
|
||||
|
||||
float windEffect = sqrt( WindE*WindE + WindN*WindN ) * 0.6; //wind speed in kt
|
||||
float windScale = 15.0/(3.0 + windEffect); //wave scale
|
||||
float windEffect_low = 0.3 + 0.7 * smoothstep(0.0, 5.0, windEffect); //low windspeed wave filter
|
||||
float waveRoughness = 0.05 + smoothstep(0.0, 20.0, windEffect); //wave roughness filter
|
||||
|
||||
float mixFactor = 0.75 - 0.15 * smoothstep(0.0, 40.0, windEffect);
|
||||
mixFactor = clamp(mixFactor, 0.3, 0.8);
|
||||
|
||||
if (Status == 1){
|
||||
cover = min(min(min(min(CloudCover0, CloudCover1),CloudCover2),CloudCover3),CloudCover4);
|
||||
} else {
|
||||
// hack to allow for Overcast not to be set by Local Weather
|
||||
if (Overcast == 0.0){
|
||||
cover = 5.0;
|
||||
} else {
|
||||
cover = Overcast * 5.0;
|
||||
}
|
||||
}
|
||||
|
||||
vec4 viewt = vec4(-E, 0.0) * 0.6;
|
||||
|
||||
vec4 disdis = texture2D(water_dudvmap, vec2(waterTex2 * tscale)* windScale) * 2.0 - 1.0;
|
||||
|
||||
vec4 dist = texture2D(water_dudvmap, vec2(waterTex1 + disdis*sca2)* windScale) * 2.0 - 1.0;
|
||||
dist *= (0.6 + 0.5 * smoothstep(0.0, 15.0, windEffect));
|
||||
vec4 fdist = normalize(dist);
|
||||
if (normalmap_dds > 0)
|
||||
fdist = -fdist; //dds fix
|
||||
fdist *= sca;
|
||||
|
||||
//normalmaps
|
||||
rotationmatrix(radians(3.0 * windScale + 0.6 * sin(waterTex1.s * 0.2)), RotationMatrix);
|
||||
vec4 nmap = texture2D(water_normalmap, vec2(waterTex1* RotationMatrix + disdis * sca2) * windScale) * 2.0 - 1.0;
|
||||
vec4 nmap1 = texture2D(perlin_normalmap, vec2(waterTex1/** RotationMatrix*/ + disdis * sca2) * windScale) * 2.0 - 1.0;
|
||||
|
||||
rotationmatrix(radians(-2.0 * windScale -0.4 * sin(waterTex1.s * 0.32)), RotationMatrix);
|
||||
nmap += texture2D(water_normalmap, vec2(waterTex1* RotationMatrix + disdis * sca2) * windScale * 1.5) * 2.0 - 1.0;
|
||||
//nmap1 += texture2D(perlin_normalmap, vec2(waterTex1* RotationMatrix + disdis * sca2) * windScale) * 2.0 - 1.0;
|
||||
rotationmatrix(radians(1.5 * windScale + 0.3 * sin(waterTex1.s * 0.16)), RotationMatrix);
|
||||
nmap += texture2D(water_normalmap, vec2(waterTex1* RotationMatrix + disdis * sca2) * windScale * 2.1) * 2.0 - 1.0;
|
||||
rotationmatrix(radians(-0.5 * windScale - 0.45 * sin(waterTex1.s * 0.28)), RotationMatrix);
|
||||
nmap += texture2D(water_normalmap, vec2(waterTex1* RotationMatrix + disdis * sca2) * windScale * 0.8) * 2.0 - 1.0;
|
||||
|
||||
rotationmatrix(radians(-1.2 * windScale - 0.35 * sin(waterTex1.s * 0.28)), RotationMatrix);
|
||||
nmap += texture2D(water_normalmap, vec2(waterTex2 * RotationMatrix* tscale) * windScale * 1.7) * 2.0 - 1.0;
|
||||
nmap1 += texture2D(perlin_normalmap, vec2(waterTex2/** RotationMatrix*/ * tscale) * windScale) * 2.0 - 1.0;
|
||||
|
||||
nmap *= windEffect_low;
|
||||
nmap1 *= windEffect_low;
|
||||
// mix water and noise, modulated by factor
|
||||
vec4 vNorm = normalize(mix(nmap, nmap1, mixFactor) * waveRoughness);
|
||||
if (normalmap_dds > 0)
|
||||
vNorm = -vNorm; //dds fix
|
||||
|
||||
//load reflection
|
||||
vec4 tmp = vec4(lightdir, 0.0);
|
||||
vec4 refTex = texture2D(water_reflection, vec2(tmp + waterTex1) * 32.0) ;
|
||||
vec4 refTexGrey = texture2D(water_reflection_grey, vec2(tmp + waterTex1) * 32.0) ;
|
||||
vec4 refl ;
|
||||
|
||||
// cover = 0;
|
||||
|
||||
if(cover >= 1.5){
|
||||
refl = normalize(refTex);
|
||||
refl.a = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
refl = normalize(refTexGrey);
|
||||
refl.r *= (0.75 + 0.15 * cover);
|
||||
refl.g *= (0.80 + 0.15 * cover);
|
||||
refl.b *= (0.875 + 0.125 * cover);
|
||||
refl.a = 1.0;
|
||||
}
|
||||
|
||||
rotationmatrix(radians(2.1* windScale + 0.25 * sin(waterTex1.s *0.14)), RotationMatrix);
|
||||
vec3 N0 = vec3(texture2D(water_normalmap, vec2(waterTex1* RotationMatrix + disdis * sca2) * windScale * 1.15) * 2.0 - 1.0);
|
||||
vec3 N1 = vec3(texture2D(perlin_normalmap, vec2(waterTex1/** RotationMatrix*/ + disdis * sca) * windScale) * 2.0 - 1.0);
|
||||
|
||||
rotationmatrix(radians(-1.5 * windScale -0.32 * sin(waterTex1.s *0.24)), RotationMatrix);
|
||||
N0 += vec3(texture2D(water_normalmap, vec2(waterTex2* RotationMatrix * tscale) * windScale * 1.8) * 2.0 - 1.0);
|
||||
N1 += vec3(texture2D(perlin_normalmap, vec2(waterTex2/** RotationMatrix*/ * tscale) * windScale) * 2.0 - 1.0);
|
||||
|
||||
rotationmatrix(radians(3.8 * windScale + 0.45 * sin(waterTex1.s *0.32)), RotationMatrix);
|
||||
N0 += vec3(texture2D(water_normalmap, vec2(waterTex2 * RotationMatrix * (tscale + sca2)) * windScale * 0.85) * 2.0 - 1.0);
|
||||
N1 += vec3(texture2D(perlin_normalmap, vec2(waterTex2/** RotationMatrix*/ * (tscale + sca2)) * windScale) * 2.0 - 1.0);
|
||||
|
||||
rotationmatrix(radians(-2.8 * windScale - 0.38 * sin(waterTex1.s * 0.26)), RotationMatrix);
|
||||
N0 += vec3(texture2D(water_normalmap, vec2(waterTex1 * RotationMatrix + disdis * sca2) * windScale * 2.1) * 2.0 - 1.0);
|
||||
N1 += vec3(texture2D(perlin_normalmap, vec2(waterTex1 /** RotationMatrix*/ + disdis * sca) * windScale) * 2.0 - 1.0);
|
||||
|
||||
N0 *= windEffect_low;
|
||||
N1 *= windEffect_low;
|
||||
|
||||
vec3 N = normalize(mix(Normal + N0, Normal + N1, mixFactor) * waveRoughness);
|
||||
|
||||
if (normalmap_dds > 0)
|
||||
N = -N; //dds fix
|
||||
|
||||
// specular
|
||||
vec3 specular_color = vec3(gl_LightSource[0].diffuse)
|
||||
* pow(max(0.0, dot(N, H)), water_shininess) * 6.0;
|
||||
vec4 specular = vec4(specular_color, 0.5);
|
||||
|
||||
specular = specular * saturation * 0.3 ;
|
||||
|
||||
//calculate fresnel
|
||||
vec4 invfres = vec4( dot(vNorm, viewt) );
|
||||
vec4 fres = vec4(1.0) + invfres;
|
||||
refl *= fres;
|
||||
|
||||
//calculate final colour
|
||||
vec4 ambient_light = gl_LightSource[0].diffuse;
|
||||
vec4 finalColor;
|
||||
|
||||
if(cover >= 1.5){
|
||||
finalColor = refl + specular;
|
||||
} else {
|
||||
finalColor = refl;
|
||||
}
|
||||
|
||||
float foamSlope = 0.10 + 0.1 * windScale;
|
||||
|
||||
vec4 foam_texel = texture2D(sea_foam, vec2(waterTex2 * tscale) * 25.0);
|
||||
float waveSlope = N.g;
|
||||
|
||||
if (windEffect >= 8.0)
|
||||
if (waveSlope >= foamSlope){
|
||||
finalColor = mix(finalColor, max(finalColor, finalColor + foam_texel), smoothstep(0.01, 0.50, N.g));
|
||||
}
|
||||
|
||||
|
||||
finalColor *= ambient_light;
|
||||
|
||||
//gl_FragColor = mix(gl_Fog.color, finalColor, fogFactor);
|
||||
finalColor.rgb = fog_Func(finalColor.rgb, fogType);
|
||||
gl_FragColor = finalColor;
|
||||
}
|
|
@ -1,112 +0,0 @@
|
|||
// This shader is mostly an adaptation of the shader found at
|
||||
// http://www.bonzaisoftware.com/water_tut.html and its glsl conversion
|
||||
// available at http://forum.bonzaisoftware.com/viewthread.php?tid=10
|
||||
// Michael Horsch - 2005
|
||||
// Major update and revisions - 2011-10-07
|
||||
// Emilian Huminiuc and Vivian Meazza
|
||||
|
||||
#version 120
|
||||
|
||||
varying vec4 waterTex1;
|
||||
varying vec4 waterTex2;
|
||||
|
||||
varying vec3 viewerdir;
|
||||
varying vec3 lightdir;
|
||||
varying vec3 normal;
|
||||
|
||||
varying vec3 WorldPos;
|
||||
varying vec2 TopoUV;
|
||||
|
||||
uniform float osg_SimulationTime;
|
||||
uniform mat4 osg_ViewMatrixInverse;
|
||||
uniform float WindE, WindN;
|
||||
|
||||
// constants for the cartezian to geodetic conversion.
|
||||
|
||||
const float a = 6378137.0; //float a = equRad;
|
||||
const float squash = 0.9966471893352525192801545;
|
||||
const float latAdjust = 0.9999074159800018; //geotiff source for the depth map
|
||||
const float lonAdjust = 0.9999537058469516; //actual extents: +-180.008333333333326/+-90.008333333333340
|
||||
|
||||
/////// functions /////////
|
||||
|
||||
void rotationmatrix(in float angle, out mat4 rotmat)
|
||||
{
|
||||
rotmat = mat4( cos( angle ), -sin( angle ), 0.0, 0.0,
|
||||
sin( angle ), cos( angle ), 0.0, 0.0,
|
||||
0.0 , 0.0 , 1.0, 0.0,
|
||||
0.0 , 0.0 , 0.0, 1.0 );
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
mat4 RotationMatrix;
|
||||
normal = normalize(gl_Normal);
|
||||
viewerdir = vec3(gl_ModelViewMatrixInverse[3]) - vec3(gl_Vertex);
|
||||
lightdir = normalize(vec3(gl_ModelViewMatrixInverse * gl_LightSource[0].position));
|
||||
|
||||
vec4 t1 = vec4(0.0, osg_SimulationTime * 0.005217, 0.0, 0.0);
|
||||
vec4 t2 = vec4(0.0, osg_SimulationTime * -0.0012, 0.0, 0.0);
|
||||
|
||||
float Angle;
|
||||
|
||||
float windFactor = sqrt(WindE * WindE + WindN * WindN) * 0.05;
|
||||
|
||||
if (WindN == 0.0 && WindE == 0.0) {
|
||||
Angle = 0.0;
|
||||
}else{
|
||||
Angle = atan(-WindN, WindE) - atan(1.0);
|
||||
}
|
||||
|
||||
rotationmatrix(Angle, RotationMatrix);
|
||||
waterTex1 = gl_MultiTexCoord0 * RotationMatrix - t1 * windFactor;
|
||||
|
||||
rotationmatrix(Angle, RotationMatrix);
|
||||
waterTex2 = gl_MultiTexCoord0 * RotationMatrix - t2 * windFactor;
|
||||
|
||||
// fog_Func(fogType);
|
||||
WorldPos = (osg_ViewMatrixInverse *gl_ModelViewMatrix * gl_Vertex).xyz;
|
||||
|
||||
|
||||
///FIXME: convert cartezian coordinates to geodetic, this
|
||||
///FIXME: duplicates parts of code in SGGeodesy.cxx
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
float e2 = abs(1.0 - squash * squash);
|
||||
float ra2 = 1.0/(a * a);
|
||||
float e4 = e2 * e2;
|
||||
float XXpYY = WorldPos.x * WorldPos.x + WorldPos.y * WorldPos.y;
|
||||
float Z = WorldPos.z;
|
||||
float sqrtXXpYY = sqrt(XXpYY);
|
||||
float p = XXpYY * ra2;
|
||||
float q = Z*Z*(1.0-e2)*ra2;
|
||||
float r = 1.0/6.0*(p + q - e4);
|
||||
float s = e4 * p * q/(4.0*r*r*r);
|
||||
if ( s >= 2.0 && s <= 0.0)
|
||||
s = 0.0;
|
||||
float t = pow(1.0+s+sqrt(s*2.0+s*s), 1.0/3.0);
|
||||
float u = r + r*t + r/t;
|
||||
float v = sqrt(u*u + e4*q);
|
||||
float w = (e2*u+ e2*v-e2*q)/(2.0*v);
|
||||
float k = sqrt(u+v+w*w)-w;
|
||||
float D = k*sqrtXXpYY/(k+e2);
|
||||
|
||||
vec2 NormPosXY = normalize(WorldPos.xy);
|
||||
vec2 NormPosXZ = normalize(vec2(D, WorldPos.z));
|
||||
float signS = sign(WorldPos.y);
|
||||
if (-0.00015 <= WorldPos.y && WorldPos.y<=.00015)
|
||||
signS = 1.0;
|
||||
float signT = sign(WorldPos.z);
|
||||
if (-0.0002 <= WorldPos.z && WorldPos.z<=.0002)
|
||||
signT = 1.0;
|
||||
float cosLon = dot(NormPosXY, vec2(1.0,0.0));
|
||||
float cosLat = dot(abs(NormPosXZ), vec2(1.0,0.0));
|
||||
TopoUV.s = signS * lonAdjust * degrees(acos(cosLon))/180.;
|
||||
TopoUV.t = signT * latAdjust * degrees(acos(cosLat))/90.;
|
||||
TopoUV.s = TopoUV.s * 0.5 + 0.5;
|
||||
TopoUV.t = TopoUV.t * 0.5 + 0.5;
|
||||
|
||||
//FIXME end/////////////////////////////////////////////////////////////////
|
||||
|
||||
gl_Position = ftransform();
|
||||
}
|
|
@ -1,391 +0,0 @@
|
|||
// FRAGMENT SHADER
|
||||
// This shader is mostly an adaptation of the shader found at
|
||||
// http://www.bonzaisoftware.com/water_tut.html and its glsl conversion
|
||||
// available at http://forum.bonzaisoftware.com/viewthread.php?tid=10
|
||||
// ©Michael Horsch - 2005
|
||||
// Major update and revisions - 2011-10-07
|
||||
// ©Emilian Huminiuc and Vivian Meazza
|
||||
// Optimisation - 2012-5-05
|
||||
// Based on ideas by Thorsten Renk
|
||||
// ©Emilian Huminiuc and Vivian Meazza
|
||||
|
||||
#version 120
|
||||
|
||||
varying vec2 TopoUV;
|
||||
varying vec3 WorldPos;
|
||||
varying vec3 lightdir;
|
||||
varying vec3 normal;
|
||||
varying vec3 viewerdir;
|
||||
varying vec4 waterTex1; //moving texcoords
|
||||
varying vec4 waterTex2; //moving texcoords
|
||||
|
||||
uniform sampler2D perlin_normalmap;
|
||||
uniform sampler2D sea_foam;
|
||||
uniform sampler2D topo_map;
|
||||
uniform sampler2D water_dudvmap;
|
||||
uniform sampler2D water_normalmap;
|
||||
uniform sampler2D water_reflection;
|
||||
uniform sampler2D water_reflection_grey;
|
||||
uniform sampler3D Noise;
|
||||
|
||||
uniform float CloudCover0;
|
||||
uniform float CloudCover1;
|
||||
uniform float CloudCover2;
|
||||
uniform float CloudCover3;
|
||||
uniform float CloudCover4;
|
||||
uniform float Overcast;
|
||||
uniform float WindE;
|
||||
uniform float WindN;
|
||||
uniform float osg_SimulationTime;
|
||||
uniform float saturation;
|
||||
uniform int Status;
|
||||
|
||||
uniform float WaveAmp;
|
||||
uniform float WaveAngle;
|
||||
uniform float WaveDAngle;
|
||||
uniform float WaveFactor;
|
||||
uniform float WaveFreq;
|
||||
uniform float WaveSharp;
|
||||
uniform float normalmap_dds;
|
||||
|
||||
////fog "include" /////
|
||||
uniform int fogType;
|
||||
|
||||
vec3 fog_Func(vec3 color, int type);
|
||||
//////////////////////
|
||||
|
||||
const vec4 AllOnes = vec4(1.0);
|
||||
const vec4 sca = vec4(0.005, 0.005, 0.005, 0.005);
|
||||
const vec4 sca2 = vec4(0.02, 0.02, 0.02, 0.02);
|
||||
const vec4 tscale = vec4(0.25, 0.25, 0.25, 0.25);
|
||||
const float water_shininess = 240.0;
|
||||
|
||||
/////// functions /////////
|
||||
|
||||
void rotationmatrix(in float angle, out mat4 rotmat)
|
||||
{
|
||||
rotmat = mat4( cos( angle ), -sin( angle ), 0.0, 0.0,
|
||||
sin( angle ), cos( angle ), 0.0, 0.0,
|
||||
0.0 , 0.0 , 1.0, 0.0,
|
||||
0.0 , 0.0 , 0.0, 1.0 );
|
||||
}
|
||||
|
||||
// wave functions ///////////////////////
|
||||
|
||||
struct Wave {
|
||||
float freq; // 2*PI / wavelength
|
||||
float amp; // amplitude
|
||||
float phase; // speed * 2*PI / wavelength
|
||||
vec2 dir;
|
||||
};
|
||||
|
||||
Wave wave0 = Wave(1.0, 1.0, 0.5, vec2(0.97, 0.25));
|
||||
Wave wave1 = Wave(2.0, 0.5, 1.3, vec2(0.97, -0.25));
|
||||
Wave wave2 = Wave(1.0, 1.0, 0.6, vec2(0.95, -0.3));
|
||||
Wave wave3 = Wave(2.0, 0.5, 1.4, vec2(0.99, 0.1));
|
||||
|
||||
float evaluateWave(in Wave w, vec2 pos, float t)
|
||||
{
|
||||
return w.amp * sin( dot(w.dir, pos) * w.freq + t * w.phase);
|
||||
}
|
||||
|
||||
// derivative of wave function
|
||||
float evaluateWaveDeriv(Wave w, vec2 pos, float t)
|
||||
{
|
||||
return w.freq * w.amp * cos( dot(w.dir, pos)*w.freq + t*w.phase);
|
||||
}
|
||||
|
||||
// sharp wave functions
|
||||
float evaluateWaveSharp(Wave w, vec2 pos, float t, float k)
|
||||
{
|
||||
return w.amp * pow(sin( dot(w.dir, pos)*w.freq + t*w.phase)* 0.5 + 0.5 , k);
|
||||
}
|
||||
|
||||
float evaluateWaveDerivSharp(Wave w, vec2 pos, float t, float k)
|
||||
{
|
||||
return k*w.freq*w.amp * pow(sin( dot(w.dir, pos)*w.freq + t*w.phase)* 0.5 + 0.5 , k - 1.0) * cos( dot(w.dir, pos)*w.freq + t*w.phase);
|
||||
}
|
||||
|
||||
void sumWaves(float angle, float dangle, float windScale, float factor, out float ddx, out float ddy)
|
||||
{
|
||||
mat4 RotationMatrix;
|
||||
float deriv;
|
||||
vec4 P = waterTex1 * 1024.0;
|
||||
|
||||
rotationmatrix(radians(angle + dangle * windScale + 0.6 * sin(P.x * factor)), RotationMatrix);
|
||||
P *= RotationMatrix;
|
||||
|
||||
P.y += evaluateWave(wave0, P.xz, osg_SimulationTime);
|
||||
deriv = evaluateWaveDeriv(wave0, P.xz, osg_SimulationTime );
|
||||
ddx = deriv * wave0.dir.x;
|
||||
ddy = deriv * wave0.dir.y;
|
||||
|
||||
P.y += evaluateWave(wave1, P.xz, osg_SimulationTime);
|
||||
deriv = evaluateWaveDeriv(wave1, P.xz, osg_SimulationTime);
|
||||
ddx += deriv * wave1.dir.x;
|
||||
ddy += deriv * wave1.dir.y;
|
||||
|
||||
P.y += evaluateWaveSharp(wave2, P.xz, osg_SimulationTime, WaveSharp);
|
||||
deriv = evaluateWaveDerivSharp(wave2, P.xz, osg_SimulationTime, WaveSharp);
|
||||
ddx += deriv * wave2.dir.x;
|
||||
ddy += deriv * wave2.dir.y;
|
||||
|
||||
P.y += evaluateWaveSharp(wave3, P.xz, osg_SimulationTime, WaveSharp);
|
||||
deriv = evaluateWaveDerivSharp(wave3, P.xz, osg_SimulationTime, WaveSharp);
|
||||
ddx += deriv * wave3.dir.x;
|
||||
ddy += deriv * wave3.dir.y;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
mat4 RotationMatrix;
|
||||
|
||||
// compute direction to viewer
|
||||
vec3 E = normalize(viewerdir);
|
||||
|
||||
// compute direction to light source
|
||||
vec3 L = normalize(lightdir);
|
||||
|
||||
// half vector
|
||||
vec3 H = normalize(L + E);
|
||||
|
||||
vec3 Normal = normalize(normal);
|
||||
|
||||
// approximate cloud cover
|
||||
float cover = 0.0;
|
||||
//bool Status = true;
|
||||
|
||||
// try some aliasing fix for low angles
|
||||
// float viewAngle = smoothstep(0.0,0.5,abs(dot(E,Normal)));
|
||||
|
||||
// Global bathymetry texture
|
||||
vec4 topoTexel = texture2D(topo_map, TopoUV);
|
||||
vec4 mixNoise = texture3D(Noise, WorldPos.xyz * 0.00005);
|
||||
vec4 mixNoise1 = texture3D(Noise, WorldPos.xyz * 0.00008);
|
||||
float mixNoiseFactor = mixNoise.r * mixNoise.g * mixNoise.b;
|
||||
float mixNoise1Factor = mixNoise1.r * mixNoise1.g * mixNoise1.b;
|
||||
mixNoiseFactor *= 300.0;
|
||||
mixNoise1Factor *= 300.0;
|
||||
mixNoiseFactor = 0.8 + 0.2 * smoothstep(0.0,1.0, mixNoiseFactor)* smoothstep(0.0,1.0, mixNoise1Factor);
|
||||
float floorMixFactor = smoothstep(0.3, 0.985, topoTexel.a * mixNoiseFactor);
|
||||
vec3 floorColour = mix(topoTexel.rgb, mixNoise.rgb * mixNoise1.rgb, 0.3);
|
||||
|
||||
float windFloorFactor = 1.0 + 0.5 * smoothstep(0.8, 0.985, topoTexel.a);
|
||||
float windEffect = sqrt( WindE*WindE + WindN*WindN ) * 0.6; //wind speed in kt
|
||||
float windFloorEffect = windEffect * windFloorFactor;
|
||||
float windScale = 15.0/(3.0 + windEffect); //wave scale
|
||||
float windEffect_low = 0.3 + 0.7 * smoothstep(0.0, 5.0, windEffect); //low windspeed wave filter
|
||||
float waveRoughness = 0.01 + smoothstep(0.0, 40.0, windEffect); //wave roughness filter
|
||||
|
||||
float mixFactor = 0.2 + 0.02 * smoothstep(0.0, 50.0, windFloorEffect);
|
||||
mixFactor = clamp(mixFactor, 0.3, 0.95);
|
||||
|
||||
// sine waves
|
||||
//
|
||||
// Test data
|
||||
// float WaveFreq =1.0;
|
||||
// float WaveAmp = 1000.0;
|
||||
// float WaveSharp = 10.0;
|
||||
|
||||
vec4 ddxVec = vec4(0.0);
|
||||
vec4 ddyVec = vec4(0.0);
|
||||
|
||||
float ddx = 0.0, ddy = 0.0;
|
||||
float ddx1 = 0.0, ddy1 = 0.0;
|
||||
float ddx2 = 0.0, ddy2 = 0.0;
|
||||
float ddx3 = 0.0, ddy3 = 0.0;
|
||||
float waveamp;
|
||||
|
||||
float angle = 0.0;
|
||||
float WaveAmpFromDepth = WaveAmp * windFloorFactor;
|
||||
float phaseFloorFactor = 1.0 - 0.2 * smoothstep(0.8, 0.9, topoTexel.a);
|
||||
wave0.freq = WaveFreq; // * (smoothstep(0.8, 0.9, topoTexel.a)*1.5 + 0.25);
|
||||
wave0.amp = WaveAmpFromDepth;
|
||||
wave0.dir = vec2(cos(radians(angle)), sin(radians(angle)));
|
||||
wave0.phase *= phaseFloorFactor;
|
||||
|
||||
angle -= 45.0;
|
||||
wave1.freq = WaveFreq * 2.0 ;
|
||||
wave1.amp = WaveAmpFromDepth * 1.25;
|
||||
wave1.dir = vec2(cos(radians(angle)), sin(radians(angle)));
|
||||
wave1.phase *= phaseFloorFactor;
|
||||
|
||||
angle += 30.0;
|
||||
wave2.freq = WaveFreq * 3.5;
|
||||
wave2.amp = WaveAmpFromDepth * 0.75;
|
||||
wave2.dir = vec2(cos(radians(angle)), sin(radians(angle)));
|
||||
wave2.phase *= phaseFloorFactor;
|
||||
|
||||
angle -= 50.0;
|
||||
wave3.freq = WaveFreq * 3.0 ;
|
||||
wave3.amp = WaveAmpFromDepth * 0.75;
|
||||
wave3.dir = vec2(cos(radians(angle)), sin(radians(angle)));
|
||||
wave3.phase *= phaseFloorFactor;
|
||||
|
||||
// sum waves
|
||||
ddx = 0.0, ddy = 0.0;
|
||||
sumWaves(WaveAngle, -1.5, windScale, WaveFactor, ddx, ddy);
|
||||
|
||||
ddx1 = 0.0, ddy1 = 0.0;
|
||||
sumWaves(WaveAngle, 1.5, windScale, WaveFactor, ddx1, ddy1);
|
||||
|
||||
//reset the waves
|
||||
angle = 0.0;
|
||||
waveamp = WaveAmpFromDepth * 0.75;
|
||||
|
||||
wave0.freq = WaveFreq ;
|
||||
wave0.amp = waveamp;
|
||||
wave0.dir = vec2(cos(radians(angle)), sin(radians(angle)));
|
||||
|
||||
angle -= 20.0;
|
||||
wave1.freq = WaveFreq * 2.0 ;
|
||||
wave1.amp = waveamp * 1.25;
|
||||
wave1.dir = vec2(cos(radians(angle)), sin(radians(angle)));
|
||||
|
||||
angle += 35.0;
|
||||
wave2.freq = WaveFreq * 3.5;
|
||||
wave2.amp = waveamp * 0.75;
|
||||
wave2.dir = vec2(cos(radians(angle)), sin(radians(angle)));
|
||||
|
||||
angle -= 45.0;
|
||||
wave3.freq = WaveFreq * 3.0 ;
|
||||
wave3.amp = waveamp * 0.75;
|
||||
wave3.dir = vec2(cos(radians(angle)), sin(radians(angle)));
|
||||
|
||||
// sum waves
|
||||
ddx2 = 0.0, ddy2 = 0.0;
|
||||
sumWaves(WaveAngle + WaveDAngle, -1.5, windScale, WaveFactor, ddx2, ddy2);
|
||||
|
||||
ddx3 = 0.0, ddy3 = 0.0;
|
||||
sumWaves(WaveAngle + WaveDAngle, 1.5, windScale, WaveFactor, ddx3, ddy3);
|
||||
|
||||
ddxVec = vec4(ddx, ddx1, ddx2, ddx3);
|
||||
ddyVec = vec4(ddy, ddy1, ddy2, ddy3);
|
||||
|
||||
float ddxSum = dot(ddxVec, AllOnes);
|
||||
float ddySum = dot(ddyVec, AllOnes);
|
||||
|
||||
if (Status == 1){
|
||||
cover = min(min(min(min(CloudCover0, CloudCover1),CloudCover2),CloudCover3),CloudCover4);
|
||||
} else {
|
||||
// hack to allow for Overcast not to be set by Local Weather
|
||||
if (Overcast == 0.0){
|
||||
cover = 5.0;
|
||||
} else {
|
||||
cover = Overcast * 5.0;
|
||||
}
|
||||
}
|
||||
|
||||
vec4 viewt = vec4(-E, 0.0) * 0.6;
|
||||
|
||||
vec4 disdis = texture2D(water_dudvmap, vec2(waterTex2 * tscale)* windScale) * 2.0 - 1.0;
|
||||
|
||||
vec2 uvAnimSca2 = (waterTex1 + disdis * sca2).st * windScale;
|
||||
//normalmaps
|
||||
vec4 nmap = texture2D(water_normalmap, uvAnimSca2) * 2.0 - 1.0;
|
||||
vec4 nmap1 = texture2D(perlin_normalmap, uvAnimSca2) * 2.0 - 1.0;
|
||||
|
||||
rotationmatrix(radians(3.0 * sin(osg_SimulationTime * 0.0075)), RotationMatrix);
|
||||
vec2 uvAnimTscale = (waterTex2 * RotationMatrix * tscale).st * windScale;
|
||||
|
||||
nmap += texture2D(water_normalmap, uvAnimTscale) * 2.0 - 1.0;
|
||||
nmap1 += texture2D(perlin_normalmap, uvAnimTscale) * 2.0 - 1.0;
|
||||
|
||||
nmap *= windEffect_low;
|
||||
nmap1 *= windEffect_low;
|
||||
|
||||
// mix water and noise, modulated by factor
|
||||
vec4 vNorm = normalize(mix(nmap, nmap1, mixFactor) * waveRoughness);
|
||||
vNorm.r += ddxSum;
|
||||
|
||||
if (normalmap_dds > 0)
|
||||
vNorm = -vNorm; //dds fix
|
||||
|
||||
//load reflection
|
||||
vec4 tmp = vec4(lightdir, 0.0);
|
||||
vec2 refTexUV = (tmp + waterTex1).st * 32.0;
|
||||
vec4 refTex = texture2D(water_reflection, refTexUV) ;
|
||||
vec4 refTexGrey = texture2D(water_reflection_grey, refTexUV) ;
|
||||
vec4 refl = vec4(0.0,0.0,0.0,1.0) ;
|
||||
|
||||
// Test data
|
||||
// cover = 0;
|
||||
|
||||
if(cover >= 1.5){
|
||||
refl.rgb = normalize(refTex).rgb;
|
||||
}
|
||||
else
|
||||
{
|
||||
refl.rgb = normalize(refTexGrey).rgb;
|
||||
refl.r *= (0.75 + 0.15 * cover );
|
||||
refl.g *= (0.80 + 0.15 * cover );
|
||||
refl.b *= (0.875 + 0.125 * cover);
|
||||
}
|
||||
|
||||
// refl.rgb = mix(refl.rgb, floorColour, 0.99 * floorMixFactor);
|
||||
|
||||
vec4 N0 = texture2D(water_normalmap, uvAnimSca2) * 2.0 - 1.0;
|
||||
vec4 N1 = texture2D(perlin_normalmap, vec2(waterTex1 + disdis * sca) * windScale) * 2.0 - 1.0;
|
||||
|
||||
N0 += texture2D(water_normalmap, vec2(waterTex1 * tscale) * windScale) * 2.0 - 1.0;
|
||||
N1 += texture2D(perlin_normalmap, vec2(waterTex2 * tscale) * windScale) * 2.0 - 1.0;
|
||||
|
||||
|
||||
rotationmatrix(radians(2.0 * sin(osg_SimulationTime * 0.005)), RotationMatrix);
|
||||
vec2 uvAnimTscaleSca2 = (waterTex2 * RotationMatrix * (tscale + sca2)).st * windScale;
|
||||
N0 += texture2D(water_normalmap, uvAnimTscaleSca2) * 2.0 - 1.0;
|
||||
N1 += texture2D(perlin_normalmap, uvAnimTscaleSca2) * 2.0 - 1.0;
|
||||
|
||||
rotationmatrix(radians(-4.0 * sin(osg_SimulationTime * 0.003)), RotationMatrix);
|
||||
N0 += texture2D(water_normalmap, vec2(waterTex1 * RotationMatrix + disdis * sca2) * windScale) * 2.0 - 1.0;
|
||||
N1 += texture2D(perlin_normalmap, vec2(waterTex1 * RotationMatrix + disdis * sca) * windScale) * 2.0 - 1.0;
|
||||
|
||||
N0 *= windEffect_low;
|
||||
N1 *= windEffect_low;
|
||||
|
||||
N0.r += ddxSum;
|
||||
N0.g += ddySum;
|
||||
|
||||
Normal = normalize(mix(Normal + N0.rgb, Normal + N1.rgb, mixFactor) * waveRoughness);
|
||||
|
||||
if (normalmap_dds > 0)
|
||||
Normal = -Normal; //dds fix
|
||||
|
||||
float NdotH = max(0.0, dot(Normal, H));
|
||||
vec3 specular_color = vec3(gl_LightSource[0].diffuse)
|
||||
* pow(NdotH, water_shininess) * 6.0;
|
||||
vec4 specular = vec4(specular_color, 0.5);
|
||||
|
||||
specular = specular * saturation * 0.3 ;
|
||||
|
||||
//calculate fresnel
|
||||
float vNormDotViewT = dot(vNorm, viewt);
|
||||
vec4 invfres = vec4( vNormDotViewT);
|
||||
vec4 fres = vec4(1.0) + invfres;
|
||||
refl *= fres;
|
||||
|
||||
refl.rgb = mix(refl.rgb, floorColour, floorMixFactor);
|
||||
//calculate final colour
|
||||
vec4 ambient_light = gl_LightSource[0].diffuse;
|
||||
vec4 finalColor;
|
||||
|
||||
finalColor = refl + step(1.5, cover) * specular;
|
||||
|
||||
//add foam
|
||||
vec4 foam_texel = texture2D(sea_foam, (waterTex2 * tscale).st * 50.0);
|
||||
float foamSlope = 0.1 + 0.1 * windScale;
|
||||
|
||||
float waveSlope1 = Normal.g * windFloorFactor * 0.65;
|
||||
float waveSlope2 = vNorm.r * windFloorFactor * 0.3;
|
||||
float waveSlope = waveSlope1 + waveSlope2;
|
||||
|
||||
finalColor = mix(finalColor, max(finalColor, finalColor + foam_texel),
|
||||
smoothstep(7.0, 8.0, windFloorEffect)
|
||||
* step(foamSlope, waveSlope)
|
||||
* smoothstep(0.01, 0.50, waveSlope)) ;
|
||||
|
||||
finalColor *= ambient_light ;
|
||||
|
||||
finalColor.rgb = fog_Func(finalColor.rgb, fogType) ;
|
||||
gl_FragColor = finalColor ;
|
||||
}
|
|
@ -35,6 +35,7 @@
|
|||
<toggle-glide-slope>Toggle Glide Slope Tunnel</toggle-glide-slope>
|
||||
<replay>Instant Replay</replay>
|
||||
<stereoscopic-options>Stereoscopic View Options</stereoscopic-options>
|
||||
<als-filter-effects>ALS Filter Effects</als-filter-effects>
|
||||
|
||||
<!-- Location menu -->
|
||||
<location>Location</location>
|
||||
|
|
|
@ -17,19 +17,71 @@ particular list.
|
|||
-->
|
||||
|
||||
<PropertyList>
|
||||
<scenery-reload-required>
|
||||
<property></property>
|
||||
</scenery-reload-required>
|
||||
|
||||
<restart-required>
|
||||
<property></property>
|
||||
</restart-required>
|
||||
|
||||
<save-to-file>
|
||||
<property>/sim/rendering/shadows/enabled</property>
|
||||
<property>/sim/rendering/shaders/*</property>
|
||||
<property>/sim/rendering/clouds3d-enable</property>
|
||||
<!-- Rendering modes -->
|
||||
<property>/sim/rendering/shaders/skydome</property>
|
||||
<property>/sim/rendering/shaders/use-shaders</property>
|
||||
<!-- ALS shaders -->
|
||||
<property>/sim/rendering/shaders/landmass</property>
|
||||
<property>/sim/rendering/shaders/transition</property>
|
||||
<property>/sim/rendering/shaders/model</property>
|
||||
<property>/sim/rendering/shaders/water</property>
|
||||
<property>/sim/rendering/shaders/clouds</property>
|
||||
<property>/sim/rendering/shaders/wind-effects</property>
|
||||
<property>/sim/rendering/shaders/vegetation-effects</property>
|
||||
<!-- Shadows -->
|
||||
<property>/sim/rendering/shadows/enabled</property>
|
||||
<property>/sim/rendering/shadows/sun-atlas-size</property>
|
||||
<!-- Lights -->
|
||||
<property>/sim/rendering/dynamic-lighting/enabled</property>
|
||||
<property>/sim/rendering/dynamic-lighting/limit-lights</property>
|
||||
<property>/sim/rendering/dynamic-lighting/max-lights</property>
|
||||
<!-- Scenery -->
|
||||
<property>/sim/rendering/scenery-path-suffix[0]/enabled</property> <!-- Pylons -->
|
||||
<property>/sim/rendering/scenery-path-suffix[1]/enabled</property> <!-- Roads -->
|
||||
<property>/sim/rendering/scenery-path-suffix[2]/enabled</property> <!-- Buildings -->
|
||||
<property>/sim/rendering/scenery-path-suffix[3]/enabled</property> <!-- Objects -->
|
||||
<property>/sim/rendering/scenery-path-suffix[4]/enabled</property> <!-- Details -->
|
||||
<property>/sim/rendering/scenery-path-suffix[5]/enabled</property> <!-- Trees -->
|
||||
<property>/sim/rendering/osm-buildings</property>
|
||||
<property>/sim/rendering/random-objects</property>
|
||||
<property>/sim/rendering/random-buildings</property>
|
||||
<property>/sim/rendering/random-vegetation</property>
|
||||
<property>/sim/rendering/random-vegetation-shadows</property>
|
||||
<property>/sim/rendering/vegetation-density</property>
|
||||
<!-- Atmospheric Effects -->
|
||||
<property>/sim/rendering/particles</property>
|
||||
<property>/sim/rendering/precipitation-enable</property>
|
||||
<property>/sim/rendering/clouds3d-enable</property>
|
||||
</save-to-file>
|
||||
|
||||
<scenery-reload-required>
|
||||
<property>/scenery/use-vpb</property>
|
||||
<property>/scenery/elevation-mesh/lod-range-factor</property>
|
||||
<property>/scenery/elevation-mesh/constraint-gap-m</property>
|
||||
<property>/sim/rendering/photoscenery/enabled</property>
|
||||
<property>/sim/rendering/scenery-path-suffix[0]/enabled</property>
|
||||
<property>/sim/rendering/scenery-path-suffix[1]/enabled</property>
|
||||
<property>/sim/rendering/scenery-path-suffix[2]/enabled</property>
|
||||
<property>/sim/rendering/scenery-path-suffix[3]/enabled</property>
|
||||
<property>/sim/rendering/scenery-path-suffix[4]/enabled</property>
|
||||
<property>/sim/rendering/scenery-path-suffix[5]/enabled</property>
|
||||
<property>/sim/rendering/osm-buildings</property>
|
||||
<property>/sim/rendering/random-objects</property>
|
||||
<property>/sim/rendering/random-buildings</property>
|
||||
<property>/sim/rendering/random-vegetation</property>
|
||||
<property>/sim/rendering/random-vegetation-shadows</property>
|
||||
<property>/sim/rendering/vegetation-density</property>
|
||||
</scenery-reload-required>
|
||||
|
||||
<compositor-reload-required>
|
||||
<property>/sim/rendering/shadows/enabled</property>
|
||||
<property>/sim/rendering/shadows/sun-atlas-size</property>
|
||||
<property>/sim/rendering/dynamic-lighting/enabled</property>
|
||||
</compositor-reload-required>
|
||||
|
||||
<restart-required>
|
||||
</restart-required>
|
||||
|
||||
</PropertyList>
|
||||
|
|
|
@ -1,42 +1,49 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<id>high-quality</id>
|
||||
<name>High</name>
|
||||
<description>Adds more vegetation, clouds and weather effects incluing rain and snow.
|
||||
Increases fine detail of water, land and aircraft models.
|
||||
</description>
|
||||
|
||||
<description>High quality settings with the most demanding features disabled.</description>
|
||||
|
||||
<settings>
|
||||
<sim>
|
||||
<rendering>
|
||||
<shaders>
|
||||
<custom-settings type="bool">true</custom-settings>
|
||||
<generic type="float">1</generic>
|
||||
<landmass type="float">6</landmass>
|
||||
<model type="float">3</model>
|
||||
<contrails type="float">1</contrails>
|
||||
<crop type="float">1</crop>
|
||||
<skydome type="bool">true</skydome>
|
||||
<use-shaders type="bool">true</use-shaders>
|
||||
<landmass type="float">6</landmass>
|
||||
<transition type="float">6</transition>
|
||||
<urban type="float">4</urban>
|
||||
<model type="float">3</model>
|
||||
<water type="float">5</water>
|
||||
<clouds type="float">1</clouds>
|
||||
<wind-effects type="float">2</wind-effects>
|
||||
<forest type="float">1</forest>
|
||||
<lights type="float">1</lights>
|
||||
<quality-level-internal type="float">1</quality-level-internal>
|
||||
<vegetation-effects type="float">0</vegetation-effects>
|
||||
</shaders>
|
||||
<clouds3d-enable type="bool">true</clouds3d-enable>
|
||||
<shadows>
|
||||
<enabled type="bool">true</enabled>
|
||||
<sun-atlas-size type="int">4096</sun-atlas-size>
|
||||
</shadows>
|
||||
<foobar type="int">43</foobar>
|
||||
<dynamic-lighting>
|
||||
<enabled type="bool">true</enabled>
|
||||
<limit-lights type="bool">false</limit-lights>
|
||||
<max-lights type="int">0</max-lights>
|
||||
</dynamic-lighting>
|
||||
<scenery-path-suffix n="0"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="1"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="2"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="3"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="4"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="5"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<osm-buildings type="bool">true</osm-buildings>
|
||||
<random-objects type="bool">true</random-objects>
|
||||
<random-buildings type="bool">false</random-buildings>
|
||||
<random-vegetation type="bool">true</random-vegetation>
|
||||
<random-vegetation-shadows type="bool">true</random-vegetation-shadows>
|
||||
<vegetation-density type="float">2.0</vegetation-density>
|
||||
<particles type="bool">true</particles>
|
||||
<precipitation-enable type="bool">true</precipitation-enable>
|
||||
<clouds3d-enable type="bool">true</clouds3d-enable>
|
||||
</rendering>
|
||||
</sim>
|
||||
</settings>
|
||||
|
||||
|
||||
</PropertyList>
|
||||
|
||||
|
|
|
@ -1,40 +1,51 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<id>low-quality</id>
|
||||
<name>Low</name>
|
||||
<description>Basic settings for very low-power laptops. Clouds will be
|
||||
shown as simple layers, and distant objects will not be visible.
|
||||
</description>
|
||||
<description>Prioritize performance over eye candy.</description>
|
||||
|
||||
<settings>
|
||||
<sim>
|
||||
<rendering>
|
||||
<shaders>
|
||||
<custom-settings type="bool">true</custom-settings>
|
||||
<generic type="float">1</generic>
|
||||
<landmass type="float">6</landmass>
|
||||
<model type="float">3</model>
|
||||
<contrails type="float">1</contrails>
|
||||
<crop type="float">1</crop>
|
||||
<skydome type="bool">true</skydome>
|
||||
<transition type="float">6</transition>
|
||||
<urban type="float">4</urban>
|
||||
<water type="float">5</water>
|
||||
<wind-effects type="float">2</wind-effects>
|
||||
<forest type="float">1</forest>
|
||||
<lights type="float">1</lights>
|
||||
<quality-level-internal type="float">1</quality-level-internal>
|
||||
<use-shaders type="bool">true</use-shaders>
|
||||
<landmass type="float">3</landmass>
|
||||
<transition type="float">2</transition>
|
||||
<model type="float">0</model>
|
||||
<water type="float">4</water>
|
||||
<clouds type="float">0</clouds>
|
||||
<wind-effects type="float">0</wind-effects>
|
||||
<vegetation-effects type="float">0</vegetation-effects>
|
||||
</shaders>
|
||||
<clouds3d-enable type="bool">true</clouds3d-enable>
|
||||
<shadows>
|
||||
<enabled type="bool">true</enabled>
|
||||
<sun-atlas-size type="int">1024</sun-atlas-size>
|
||||
</shadows>
|
||||
<dynamic-lighting>
|
||||
<enabled type="bool">true</enabled>
|
||||
<limit-lights type="bool">true</limit-lights>
|
||||
<max-lights type="int">8</max-lights>
|
||||
</dynamic-lighting>
|
||||
<scenery-path-suffix n="0"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="1"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="2"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="3"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="4"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="5"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<osm-buildings type="bool">false</osm-buildings>
|
||||
<random-objects type="bool">true</random-objects>
|
||||
<random-buildings type="bool">false</random-buildings>
|
||||
<random-vegetation type="bool">true</random-vegetation>
|
||||
<random-vegetation-shadows type="bool">false</random-vegetation-shadows>
|
||||
<vegetation-density type="float">0.5</vegetation-density>
|
||||
<particles type="bool">true</particles>
|
||||
<precipitation-enable type="bool">true</precipitation-enable>
|
||||
<clouds3d-enable type="bool">true</clouds3d-enable>
|
||||
</rendering>
|
||||
</sim>
|
||||
</settings>
|
||||
|
||||
|
||||
</PropertyList>
|
||||
|
||||
|
||||
|
|
|
@ -1,43 +1,49 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
|
||||
<id>medium-quality</id>
|
||||
<name>Medium</name>
|
||||
<description>Tradeoff between visual quality and performance: 3D clouds and
|
||||
vegetation are enabled, along with some scenery objects, but the quantity
|
||||
and quality are restricted to work on older computers and laptops.
|
||||
</description>
|
||||
|
||||
<description>A nice tradeoff between performance and eye candy.</description>
|
||||
|
||||
<settings>
|
||||
<sim>
|
||||
<rendering>
|
||||
<shaders>
|
||||
<custom-settings type="bool">true</custom-settings>
|
||||
<generic type="float">1</generic>
|
||||
<landmass type="float">6</landmass>
|
||||
<model type="float">3</model>
|
||||
<contrails type="float">1</contrails>
|
||||
<crop type="float">1</crop>
|
||||
<skydome type="bool">true</skydome>
|
||||
<transition type="float">6</transition>
|
||||
<urban type="float">4</urban>
|
||||
<water type="float">5</water>
|
||||
<use-shaders type="bool">true</use-shaders>
|
||||
<landmass type="float">4</landmass>
|
||||
<transition type="float">4</transition>
|
||||
<model type="float">3</model>
|
||||
<water type="float">4</water>
|
||||
<clouds type="float">1</clouds>
|
||||
<wind-effects type="float">2</wind-effects>
|
||||
<forest type="float">1</forest>
|
||||
<lights type="float">1</lights>
|
||||
<quality-level-internal type="float">1</quality-level-internal>
|
||||
<vegetation-effects type="float">0</vegetation-effects>
|
||||
</shaders>
|
||||
<clouds3d-enable type="bool">true</clouds3d-enable>
|
||||
<shadows>
|
||||
<enabled type="bool">true</enabled>
|
||||
<sun-atlas-size type="int">2048</sun-atlas-size>
|
||||
</shadows>
|
||||
<foobar type="int">42</foobar>
|
||||
<dynamic-lighting>
|
||||
<enabled type="bool">true</enabled>
|
||||
<limit-lights type="bool">false</limit-lights>
|
||||
<max-lights type="int">0</max-lights>
|
||||
</dynamic-lighting>
|
||||
<scenery-path-suffix n="0"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="1"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="2"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="3"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="4"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="5"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<osm-buildings type="bool">false</osm-buildings>
|
||||
<random-objects type="bool">true</random-objects>
|
||||
<random-buildings type="bool">false</random-buildings>
|
||||
<random-vegetation type="bool">true</random-vegetation>
|
||||
<random-vegetation-shadows type="bool">true</random-vegetation-shadows>
|
||||
<vegetation-density type="float">1.0</vegetation-density>
|
||||
<particles type="bool">true</particles>
|
||||
<precipitation-enable type="bool">true</precipitation-enable>
|
||||
<clouds3d-enable type="bool">true</clouds3d-enable>
|
||||
</rendering>
|
||||
</sim>
|
||||
</settings>
|
||||
|
||||
|
||||
</PropertyList>
|
||||
|
||||
|
|
49
Video/minimal-quality-preset.xml
Normal file
49
Video/minimal-quality-preset.xml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
<id>minimal-quality</id>
|
||||
<name>Minimal</name>
|
||||
<description>Minimal settings for low-power laptops or very old systems.</description>
|
||||
|
||||
<settings>
|
||||
<sim>
|
||||
<rendering>
|
||||
<shaders>
|
||||
<skydome type="bool">false</skydome>
|
||||
<use-shaders type="bool">false</use-shaders>
|
||||
<landmass type="float">0</landmass>
|
||||
<transition type="float">0</transition>
|
||||
<model type="float">0</model>
|
||||
<water type="float">0</water>
|
||||
<clouds type="float">0</clouds>
|
||||
<wind-effects type="float">0</wind-effects>
|
||||
<vegetation-effects type="float">0</vegetation-effects>
|
||||
</shaders>
|
||||
<shadows>
|
||||
<enabled type="bool">false</enabled>
|
||||
<sun-atlas-size type="int">1024</sun-atlas-size>
|
||||
</shadows>
|
||||
<dynamic-lighting>
|
||||
<enabled type="bool">false</enabled>
|
||||
<limit-lights type="bool">false</limit-lights>
|
||||
<max-lights type="int">0</max-lights>
|
||||
</dynamic-lighting>
|
||||
<scenery-path-suffix n="0"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="1"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="2"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="3"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="4"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="5"><enabled type="bool">false</enabled></scenery-path-suffix>
|
||||
<osm-buildings type="bool">false</osm-buildings>
|
||||
<random-objects type="bool">false</random-objects>
|
||||
<random-buildings type="bool">false</random-buildings>
|
||||
<random-vegetation type="bool">false</random-vegetation>
|
||||
<random-vegetation-shadows type="bool">false</random-vegetation-shadows>
|
||||
<vegetation-density type="float">0.0</vegetation-density>
|
||||
<particles type="bool">false</particles>
|
||||
<precipitation-enable type="bool">false</precipitation-enable>
|
||||
<clouds3d-enable type="bool">false</clouds3d-enable>
|
||||
</rendering>
|
||||
</sim>
|
||||
</settings>
|
||||
</PropertyList>
|
49
Video/ultra-quality-preset.xml
Normal file
49
Video/ultra-quality-preset.xml
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
<id>ultra-quality</id>
|
||||
<name>Ultra</name>
|
||||
<description>Maximum settings for very powerful systems.</description>
|
||||
|
||||
<settings>
|
||||
<sim>
|
||||
<rendering>
|
||||
<shaders>
|
||||
<skydome type="bool">true</skydome>
|
||||
<use-shaders type="bool">true</use-shaders>
|
||||
<landmass type="float">6</landmass>
|
||||
<transition type="float">6</transition>
|
||||
<model type="float">3</model>
|
||||
<water type="float">5</water>
|
||||
<clouds type="float">1</clouds>
|
||||
<wind-effects type="float">2</wind-effects>
|
||||
<vegetation-effects type="float">1</vegetation-effects>
|
||||
</shaders>
|
||||
<shadows>
|
||||
<enabled type="bool">true</enabled>
|
||||
<sun-atlas-size type="int">8192</sun-atlas-size>
|
||||
</shadows>
|
||||
<dynamic-lighting>
|
||||
<enabled type="bool">true</enabled>
|
||||
<limit-lights type="bool">false</limit-lights>
|
||||
<max-lights type="int">0</max-lights>
|
||||
</dynamic-lighting>
|
||||
<scenery-path-suffix n="0"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="1"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="2"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="3"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="4"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<scenery-path-suffix n="5"><enabled type="bool">true</enabled></scenery-path-suffix>
|
||||
<osm-buildings type="bool">true</osm-buildings>
|
||||
<random-objects type="bool">true</random-objects>
|
||||
<random-buildings type="bool">false</random-buildings>
|
||||
<random-vegetation type="bool">true</random-vegetation>
|
||||
<random-vegetation-shadows type="bool">true</random-vegetation-shadows>
|
||||
<vegetation-density type="float">4.0</vegetation-density>
|
||||
<particles type="bool">true</particles>
|
||||
<precipitation-enable type="bool">true</precipitation-enable>
|
||||
<clouds3d-enable type="bool">true</clouds3d-enable>
|
||||
</rendering>
|
||||
</sim>
|
||||
</settings>
|
||||
</PropertyList>
|
|
@ -65,22 +65,14 @@ Started September 2000 by David Megginson, david@megginson.com
|
|||
<realism type="int">5</realism>
|
||||
<filtering type="int">8</filtering>
|
||||
<shaders>
|
||||
<custom-settings type="bool" userarchive="y">false</custom-settings>
|
||||
<clouds type="float" userarchive="y">0.0</clouds>
|
||||
<generic type="float" userarchive="y">1.0</generic>
|
||||
<landmass type="float" userarchive="y">1.0</landmass>
|
||||
<model type="float" userarchive="y">1.0</model>
|
||||
<contrails type="float" userarchive="y">1.0</contrails>
|
||||
<crop type="float" userarchive="y">1.0</crop>
|
||||
<skydome type="bool" userarchive="y">true</skydome>
|
||||
<transition type="float" userarchive="y">1.0</transition>
|
||||
<urban type="float" userarchive="y">1.0</urban>
|
||||
<water type="float" userarchive="y">1.0</water>
|
||||
<wind-effects type="float" userarchive="y">0.0</wind-effects>
|
||||
<vegetation-effects type="float" userarchive="y">0.0</vegetation-effects>
|
||||
<forest type="float" userarchive="y">0.0</forest>
|
||||
<lights type="float" userarchive="y">1.0</lights>
|
||||
<quality-level-internal type="float" userarchive="y">1.0</quality-level-internal>
|
||||
</shaders>
|
||||
<mie type="float" userarchive="y">0.003</mie>
|
||||
<rayleigh type="float" userarchive="y">0.0003</rayleigh>
|
||||
|
|
1325
gui/dialogs/advanced-graphics-options.xml
Normal file
1325
gui/dialogs/advanced-graphics-options.xml
Normal file
File diff suppressed because it is too large
Load diff
|
@ -406,17 +406,6 @@
|
|||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<legend>Back</legend>
|
||||
<binding>
|
||||
<command>dialog-show</command>
|
||||
<dialog-name>rendering</dialog-name>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
|
||||
<button>
|
||||
<legend>Close</legend>
|
||||
<default>true</default>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,419 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
<name>shaders-lightfield</name>
|
||||
<modal>false</modal>
|
||||
<layout>vbox</layout>
|
||||
<padding>20</padding>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<empty>
|
||||
<stretch>1</stretch>
|
||||
</empty>
|
||||
|
||||
<text>
|
||||
<label>Shader options</label>
|
||||
</text>
|
||||
|
||||
<empty>
|
||||
<stretch>1</stretch>
|
||||
</empty>
|
||||
|
||||
<button>
|
||||
<pref-width>16</pref-width>
|
||||
<pref-height>16</pref-height>
|
||||
<legend></legend>
|
||||
<keynum>27</keynum>
|
||||
<border>2</border>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
</group>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<text>
|
||||
<label>General</label>
|
||||
<halign>left</halign>
|
||||
</text>
|
||||
<hrule>
|
||||
<stretch>true</stretch>
|
||||
</hrule>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>right</halign>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Clouds</label>
|
||||
</text>
|
||||
<slider>
|
||||
<name>cloud</name>
|
||||
<min>0.0</min>
|
||||
<max>1.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/clouds</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>cloud</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
<empty>
|
||||
<pref-width>55</pref-width>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>right</halign>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Landmass</label>
|
||||
</text>
|
||||
<slider>
|
||||
<name>landmass</name>
|
||||
<min>0.0</min>
|
||||
<max>6.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/landmass</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>landmass</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
<empty>
|
||||
<pref-width>55</pref-width>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>right</halign>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Transition</label>
|
||||
</text>
|
||||
<slider>
|
||||
<name>transition</name>
|
||||
<min>0.0</min>
|
||||
<max>6.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/transition</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>transition</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
<empty>
|
||||
<pref-width>55</pref-width>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>right</halign>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Urban</label>
|
||||
</text>
|
||||
<slider>
|
||||
<name>urban</name>
|
||||
<min>0.0</min>
|
||||
<max>5.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/urban</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>urban</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
<empty>
|
||||
<pref-width>55</pref-width>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>right</halign>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Agriculture</label>
|
||||
</text>
|
||||
<slider>
|
||||
<name>agriculture</name>
|
||||
<min>0.0</min>
|
||||
<max>1.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/crop</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>agriculture</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
<empty>
|
||||
<pref-width>55</pref-width>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>right</halign>
|
||||
<text>
|
||||
<label>Water</label>
|
||||
</text>
|
||||
<slider>
|
||||
<name>water</name>
|
||||
<min>0.0</min>
|
||||
<max>5.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/water</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>water</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
<empty>
|
||||
<pref-width>55</pref-width>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>right</halign>
|
||||
<text>
|
||||
<label>Model</label>
|
||||
</text>
|
||||
<slider>
|
||||
<name>model</name>
|
||||
<min>0.0</min>
|
||||
<max>3.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/model</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>model</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
<empty>
|
||||
<pref-width>55</pref-width>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>right</halign>
|
||||
<text>
|
||||
<label>Forest</label>
|
||||
</text>
|
||||
<slider>
|
||||
<name>forest</name>
|
||||
<min>0.0</min>
|
||||
<max>1.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/forest</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>forest</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
<empty>
|
||||
<pref-width>55</pref-width>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>right</halign>
|
||||
<text>
|
||||
<label>Wind Effects</label>
|
||||
</text>
|
||||
<slider>
|
||||
<name>wind</name>
|
||||
<min>0.0</min>
|
||||
<max>2.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/wind-effects</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>wind</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
<empty>
|
||||
<pref-width>55</pref-width>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<halign>right</halign>
|
||||
<text>
|
||||
<label>Overlay</label>
|
||||
</text>
|
||||
<slider>
|
||||
<name>vegetation</name>
|
||||
<min>0.0</min>
|
||||
<max>1.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/vegetation-effects</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>vegetation</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
<empty>
|
||||
<pref-width>55</pref-width>
|
||||
</empty>
|
||||
</group>
|
||||
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<text>
|
||||
<label>Aircraft</label>
|
||||
<halign>left</halign>
|
||||
</text>
|
||||
<hrule>
|
||||
<stretch>true</stretch>
|
||||
</hrule>
|
||||
</group>
|
||||
|
||||
<nasal>
|
||||
<open>
|
||||
if (props.globals.getNode("/sim/rendering/shaders/aircraft") != nil) {
|
||||
var group = cmdarg().getChildren("group")[11];
|
||||
group.removeChildren("slider");
|
||||
group.removeChildren("hrule");
|
||||
group.removeChildren("text");
|
||||
var shaders = props.globals.getNode("/sim/rendering/shaders/aircraft").getChildren();
|
||||
for(i=0; size(shaders) > i; i+=1) {
|
||||
|
||||
var fraction = 0.5;
|
||||
var min = 0;
|
||||
var max = 1;
|
||||
var step = 1;
|
||||
|
||||
var name = shaders[i].getNode("name");
|
||||
|
||||
if (shaders[i].getNode("step") != nil){
|
||||
step = shaders[i].getNode("step");
|
||||
}
|
||||
if (shaders[i].getNode("min") != nil){
|
||||
min = shaders[i].getNode("min");
|
||||
}
|
||||
if (shaders[i].getNode("max") != nil){
|
||||
max = shaders[i].getNode("max");
|
||||
}
|
||||
|
||||
if (min != nil and max != nil and step != nil){
|
||||
fraction = step/(max+step);
|
||||
}
|
||||
|
||||
var target = group.getChild("slider", i, 1);
|
||||
props.copy(group.getNode("slider-template"), target);
|
||||
target.getNode("label").setValue(name != nil ? name.getValue() : (shaders[i].getName()));
|
||||
target.getNode("name").setValue("aircraftshader"~i);
|
||||
target.getNode("binding").getNode("object-name").setValue("aircraftshader"~i);
|
||||
target.getNode("min").setValue(min);
|
||||
target.getNode("max").setValue(max);
|
||||
target.getNode("step").setValue(step);
|
||||
target.getNode("fraction").setValue(fraction);
|
||||
target.getNode("property").setValue(shaders[i].getPath()~"/quality-level");
|
||||
}
|
||||
}
|
||||
|
||||
</open>
|
||||
</nasal>
|
||||
|
||||
<group>
|
||||
<layout>vbox</layout>
|
||||
<halign>left</halign>
|
||||
|
||||
<slider-template>
|
||||
<name>
|
||||
<!---->
|
||||
</name>
|
||||
<label>
|
||||
<!---->
|
||||
</label>
|
||||
<min>
|
||||
<!---->
|
||||
</min>
|
||||
<max>
|
||||
<!---->
|
||||
</max>
|
||||
<step>
|
||||
<!---->
|
||||
</step>
|
||||
<fraction>
|
||||
<!---->
|
||||
</fraction>
|
||||
<property>
|
||||
<!---->
|
||||
</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>
|
||||
<!---->
|
||||
</object-name>
|
||||
</binding>
|
||||
</slider-template>
|
||||
</group>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
|
||||
<button>
|
||||
<legend>Back</legend>
|
||||
<binding>
|
||||
<command>dialog-show</command>
|
||||
<dialog-name>rendering</dialog-name>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
<button>
|
||||
<legend>Close</legend>
|
||||
<default>true</default>
|
||||
<key>Esc</key>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
</group>
|
||||
|
||||
</PropertyList>
|
|
@ -1,435 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<PropertyList>
|
||||
<name>shaders</name>
|
||||
<modal>false</modal>
|
||||
<layout>vbox</layout>
|
||||
<padding>20</padding>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<empty>
|
||||
<stretch>1</stretch>
|
||||
</empty>
|
||||
|
||||
<text>
|
||||
<label>Shader options</label>
|
||||
</text>
|
||||
|
||||
<empty>
|
||||
<stretch>1</stretch>
|
||||
</empty>
|
||||
|
||||
<button>
|
||||
<pref-width>16</pref-width>
|
||||
<pref-height>16</pref-height>
|
||||
<legend></legend>
|
||||
<keynum>27</keynum>
|
||||
<border>2</border>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
</group>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<text>
|
||||
<label>General</label>
|
||||
<halign>left</halign>
|
||||
</text>
|
||||
<hrule>
|
||||
<stretch>true</stretch>
|
||||
</hrule>
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
|
||||
<group>
|
||||
<layout>vbox</layout>
|
||||
<halign>left</halign>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Generic</label>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Crop</label>
|
||||
<enable>
|
||||
<not>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</not>
|
||||
</enable>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Landmass</label>
|
||||
<enable>
|
||||
<not>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</not>
|
||||
</enable>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Persistent contrails</label>
|
||||
<enable>
|
||||
<not>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</not>
|
||||
</enable>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Transition</label>
|
||||
<enable>
|
||||
<or>
|
||||
<not>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</not>
|
||||
<equals>
|
||||
<property>/sim/rendering/materials-file</property>
|
||||
<value>Materials/dds/materials.xml</value>
|
||||
</equals>
|
||||
</or>
|
||||
</enable>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Model</label>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Urban</label>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Water</label>
|
||||
</text>
|
||||
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>Lights</label>
|
||||
<enable>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</enable>
|
||||
</text>
|
||||
|
||||
</group>
|
||||
|
||||
<group>
|
||||
<layout>vbox</layout>
|
||||
|
||||
<slider>
|
||||
<name>generic</name>
|
||||
<min>0.0</min>
|
||||
<max>1.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.5</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/generic</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>generic</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
|
||||
<slider>
|
||||
<name>crop</name>
|
||||
<enable>
|
||||
<not>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</not>
|
||||
</enable>
|
||||
<min>0.0</min>
|
||||
<max>1.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.5</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/crop</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>crop</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
|
||||
<slider>
|
||||
<name>landmass</name>
|
||||
<enable>
|
||||
<not>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</not>
|
||||
</enable>
|
||||
<min>0.0</min>
|
||||
<max>5.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/landmass</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>landmass</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
|
||||
<slider>
|
||||
<name>contrails</name>
|
||||
<enable>
|
||||
<not>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</not>
|
||||
</enable>
|
||||
<min>0.0</min>
|
||||
<max>1.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.5</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/contrails</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>contrails</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
|
||||
<slider>
|
||||
<name>transition</name>
|
||||
<enable>
|
||||
<or>
|
||||
<not>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</not>
|
||||
<equals>
|
||||
<property>/sim/rendering/materials-file</property>
|
||||
<value>Materials/dds/materials.xml</value>
|
||||
</equals>
|
||||
</or>
|
||||
</enable>
|
||||
<min>0.0</min>
|
||||
<max>1.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.5</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/transition</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>transition</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
|
||||
<slider>
|
||||
<name>model</name>
|
||||
<min>0.0</min>
|
||||
<max>1.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.5</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/model</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>model</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
|
||||
<slider>
|
||||
<name>urban</name>
|
||||
<min>0.0</min>
|
||||
<max>5.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/urban</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>urban</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
|
||||
<slider>
|
||||
<name>water</name>
|
||||
<min>0.0</min>
|
||||
<max>5.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.17</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/water</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>water</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
|
||||
<slider>
|
||||
<name>lights</name>
|
||||
<enable>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</enable>
|
||||
<min>0.0</min>
|
||||
<max>4.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.2</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/lights</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>lights</object-name>
|
||||
</binding>
|
||||
</slider>
|
||||
|
||||
</group>
|
||||
|
||||
</group>
|
||||
|
||||
<text>
|
||||
<label>Some shaders are disabled because</label>
|
||||
<color>
|
||||
<red>1.0</red>
|
||||
<green>0.6</green>
|
||||
<blue>0.6</blue>
|
||||
</color>
|
||||
<visible>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</visible>
|
||||
</text>
|
||||
<text>
|
||||
<halign>left</halign>
|
||||
<label>you have Rembrandt enabled.</label>
|
||||
<color>
|
||||
<red>1.0</red>
|
||||
<green>0.6</green>
|
||||
<blue>0.6</blue>
|
||||
</color>
|
||||
<visible>
|
||||
<property>/sim/rendering/rembrandt/enabled</property>
|
||||
</visible>
|
||||
</text>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
<text>
|
||||
<label>Aircraft</label>
|
||||
<halign>left</halign>
|
||||
</text>
|
||||
<hrule>
|
||||
<stretch>true</stretch>
|
||||
</hrule>
|
||||
</group>
|
||||
|
||||
<nasal>
|
||||
<open>
|
||||
if (props.globals.getNode("/sim/rendering/shaders/aircraft") != nil) {
|
||||
var group = cmdarg().getChildren("group")[4];
|
||||
group.removeChildren("slider");
|
||||
group.removeChildren("hrule");
|
||||
group.removeChildren("text");
|
||||
var shaders = props.globals.getNode("/sim/rendering/shaders/aircraft").getChildren();
|
||||
for(i=0; size(shaders) > i; i+=1) {
|
||||
|
||||
var fraction = 0.5;
|
||||
var min = 0;
|
||||
var max = 1;
|
||||
var step = 1;
|
||||
|
||||
var name = shaders[i].getNode("name");
|
||||
|
||||
if (shaders[i].getNode("step") != nil){
|
||||
step = shaders[i].getNode("step");
|
||||
}
|
||||
if (shaders[i].getNode("min") != nil){
|
||||
min = shaders[i].getNode("min");
|
||||
}
|
||||
if (shaders[i].getNode("max") != nil){
|
||||
max = shaders[i].getNode("max");
|
||||
}
|
||||
|
||||
if (min != nil and max != nil and step != nil){
|
||||
fraction = step/(max+step);
|
||||
}
|
||||
|
||||
var target = group.getChild("slider", i, 1);
|
||||
props.copy(group.getNode("slider-template"), target);
|
||||
target.getNode("label").setValue(name != nil ? name.getValue() : (shaders[i].getName()));
|
||||
target.getNode("name").setValue("aircraftshader"~i);
|
||||
target.getNode("binding").getNode("object-name").setValue("aircraftshader"~i);
|
||||
target.getNode("min").setValue(min);
|
||||
target.getNode("max").setValue(max);
|
||||
target.getNode("step").setValue(step);
|
||||
target.getNode("fraction").setValue(fraction);
|
||||
target.getNode("property").setValue(shaders[i].getPath()~"/quality-level");
|
||||
}
|
||||
}
|
||||
|
||||
</open>
|
||||
</nasal>
|
||||
|
||||
<group>
|
||||
<layout>vbox</layout>
|
||||
<halign>left</halign>
|
||||
|
||||
<slider-template>
|
||||
<name>
|
||||
<!---->
|
||||
</name>
|
||||
<label>
|
||||
<!---->
|
||||
</label>
|
||||
<min>
|
||||
<!---->
|
||||
</min>
|
||||
<max>
|
||||
<!---->
|
||||
</max>
|
||||
<step>
|
||||
<!---->
|
||||
</step>
|
||||
<fraction>
|
||||
<!---->
|
||||
</fraction>
|
||||
<property>
|
||||
<!---->
|
||||
</property>
|
||||
<binding>
|
||||
<command>dialog-apply</command>
|
||||
<object-name>
|
||||
<!---->
|
||||
</object-name>
|
||||
</binding>
|
||||
</slider-template>
|
||||
</group>
|
||||
|
||||
<hrule/>
|
||||
|
||||
<group>
|
||||
<layout>hbox</layout>
|
||||
|
||||
<button>
|
||||
<legend>Back</legend>
|
||||
<binding>
|
||||
<command>dialog-show</command>
|
||||
<dialog-name>rendering</dialog-name>
|
||||
</binding>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
<button>
|
||||
<legend>Close</legend>
|
||||
<default>true</default>
|
||||
<key>Esc</key>
|
||||
<binding>
|
||||
<command>dialog-close</command>
|
||||
</binding>
|
||||
</button>
|
||||
</group>
|
||||
|
||||
</PropertyList>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue