1
0
Fork 0

Fix Building share when model shader off.

This commit is contained in:
Stuart Buchanan 2020-01-27 13:38:22 +00:00
parent 6e30ada029
commit 5a0fc45853
2 changed files with 137 additions and 303 deletions

View file

@ -379,3 +379,19 @@ application:
in order to maintain backward compatibility.
Model Hierarchy
---------------
There are a large number of techniques used by the models, with complex
inheritance. Here is a handy list of the techniques, what they are for, and
where the based technique is defined
# Where Defined Summary
4 model-combined.xml ALS, quality>0, model>0
5 model-defaults.xml Base ALS
7 model-combined-deferred.xml Rembrandt, model>0
9 model-combined.xml quality>0, model>0
10 model-defaults.xml Base Rembrandt
11 model-defaults.xml Generic shaders, quality>0
13 model-defaults.xml Fallback - no predicate

View file

@ -114,66 +114,29 @@
<!-- END fog include -->
<building-flag type="int">1</building-flag>
</parameters>
<!-- Atmospheric scattering technique with model shader-->
<technique n="4">
<!-- Atmospheric scattering technique with model shader-->
<predicate>
<and>
<property>/sim/rendering/shaders/skydome</property>
<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>
<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>
<emissive><use>material/emissive</use></emissive>
<shininess><use>material/shininess</use></shininess>
<color-mode>ambient-and-diffuse</color-mode>
</material>
<alpha-test>false</alpha-test>
<shade-model>flat</shade-model>
<cull-face>back</cull-face>
<render-bin>
<bin-number>-1</bin-number>
<bin-name>RenderBin</bin-name>
</render-bin>
<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>
<program>
<vertex-shader>Shaders/building-default.vert</vertex-shader>
<fragment-shader>Shaders/trivial.frag</fragment-shader>
</program>
<uniform>
<name>texture</name>
<type>sampler-2d</type>
<value type="int">0</value>
</uniform>
<color-mask type="vec4d">0 0 0 0</color-mask>
</pass>-->
</predicate>
<pass>
<texture-unit n="4">
<unit>4</unit>
@ -198,11 +161,6 @@
</texture-unit>
<program>
<vertex-shader n="0">Shaders/building-model-ALS-ultra.vert</vertex-shader>
<!--<fragment-shader n="0">Shaders/model-ALS-ultra.frag</fragment-shader>
<fragment-shader n="1">Shaders/cloud-shadowfunc.frag</fragment-shader>
<fragment-shader n="2">Shaders/hazes.frag</fragment-shader>
<fragment-shader n="3">Shaders/secondary_lights.frag</fragment-shader>
<fragment-shader n="4">Shaders/filters-ALS.frag</fragment-shader>-->
<attribute>
<name>instancePosition</name>
<index>10</index>
@ -231,8 +189,8 @@
</pass>
</technique>
<!-- Atmospheric scattering technique -->
<technique n="5">
<!-- Base Atmospheric scattering technique -->
<predicate>
<and>
<property>/sim/rendering/shaders/skydome</property>
@ -250,130 +208,7 @@
</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>
<emissive><use>material/emissive</use></emissive>
<shininess><use>material/shininess</use></shininess>
<color-mode>ambient-and-diffuse</color-mode>
</material>
<alpha-test>false</alpha-test>
<shade-model>flat</shade-model>
<cull-face>back</cull-face>
<render-bin>
<bin-number>-1</bin-number>
<bin-name>RenderBin</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>
<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 n="0">Shaders/include_fog.vert</vertex-shader>-->
<!--<vertex-shader n="1">Shaders/building-default.vert</vertex-shader>-->
<vertex-shader>Shaders/building-default.vert</vertex-shader>
<fragment-shader>Shaders/trivial.frag</fragment-shader>
<!--<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
<fragment-shader n="1">Shaders/terrain-nocolor.frag</fragment-shader>-->
<attribute>
<name>instancePosition</name>
<index>10</index>
</attribute>
<attribute>
<name>instanceScale</name>
<index>11</index>
</attribute>
<attribute>
<name>rotPitchWtexX0</name>
<index>12</index>
</attribute>
<attribute>
<name>wtexY0FRtexx1FSRtexY1</name>
<index>13</index>
</attribute>
<attribute>
<name>rtexX0RtexY0StexX1</name>
<index>14</index>
</attribute>
<attribute>
<name>rooftopscale</name>
<index>15</index>
</attribute>
</program>
<uniform>
<name>texture</name>
<type>sampler-2d</type>
<value type="int">0</value>
</uniform>
<uniform>
<name>dataBuffer</name>
<type>sampler-1d</type>
<value type="int">1</value>
</uniform>
<color-mask type="vec4d">0 0 0 0</color-mask>
</pass>
<pass>
<lighting>true</lighting>
<material>
<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>ambient-and-diffuse</color-mode>
</material>
<blend>false</blend>
<alpha-test>false</alpha-test>
<shade-model>flat</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>
<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/building-ALS.vert</vertex-shader>
<fragment-shader>Shaders/terrain-ALS-base.frag</fragment-shader>
@ -405,84 +240,11 @@
<index>15</index>
</attribute>
</program>
<uniform>
<name>visibility</name>
<type>float</type>
<value><use>visibility</use></value>
</uniform>
<uniform>
<name>avisibility</name>
<type>float</type>
<value><use>avisibility</use></value>
</uniform>
<uniform>
<name>hazeLayerAltitude</name>
<type>float</type>
<value><use>lthickness</use></value>
</uniform>
<uniform>
<name>scattering</name>
<type>float</type>
<value><use>scattering</use></value>
</uniform>
<uniform>
<name>ground_scattering</name>
<type>float</type>
<value><use>ground_scattering</use></value>
</uniform>
<uniform>
<name>terminator</name>
<type>float</type>
<value><use>terminator</use></value>
</uniform>
<uniform>
<name>terrain_alt</name>
<type>float</type>
<value><use>terrain_alt</use></value>
</uniform>
<uniform>
<name>overcast</name>
<type>float</type>
<value><use>overcast</use></value>
</uniform>
<uniform>
<name>eye_alt</name>
<type>float</type>
<value><use>eye_alt</use></value>
</uniform>
<uniform>
<name>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>texture</name>
<type>sampler-2d</type>
<value type="int">0</value>
</uniform>
<uniform>
<name>dataBuffer</name>
<type>sampler-1d</type>
<value type="int">1</value>
</uniform>
<uniform>
<name>colorMode</name>
<type>int</type>
<value>2</value> <!-- AMBIENT_AND_DIFFUSE -->
</uniform>
<depth>
<function>lequal</function>
<write-mask type="bool">false</write-mask>
</depth>
</pass>
</technique>
<technique n="7">
<!-- Model and Rembrandt -->
<pass>
<material>
<active>true</active>
@ -547,6 +309,7 @@
</technique>
<technique n="9">
<!-- Model shader, quality > 0 -->
<pass>
<material>
<active>true</active>
@ -610,7 +373,110 @@
</pass>
</technique>
<technique n="12">
<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>rotPitchWtexX0</name>
<index>12</index>
</attribute>
<attribute>
<name>wtexY0FRtexx1FSRtexY1</name>
<index>13</index>
</attribute>
<attribute>
<name>rtexX0RtexY0StexX1</name>
<index>14</index>
</attribute>
<attribute>
<name>rooftopscale</name>
<index>15</index>
</attribute>
</program>
</pass>
</technique>
<technique n="11">
<pass>
<vertex-program-two-side>
<use>vertex-program-two-side</use>
</vertex-program-two-side>
<program n="0">
<vertex-shader n="1">Shaders/building-default.vert</vertex-shader>
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
<!--fog include-->
<fragment-shader n="1">Shaders/default.frag</fragment-shader>
<attribute>
<name>instancePosition</name>
<index>10</index>
</attribute>
<attribute>
<name>instanceScale</name>
<index>11</index>
</attribute>
<attribute>
<name>rotPitchWtexX0</name>
<index>12</index>
</attribute>
<attribute>
<name>wtexY0FRtexx1FSRtexY1</name>
<index>13</index>
</attribute>
<attribute>
<name>rtexX0RtexY0StexX1</name>
<index>14</index>
</attribute>
<attribute>
<name>rooftopscale</name>
<index>15</index>
</attribute>
</program>
</pass>
</technique>
<technique n="12">
<pass>
<lighting>true</lighting>
<material>
@ -685,21 +551,10 @@
</internal-format>
-->
</texture-unit>
<texture-unit>
<unit>1</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>
<program n="0">
<vertex-shader n="0">Shaders/building-default.vert</vertex-shader>
<fragment-shader n="0">Shaders/include_fog.frag</fragment-shader>
<!--fog include-->
@ -729,42 +584,6 @@
<index>15</index>
</attribute>
</program>
<!-- 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>
@ -772,7 +591,6 @@
<use>fogtype</use>
</value>
</uniform>
<!-- END fog include -->
<uniform>
<name>texture</name>
<type>sampler-2d</type>