Project Rembrandt: Difference between revisions

Line 159: Line 159:


== Guidelines for modelers ==
== Guidelines for modelers ==
=== Referencing all translucent surfaces ===
Every model is, by default, rendered using the model-default effect. This effect initialize the G-buffer, ignoring transparent surfaces, by doing alpha testing and rendering all the geometry in the default bin. It is not possible to redirect rendering to transparent bins when the associated texture has alpha channel because most models use a single texture atlas and even opaque parts are rendered with texture with alpha channel.
Every model is, by default, rendered using the model-default effect. This effect initialize the G-buffer, ignoring transparent surfaces, by doing alpha testing and rendering all the geometry in the default bin. It is not possible to redirect rendering to transparent bins when the associated texture has alpha channel because most models use a single texture atlas and even opaque parts are rendered with texture with alpha channel.


Line 164: Line 167:


If opaque surface need to have special effect, for example to apply bump mapping, this effect should use the "RenderBin" bin, or the rendering hint set to "opaque", and the G-buffer needs to be initialized correctly in the Geometry stage.
If opaque surface need to have special effect, for example to apply bump mapping, this effect should use the "RenderBin" bin, or the rendering hint set to "opaque", and the G-buffer needs to be initialized correctly in the Geometry stage.
=== Adding lights to a model ===
Only spotlights are implemented for the moment. The light volume must be part of the geometry of the model and be referenced in the animation file. No need to add a color or an effect to this volume. Light calculation is only done on the fragments covered by the light volume, but has no influence on the color or the attenuation of the light. Typical light volume for a spot light is a cone.
All available animations are possible on the light volume. Axis and position are in object space and are transformed by the subsequent animations.
==== Spotlights ====
<pre>
<animation>
  <type>light</type>
  <light-type>spot</light-type>
  <name>LightSrcRight</name>
  <object-name>LightRight</object-name>
  <position>
    <x>0.169</x>
    <y>0.570</y>
    <z>0.713</z>
  </position>
  <direction>
    <x>-0.9988</x>
    <y>0.0349</y>
    <z>-0.0349</z>
  </direction>
  <ambient>
    <r>0.03</r>
    <g>0.03</g>
    <b>0.03</b>
    <a>1.0</a>
  </ambient>
  <diffuse>
    <r>0.7</r>
    <g>0.7</g>
    <b>0.6</b>
    <a>1.0</a>
  </diffuse>
  <specular>
    <r>0.7</r>
    <g>0.7</g>
    <b>0.7</b>
    <a>1.0</a>
  </specular>
  <attenuation>
    <c>1.0</c>
    <l>0.002</l>
    <q>0.00005</q>
  </attenuation>
  <exponent>30.0</exponent>
  <cutoff>39</cutoff>
  <near-m>3.5</near-m>
  <far-m>39</far-m>
</animation>
</pre>


== References ==
== References ==
269

edits