1
0
Fork 0

Add a more comprehensive standard fuselage reflection configuration

- use ALS shaders
- Add parameters to enable or disable the effect and influence the
  shininess and fresnel factor
This commit is contained in:
Erik Hofman 2022-02-16 11:24:48 +01:00
parent 5c6ab27c98
commit 706afafb60
3 changed files with 157 additions and 49 deletions

View file

@ -1,49 +1,150 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<PropertyList> <!--
Parameters:
<name>Fuselagereflect</name> * Boolean to enable or disable the reflection.
<inherits-from>Effects/reflect</inherits-from> Civilian aircraft are usually glossy but military aircraft are not.
<parameters> sim/model/civilian
<texture n="5">
<type>cubemap</type> * Floating point value to specify the reflection factor.
<images> The range is between -1.0 and 0.0
<positive-x>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_px.png</positive-x> sim/model/livery/shininess
<negative-x>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_nx.png</negative-x>
<positive-y>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_py.png</positive-y> * Floating point value to specify the Fresnel factor.
<negative-y>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_ny.png</negative-y> The range is between 0.0 and 1.0
<positive-z>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_pz.png</positive-z> sim/model/livery/fresnel
<negative-z>Aircraft/Generic/Effects/CubeMaps/real.blue-sky/fair-sky_nz.png</negative-z>
</images> These parameters can all be defined within a livery configuration file:
</texture> <PropertyList>
<texture n="6"> <sim>
<image>Aircraft/Generic/Effects/Rainbow.png</image> <model>
<filter>linear-mipmap-linear</filter> <civilian type="bool">true</civilian>
<wrap-s>repeat</wrap-s> <livery>
<wrap-t>repeat</wrap-t> <name type="string">Factory Demonstrator</name>
</texture> <texture>Liveries/factory.png</texture>
<texture n="7"> <shininess type="float">-0.5</shininess>
<image>Aircraft/Generic/Effects/FresnelLookUp.png</image> <fresnel type="float">0.7</fresnel>
<filter>linear-mipmap-linear</filter> </livery>
<wrap-s>repeat</wrap-s> </model>
<wrap-t>repeat</wrap-t> </sim>
<internal-format>normalized</internal-format> </PropertyList>
</texture>
<texture n="8">
<image>Aircraft/Generic/Effects/greymap.png</image> Usage:
<filter>linear-mipmap-linear</filter> Add one of the following examples to your model configuration file.
<wrap-s>repeat</wrap-s>
<wrap-t>repeat</wrap-t> * Minimal configuration
<internal-format>normalized</internal-format> <effect>
</texture> <name>Effects/normalmap-reflection</name>
<rendering-hint>transparent</rendering-hint> <inherits-from>Aircraft/Generic/Effects/Fuselagereflect</inherits-from>
<shade-model>smooth</shade-model> <object-name>fuselage</object-name>
<rainbowiness type="double">0.1</rainbowiness> <object-name>wing</object-name>
<fresneliness type="double">0.1</fresneliness> </effect>
<noisiness type="double">0.1</noisiness>
<refl_correction type="double">-0.2</refl_correction> * Adding a normal-map:
<ambient_correction type="double">0.1</ambient_correction> <effect>
<reflect_map type="double">0</reflect_map> <name>Effects/normalmap-reflection</name>
</parameters> <inherits-from>Aircraft/Generic/Effects/Fuselagereflect</inherits-from>
<object-name>fuselage</object-name>
</PropertyList> <object-name>wing</object-name>
<parameters>
<texture n="2">
<image>Aircraft/AircraftName/Models/normalmap.png</image>
</texture>
</parameters>
</effect>
Further reading:
https://wiki.flightgear.org/ALS_technical_notes
-->
<PropertyList>
<name>Aircraft/Generic/Effects/Fuselagereflect</name>
<inherits-from>Effects/model-combined-deferred</inherits-from>
<parameters>
<rain-enabled type="int"> 2 </rain-enabled>
<normalmap-enabled type="int"> 1 </normalmap-enabled>
<normalmap-dds type="int"> 0 </normalmap-dds>
<normalmap-tiling type="float"> 1.0 </normalmap-tiling>
<lightmap-enabled type="int"> 0 </lightmap-enabled>
<ambient-correction type="float"> 0.1 </ambient-correction>
<reflection-enabled type="int"><use>sim/model/civilian</use></reflection-enabled>
<reflection-type type="int"> 1 </reflection-type>
<reflection-dynamic type="int"> 1 </reflection-dynamic>
<reflection-rainbow type="float"> 0.0 </reflection-rainbow>
<reflection-noise type="float"> 0.0 </reflection-noise>
<reflection-fresnel-factor type="float"> 1.0 </reflection-fresnel-factor>
<reflection-correction type="float"><use>sim/model/livery/shininess</use></reflection-correction>
<reflection-fresnel type="float"><use>sim/model/livery/fresnel</use></reflection-fresnel>
<texture n="2">
<image>Aircraft/Generic/Effects/null_bumpspec.png</image>
<filter>linear-mipmap-linear</filter>
<wrap-s>clamp</wrap-s>
<wrap-t>clamp</wrap-t>
<internal-format>normalized</internal-format>
</texture>
<texture n= "5" >
<type>cubemap</type>
<images>
<positive-x>Aircraft/Generic/Effects/CubeMaps/buildings/N.png</positive-x>
<negative-x>Aircraft/Generic/Effects/CubeMaps/buildings/S.png</negative-x>
<positive-y>Aircraft/Generic/Effects/CubeMaps/buildings/W.png</positive-y>
<negative-y>Aircraft/Generic/Effects/CubeMaps/buildings/E.png</negative-y>
<positive-z>Aircraft/Generic/Effects/CubeMaps/buildings/U.png</positive-z>
<negative-z>Aircraft/Generic/Effects/CubeMaps/buildings/D.png</negative-z>
</images>
</texture>
</parameters>
<generate>
<tangent type="int">6</tangent>
<binormal type="int">7</binormal>
</generate>
<technique n="4">
<pass>
<program>
<attribute>
<name>tangent</name>
<index>6</index>
</attribute>
<attribute>
<name>binormal</name>
<index>7</index>
</attribute>
</program>
</pass>
</technique>
<technique n="7">
<pass>
<program>
<attribute>
<name>tangent</name>
<index>6</index>
</attribute>
<attribute>
<name>binormal</name>
<index>7</index>
</attribute>
</program>
</pass>
</technique>
<technique n="9">
<pass>
<program>
<attribute>
<name>tangent</name>
<index>6</index>
</attribute>
<attribute>
<name>binormal</name>
<index>7</index>
</attribute>
</program>
</pass>
</technique>
</PropertyList>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 B

After

Width:  |  Height:  |  Size: 102 B

View file

@ -1022,6 +1022,13 @@ Started September 2000 by David Megginson, david@megginson.com
<speed type="double">1.0</speed> <speed type="double">1.0</speed>
<codec>libx265</codec> <codec>libx265</codec>
</video> </video>
<model>
<civilian type="bool">false</civilian>
<livery>
<fresnel type="double">0.7</fresnel>
<shininess type="double">-0.5</shininess>
</livery>
</model>
</sim> </sim>
<!-- accelerations --> <!-- accelerations -->
<accelerations> <accelerations>