ALS technical notes: Difference between revisions

Jump to navigation Jump to search
Line 91: Line 91:


== The grain texture and the rain effect ==
== The grain texture and the rain effect ==
 
ALS supports a grain texture for models. This is a semi-transparent overlay texture that works just as [[Procedural Texturing#The grain texture|its equivalent for terrain texturing]] and provides the option of generating centimeter-scale details such as rust or discoloration on a surface without having to use huge textures. An example of a surface rendered with grain texture is the image of the USS Vinson flightdeck below:
ALS supports a grain texture for models. This is a semi-transparent overlay texture that works just as [[Procedural_Texturing#The_grain_texture | its equivalent]] for terrain texturing and provides the option of generating cm-scale details such as rust or discoloration on a surface without having to use huge textures. An example of a surface rendered with grain texture is the Vinson flightdeck below:


[[File:Grain rain01.jpg|700px|Grain and rain effects on Vinson's flightdeck]]
[[File:Grain rain01.jpg|700px|Grain and rain effects on Vinson's flightdeck]]
Line 98: Line 97:
This is done using the following effect declaration inheriting from '''model-combined-deferred.eff''' as
This is done using the following effect declaration inheriting from '''model-combined-deferred.eff''' as
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
 
<PropertyList>
<PropertyList>
    <name>flightdeck</name>
 
    <inherits-from>Effects/model-combined-deferred</inherits-from>
<name>flightdeck</name>
    <parameters>
<inherits-from>Effects/model-combined-deferred</inherits-from>
        <grain-texture-enabled type="int">2</grain-texture-enabled>
<parameters>
        <grain-magnification type="float">0.1</grain-magnification>
  <grain-texture-enabled type="int">2</grain-texture-enabled>
        <rain-enabled type="int">2</rain-enabled>
  <grain-magnification type="float">0.1</grain-magnification>
        <texture n="7">
  <rain-enabled type="int">2</rain-enabled>
            <image>Models/Geometry/Nimitz/rust_texture.png</image>
  <texture n="7">
            <type>2d</type>
    <image>Models/Geometry/Nimitz/rust_texture.png</image>
            <filter>linear-mipmap-linear</filter>  
    <type>2d</type>
            <wrap-s>repeat</wrap-s>
    <filter>linear-mipmap-linear</filter>  
            <wrap-t>repeat</wrap-t>
    <wrap-s>repeat</wrap-s>
            <internal-format>normalized</internal-format>
    <wrap-t>repeat</wrap-t>
        </texture>
    <internal-format>normalized</internal-format>
    </parameters>
  </texture>
</parameters>
 
</PropertyList>
</PropertyList>
</syntaxhighlight>
</syntaxhighlight>
Line 130: Line 132:
</syntaxhighlight>
</syntaxhighlight>


If the number is < 0, the grain resolution is lower than the base layer, if the parameter is > 0, it is higher (note that in the above case, the grain is mapped to (xy) rather than (uv), hence the base size is 1 m, so the grain texture is mapped on a 10x10 m patch on the flightdeck), for which a 1024x1024 pixel texture provides ~1 cm sized details).
If the number is less than 0, the grain resolution is lower than the base layer. If the parameter is greater than 0, it is higher (note that in the above case, the grain is mapped to (xy) rather than (uv), hence the base size is 1 m, so the grain texture is mapped on a 10x10 m patch on the flightdeck, for which a 1024x1024 pixel texture provides ~1 cm sized details).


Finally, any number greater than 0 passed to
Finally, any number greater than 0 passed to
Line 142: Line 144:


[[File:Grain rain02.jpg|700px|Rain effect on the Citation Bravo]]
[[File:Grain rain02.jpg|700px|Rain effect on the Citation Bravo]]


== The exhaust flame effect ==
== The exhaust flame effect ==

Navigation menu