Compositor: Difference between revisions

492 bytes removed ,  7 November 2019
no edit summary
No edit summary
No edit summary
Line 88: Line 88:


{|cellpadding=20|
{|cellpadding=20|
|valign=top|
|valign=top style="width: 20%;"|
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<light>
<light>
Line 131: Line 131:
</light>
</light>
</syntaxhighlight>
</syntaxhighlight>
|valign=top|
|valign=top style="width: 80%;"|
* <tt>'''name'''</tt>. An <code><animation></code> will be able to reference the light by this name. Most animations will work as expected (rotate, translate, spin etc).
* <tt>'''name'''</tt>. An <code><animation></code> will be able to reference the light by this name. Most animations will work as expected (rotate, translate, spin etc).
* <tt>'''type'''</tt>. <tt>spot</tt> or <tt>point</tt>.
* <tt>'''type'''</tt>. <tt>spot</tt> or <tt>point</tt>.
* <tt>'''position'''</tt>. The position of the light source in model space and in meters.
* <tt>'''position'''</tt>. The position of the light source in model space and in meters.
* <tt>'''direction'''</tt>. Only available in <tt>spot</tt> lights. It indicates the direction of the spotlight. This parameter can be specified in three different ways:
* <tt>'''direction'''</tt>. Only available in <tt>spot</tt> lights. It indicates the direction of the spotlight. This parameter can be specified in three different ways:
{| class="wikitable" style="padding: 20px"
{| class="wikitable" style="border: 1px solid darkgray;"
! scope="col" style="width:33%;" |Direction vector
! scope="col" style="width:33%;" |Direction vector
! scope="col" style="width:33%;" |Look-at point
! scope="col" style="width:33%;" |Look-at point
Line 163: Line 163:
* <tt>'''attenuation'''</tt> ('''Optional'''). Three-component vector where <code><c></code> specifies the constant factor, <code><l></code> specifies the linear factor and <code><nowiki><q></nowiki></code> specifies the quadratic factor. These factors are plugged into the OpenGL light attenuation formula [[File:Spotlight_attenuation.png]] where d is the distance of the fragment to the light source. If no attenuation has been specified, the inverse-square law will be used. See this [http://wiki.ogre3d.org/tiki-index.php?page=-Point+Light+Attenuation table] for a list of attenuation values based on the range of the light.
* <tt>'''attenuation'''</tt> ('''Optional'''). Three-component vector where <code><c></code> specifies the constant factor, <code><l></code> specifies the linear factor and <code><nowiki><q></nowiki></code> specifies the quadratic factor. These factors are plugged into the OpenGL light attenuation formula [[File:Spotlight_attenuation.png]] where d is the distance of the fragment to the light source. If no attenuation has been specified, the inverse-square law will be used. See this [http://wiki.ogre3d.org/tiki-index.php?page=-Point+Light+Attenuation table] for a list of attenuation values based on the range of the light.
* <tt>'''range-m'''</tt> ('''Optional'''). Maximum range from the light source position in meters. This value will be used by the renderers to determine if a fragment is illuminated by this source. Every fragment outside this range isn't guaranteed to be affected by the light, even if the attenuation factor isn't 0 in that particular fragment. If no value has been specified, it will be calculated automatically based on the attenuation.
* <tt>'''range-m'''</tt> ('''Optional'''). Maximum range from the light source position in meters. This value will be used by the renderers to determine if a fragment is illuminated by this source. Every fragment outside this range isn't guaranteed to be affected by the light, even if the attenuation factor isn't 0 in that particular fragment. If no value has been specified, it will be calculated automatically based on the attenuation.
* <tt>'''cutoff'''</tt>. Only available in <tt>spot</tt> lights. It specifies the maximum spread angle of a light source. Only values in the range 0 90 and the special value 180 are accepted. If the angle between the direction of the light and the direction from the light to the fragment being lighted is greater than the spot cutoff angle, it won't be lit.
* <tt>'''cutoff'''</tt>. Only available in <tt>spot</tt> lights. It specifies the maximum spread angle of a light source. Only values in the range 0 90 are accepted. If the angle between the direction of the light and the direction from the light to the fragment being lighted is greater than the spot cutoff angle, it won't be lit.
* <tt>'''exponent'''</tt>. Only available in <tt>spot</tt> lights. Higher spot exponents result in a more focused light source, regardless of the spot cutoff angle.
* <tt>'''exponent'''</tt>. Only available in <tt>spot</tt> lights. Higher spot exponents result in a more focused light source, regardless of the spot cutoff angle.
|}
|}
Line 252: Line 252:
A typical [[PropertyList XML File|property tree structure]] describing a buffer may be as follows:
A typical [[PropertyList XML File|property tree structure]] describing a buffer may be as follows:


<syntaxhighlight lang="xml"><syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
<buffer>
  <name>color</name>
  <type>2d</type>
  <width>screen</width>
  <height>screen</height>
  <screen-width-scale>1.5</screen-width-scale>
  <screen-height-scale>1.5</screen-height-scale>
  <internal-format>rgba8</internal-format>
  <source-format>rgba</source-format>
  <source-type>ubyte</source-type>
  <min-filter>nearest-mipmap-nearest</min-filter>
  <mag-filter>nearest-mipmap-nearest</mag-filter>
  <wrap-s>repeat</wrap-s>
  <wrap-t>repeat</wrap-t>
</buffer>
</syntaxhighlight>
<buffer>
<buffer>
   <name>color</name>
   <name>color</name>
343

edits