diff --git a/Docs/model-howto.html b/Docs/model-howto.html index bfcd946bd..02eccd86e 100644 --- a/Docs/model-howto.html +++ b/Docs/model-howto.html @@ -236,6 +236,7 @@ information.</p> <li><a href="#texrotate">texrotate</a></li> <li><a href="#textranslate">textranslate</a></li> <li><a href="#textmultiple">textmultiple</a></li> +<li><a href="#material">material</a></li> <li><a href="#range">range</a></li> <li><a href="#alphatest">alpha-test</a></li> </ol> @@ -881,7 +882,7 @@ display explains the format clearly:</p> <blockquote> <pre><animation> <type>range</type> - <object-name>Detailed</objectName> + <object-name>Detailed</object-name> <min-m>0</min-m> <max-property>/sim/rendering/static-lod/detailed</max-property> </animation> @@ -896,13 +897,83 @@ display explains the format clearly:</p> <blockquote> <pre><animation> <type>alpha-test</type> - <object-name>Detailed</objectName> + <object-name>Detailed</object-name> <alpha-factor>0.01</alpha-factor> </animation> </pre> </blockquote> -<hr> +<h3><a name="material">"material" animation type</a></h3> +<p>This "animation" can set any of the material properties on a model branch, including +the texture file path. A simple case for such an animation can look like this:</p> + + <blockquote> + <pre><animation> + <type>material</type> + <object-name>fuselage</object-name> + <global type="bool">true</global> + <emission-red>1.0</emission-red> + <emission-green>0.8</emission-green> + <emission-blue>0.3</emission-blue> + <emission-factor-prop>/controls/lighting/instruments-norm</emission-factor-prop> + <emission-offset>0.3</emission-offset> +</animation> + </pre> + </blockquote> + +<p>The change is only effective for the objects listed in "object-name" tags, +whereby you can use more than one of those. The above example, however, +sets the optional "global" property, so that the changes affect all objects that share +the same material. Note that all material properties can be set to fixed +values or, by appending "-prop", to the contents of another property node.</p> + +<p>The "emission" group is only one of four available groups: "diffuse, +"ambient", "specular, and "emission". A change to one of the components +in each group does always update all three color components. Unset values +default to zero. In addition to the color groups there are three properties +"shininess", "transparency", "threshold", and "texture". The "texture" path +is relative to the "texture-path" target or, if unset, the model directory. +All numerical values are clamped to 0.0-1.0, except "shininess", which is +clamped to 0.0-128.0. The "transparency" property makes an object fully +transparent (and thus invisible) with 0.0, and fully opaque with 1.0. The +"threshold" property sets the opaqueness threshold. It is only relevant for +semitransparent textures. Only parts of the texture that are more opaque +than this are diplayed at all. If it is set to 0.0, all parts of the texture +will be shown. If it is 0.5, only parts with opaqueness greater than 0.5 +(or transparency less than 0.5) are shown.</p> + +<p>Note that defining two or more of these animations for the same object, +or a mixture of "material" and "blend" animations, will probably not yield +the result that you expect. Try to do all state manipulations for one +object or material in one "material" animation, and use its "transparency" +property instead of an extra "blend" animation.</p> + +<p>To make a texture replaceable at runtime, use a "material" animation +like this:</p> + + <blockquote> + <pre><animation> + <type>material</type> + <object-name>tail-vert</object-name> + <texture-prop>/sim/model/foo/texture</texture-prop> +</animation> + </pre> + </blockquote> + +<p>and put something like this into your aircraft's *-set.xml file:</p> + + <blockquote> + <pre><sim> + <model> + <foo> + <texture>logos/tail-logo.rgb</texture> + </foo> + </model> +</sim> + </pre> + </blockquote> + +<hr> <address>David Megginson, 11 March 2002</address> <!-- Standard Footer Begin -->