Es/Howto: Lightmap: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
Line 17: Line 17:
== Mapeados de iluminación en FlightGear ==
== Mapeados de iluminación en FlightGear ==


=== De FlightGear 2.6.0 en adelante ===
=== De FlightGear 2.6.0 en adelante ===
Ver [[FlightGear Newsletter December 2011#Shaders]]
Ver [[FlightGear Newsletter December 2011#Shaders]]
[[FlightGear Newsletter December 2011#Shaders]]


=== FlightGear 2.4.0 ===
=== FlightGear 2.4.0 ===

Revision as of 08:51, 20 April 2012

This article is currently being translated.
Cábina del Boeing 744 con mapeado de iluminación en varios paneles.
Exterior del Boeing 744 con mapeado de iluminación en en fuselaje y cola.

Lightmap o mapeado de iluminación es una textura que contiene el brillo de las superficies en un computo gráfico. Cuanto más oscuro es un píxel en el lightmap, menos emisivo será el correspondiente píxel en la textura de color/foto.

Some reasons why lightmaps are useful:

  • they allow us to light surfaces without the need for creating alpha layers (like formerly used on many aircraft).
  • we can edit the colors of a texture, without interfering with the lighting. Useful if you want to add some dirt to your panels, later on.
  • lights look realistic at all times of day. Unlike a textranslate animation, where you change between day/night textures (often being too dark during dawn/dusk).

Algunas razones por las que los mapeados de iluminación son útiles:

  • Nos permiten iluminar superficies sin la necesidad de crear capas alfa (como anteriormente se hacía en muchos aviones).
  • Podemos editar los colores de una textura, sin interferir con la iluminación. Es útil si deseas más adelante añadir un poco de suciedad en los paneles.
  • Las luces aparecen realistas en todo momento del día. A diferencia de una animación textranslate, donde puedes cambiar las texturas de día/noche (pero a menudo aparecen muy oscuras durante el amanecer/atardecer).

Mapeados de iluminación en FlightGear

De FlightGear 2.6.0 en adelante

Ver FlightGear Newsletter December 2011#Shaders

FlightGear 2.4.0

Note: material shaders must be enabled in the View > Rendering options dialog for lightmaps to work.

Nota: para que los mapeados de iluminación funcionen los shaders de materiales deben estar habilitados en el dialogo de opciones de visualización View > Rendering options.

El lightmap

Vas a tener que crear un lightmap para cada textura única destinada a ser mapeada. Esto puede hacerse a mano, o mediante algún software 3D, como Blender (el cual se utilizará para el ejemplo en esta página).

  1. Open/import your model in Blender.
  2. Go to Add > Lamp, and select on of the lamp types. The light will be created in the model's origin.
    • Lamp: spreads light in all directions. Can be used for anti-collision lights, navigation lights etc.
    • Area: long/large lamp areas, like instrument panel lighting where fluorescent lamps are used.
    • Spotlight: for lights in a specific area/direction. Used for landing lights.
  3. Move/rotate the lamp to the prefered location/orientation. Note: leave the scale tools untouched, scaling the lamp does NOT affect the lightmap.
  4. Select the lamp (right mouse click) and open the Shading menu (F5). This is where we can edit the lamp. Some of the more important settings:
    • Dist: the distance (in meter) at which the light intensity is half as intense as at the source.
    • Energy: intensity of the light.
    • R/G/B: the color of the light. Yes, lightmaps support colors!
    • SpotSi: width of the spotlight beam in degrees.
    • SpotBl: softness of the spotlight edge. Softer edges create a more natural look for most aircraft lights.
  5. Select the object you'd like to create the lightmap for. Go into editing mode and then back to object mode (to load the object's texture).
  6. Go to the Scene menu (F10) and open the Bake tab. Select Full render and click the big Bake button. Blender will now start generating your lightmap.
  7. Change your mainwindow (or add an extra window) to UV/Image editor. You will see the lightmap being created bit by bit.
  8. When the lightmap is finished, click Image > Save as... and save the image in your aircraft's directory.
  1. Abrir / importar el modelo en Blender.
  2. Ir al Add> Lamp </ tt>, y seleccionar una de los tipos de lámparas. La luz se creará en el origen del modelo.
  3. * 'De la lámpara:' se propaga la luz en todas direcciones. Puede ser utilizado para las luces anticolisión, luces de navegación, etc
  4. * 'Superficie:' largas / grandes áreas de la lámpara, como la iluminación del panel de instrumentos que se utilizan lámparas fluorescentes.
  5. * 'Spotlight:' para las luces de una zona específica / dirección. Se utiliza para las luces de aterrizaje.
  6. Mover / rotar la lámpara al lugar preferido / orientación. 'Nota: dejar las herramientas de escala, sin tocar, la ampliación de la lámpara no afecta a la lightmap.
  7. Seleccione el indicador (botón derecho del ratón) y abrir el menú Shading (F5). Aquí es donde podemos editar la lámpara. Algunos de los ajustes más importantes:
  8. * 'Dist:' la distancia (en metros) en el que la intensidad de la luz es un medio tan intensa como en la fuente.
  9. * 'Energía:' intensidad de la luz.
  10. * 'R / G / B:' el color de la luz. Sí, los colores lightmaps apoyo!
  11. * 'SpotSi:' anchura del haz de foco en grados.
  12. * 'SpotBl:' suavidad del borde centro de atención. Los bordes más suaves crear una apariencia más natural para las luces de la mayoría de los aviones.
  13. Seleccione el objeto que desea crear el lightmap de. Entra en el modo de edición y luego de nuevo a modo de objeto (para cargar la textura del objeto).
  14. Ve al menú de escena (F10) y abra la ficha de hornear. Seleccione render completo y haga clic en el botón de hornear grande. Blender empezará a generar su lightmap.
  15. Cambiar el MainWindow (o añadir una ventana extra) al editor de UV / Imagen. Verá el lightmap está creando poco a poco.
  16. Cuando el lightmap haya terminado, haga clic en la imagen > Guardar como ... </ tt> y guardar la imagen en el directorio de su avión.

That's it! Now, you probably want to see how it looks on your aircraft, which is explaind in the next paragraph. If you are not yet satisfied with the result, you can edit your lamp's settings (step 4) and add more lamps to see what effect that has on the result.

¡Eso es! Ahora, es probable que desee ver cómo se ve en el avión, que se explaind en el párrafo siguiente. Si aún no estás satisfecho con el resultado, puede editar la configuración de la lámpara (paso 4) y añadir más luces para ver el efecto que tiene sobre el resultado.

The xml

In your model's .xml file, add the following block of code:

El xml ==== . En el archivo de su modelo XML, agregue el siguiente bloque de código:

<effect>
	<inherits-from>Effects/lightmap</inherits-from>
	<parameters>
		<texture n="1">
			<image>Aircraft/747-400/Models/Effects/lightmap.png</image>
		</texture>
		<condition><use>/controls/lighting/logo-lights</use></condition>
		<factor><use>/controls/lighting/panel-norm</use></factor>
	</parameters>
 	<object-name>fuselage</object-name> 
</effect>

In which:

  • image: the lightmap itself
  • condition: when this property is greater than or equal to 1, the lightmap will be enabled.
  • factor: can be used to control the intensity of the light, on a 0-1 scale.

En la que:

  • 'De la imagen:' la propia lightmap
  • 'Condición:' cuando esta propiedad es mayor que o igual a 1, el lightmap se habilitará.
  • 'Factor:' se puede utilizar para controlar la intensidad de la luz, en una escala 0-1.

Remember that such a block is required for each single texture that you want to lightmap. You can have multiple objects per effect, but not multiple effects per object.

Recuerde que este bloque se requiere para cada una textura única que desea lightmap. Usted puede tener varios objetos por efecto, pero no efectos múltiples por objeto.

Known problems

  • FlightGear does not support multiple shaders per object. Therefore, you'll have to choose between the reflection or normalmap shaders and the lightmap.
  • There is no flexible way to (de)select lightmaps on a per-object base. Currently it only listens to one per-object defineable property.

Problemas conocidos ==== FlightGear * no es compatible con shaders múltiples por objeto. Por lo tanto, usted tendrá que elegir entre los reflexión o Normalmap shaders y el lightmap.

  • No hay una manera flexible para (de) lightmaps seleccionados sobre una base per-objeto. En la actualidad sólo se escucha a una por-objeto de propiedad definible.