Howto:Illuminate faces: Difference between revisions

Jump to navigation Jump to search
Line 16: Line 16:


===Blender users===
===Blender users===
====White lights====
[[Blender]] users may create illuminated faces directly from blender itself. But what makes a face to be illuminated in Flightgear ? Well, Flightgear can not take full advantage of all the properties a blender surface can take (fgfs is not a full featured rendering program nor wants to be), there is anyway a method to make faces in blender emit light by their own. First of all we have to remember that whatever program we are using to model an object if we want to use it in Flightgear we have to export it in AC3D format. Materials in AC3D format have line like this one:
[[Blender]] users may create illuminated faces directly from blender itself. But what makes a face to be illuminated in Flightgear ? Well, Flightgear can not take full advantage of all the properties a blender surface can take (fgfs is not a full featured rendering program nor wants to be), there is anyway a method to make faces in blender emit light by their own. First of all we have to remember that whatever program we are using to model an object if we want to use it in Flightgear we have to export it in AC3D format. Materials in AC3D format have line like this one:
<pre>
<pre>
Line 24: Line 25:
MATERIAL "MaterialName" rgb 1 0 0 amb 0.5 0.5 0.5 emis 0.4 0.4 0.4 spec 1 0.9999 0.9999 shi 32 trans 0
MATERIAL "MaterialName" rgb 1 0 0 amb 0.5 0.5 0.5 emis 0.4 0.4 0.4 spec 1 0.9999 0.9999 shi 32 trans 0
</pre>
</pre>
Using the blender emit property we can obtain always illuminated surfaces without using any xml configuration file. Just remember that this surface will always emit light in every moment of the day.
====Colored lights====
Colored lights can be obtained from blender using a trick of the ac3d default exporter script. We will not use the emit property anymore, but we will use the ''mirror color'' of a material as emission color. So after having set the material mirror color to the considered value we have to teach the exporter to use it and convert it to an emis property. This is done by setting the property '''MIRCOL_AS_EMIS''' to '''True''' under the Blender registry. The Blender registry is a folder generally located in $HOME/.blender/bpydata/config . Here you  will probably find an ac3d_export.cfg file. Edit it and change the row:
<pre>
'MIRCOL_AS_EMIS': False,
</pre>
to
<pre>
'MIRCOL_AS_EMIS': True,
</pre>
Now every time you will export to AC3D format all the materials will get the emis property the same value as their mirror color. Attention ! Generally blender creates new material setting mirror property to white color (1 1 1), before exporting you have to set all the non illuminating surfaces material mirror color to black (0 0 0) otherwise all the object will be like a big white thing in your scene.


==Variations==
==Variations==

Navigation menu