Es/Howto: Lightmap: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Created page with "{{BeingTranslated}} thumb|270px|[[Boeing 747-400|Boeing 744 cockpit with several lightmapped panels.]] [[File:Boeing_747-400_light...")
 
No edit summary
Line 3: Line 3:
[[File:Boeing_747-400_lightmap_exterior.png|thumb|270px|[[Boeing 747-400|Boeing 744]] exterior with lightmapped fuselage and tail.]]
[[File:Boeing_747-400_lightmap_exterior.png|thumb|270px|[[Boeing 747-400|Boeing 744]] exterior with lightmapped fuselage and tail.]]
A '''lightmap''' is a texture that contains the brightness of surfaces in a computer graphic. The darker a pixel on the lightmap, the less emissive the correpsonding pixel will be on the color/photo texture.
A '''lightmap''' is a texture that contains the brightness of surfaces in a computer graphic. The darker a pixel on the lightmap, the less emissive the correpsonding pixel will be on the color/photo texture.
''' Lightmap' A'' es una textura que contiene el brillo de las superficies en un ordenador gráfico. Cuanto más oscuro un píxel en la lightmap, menos emisiva el píxel correpsonding estará en la textura de color / foto.


Some reasons why lightmaps are useful:
Some reasons why lightmaps are useful:
Line 8: Line 10:
* 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.
* 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).
* 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 lightmaps son útiles:
* Nos permiten iluminar las superficies sin la necesidad de la creación de capas alfa (como anteriormente utilizada en muchos aviones).
* Podemos editar los colores de una textura, sin interferir con la iluminación. Es útil si desea añadir un poco de tierra a los paneles, más adelante.
* Luces mirada realista en todo momento del día. A diferencia de una animación textranslate, donde puede cambiar las texturas de día / noche (a menudo está muy oscuro y durante el amanecer / atardecer).


== Lightmaps in FlightGear ==
== Lightmaps in FlightGear ==
Line 13: Line 20:
=== FlightGear 2.6.0 and onwards ===
=== FlightGear 2.6.0 and onwards ===
See [[FlightGear Newsletter December 2011#Shaders]]
See [[FlightGear Newsletter December 2011#Shaders]]
2.6.0 FlightGear y en adelante ===
Ver [[FlightGear Boletín de diciembre de 2011 Shaders #]]


=== FlightGear 2.4.0 ===
=== FlightGear 2.4.0 ===
'''Note:''' material shaders must be enabled in the <tt>View > Rendering options</tt> dialog for lightmaps to work.
'''Note:''' material shaders must be enabled in the <tt>View > Rendering options</tt> dialog for lightmaps to work.
FlightGear 2.4.0 ===
'Nota:''''' shaders de materiales deben estar habilitadas en la vista de las opciones de presentación <tt>> </ tt de diálogo> para lightmaps para trabajar.


==== The lightmap ====
==== The lightmap ====
You'll have to create a lightmap for every single texture that is meant to be lightmapped. This can be done by hand, or via some 3D Software, like [[Blender]] (which will be used in the example on this page).
You'll have to create a lightmap for every single texture that is meant to be lightmapped. This can be done by hand, or via some 3D Software, like [[Blender]] (which will be used in the example on this page).
El lightmap ====
Vas a tener que crear un lightmap para cada textura única que está destinado a ser lightmapped. Esto puede hacerse a mano, o mediante algún software 3D, como [[Blender]] (que se utiliza en el ejemplo en esta página).


# Open/import your model in Blender.
# Open/import your model in Blender.
Line 36: Line 52:
# Change your mainwindow (or add an extra window) to UV/Image editor. You will see the lightmap being created bit by bit.
# Change your mainwindow (or add an extra window) to UV/Image editor. You will see the lightmap being created bit by bit.
# When the lightmap is finished, click <tt>Image > Save as...</tt> and save the image in your aircraft's directory.
# When the lightmap is finished, click <tt>Image > Save as...</tt> and save the image in your aircraft's directory.
# Abrir / importar el modelo en Blender.
# Ir al <tt> Add> Lamp </ tt>, y seleccionar una de los tipos de lámparas. La luz se creará en el origen del modelo.
# *'' 'De la lámpara:''' se propaga la luz en todas direcciones. Puede ser utilizado para las luces anticolisión, luces de navegación, etc
# *'' 'Superficie:''' largas / grandes áreas de la lámpara, como la iluminación del panel de instrumentos que se utilizan lámparas fluorescentes.
# *'' 'Spotlight:''' para las luces de una zona específica / dirección. Se utiliza para las luces de aterrizaje.
# 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.
# 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:
# *'' 'Dist:''' la distancia (en metros) en el que la intensidad de la luz es un medio tan intensa como en la fuente.
# *'' 'Energía:''' intensidad de la luz.
# *'' 'R / G / B:''' el color de la luz. Sí, los colores lightmaps apoyo!
# *'' 'SpotSi:''' anchura del haz de foco en grados.
# *'' '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.
# 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).
# 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.
# Cambiar el MainWindow (o añadir una ventana extra) al editor de UV / Imagen. Verá el lightmap está creando poco a poco.
# Cuando el lightmap haya terminado, haga clic en la imagen <tt>> 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.
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 ====
==== The xml ====
In your model's .xml file, add the following block of code:
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:
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
Line 59: Line 97:
* '''condition:''' when this property is greater than or equal to 1, the lightmap will be enabled.
* '''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.
* '''factor:''' can be used to control the intensity of the light, on a 0-1 scale.
En la que:
*'' 'De la imagen:''' [[# El lightmap | 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.
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 ====
==== Known problems ====
* FlightGear does not support multiple shaders per object. Therefore, you'll have to choose between the [[Howto: Aircraft Reflection Shader|reflection]] or [[Howto: Use the normal map effect in aircraft|normalmap]] shaders and the lightmap.
* FlightGear does not support multiple shaders per object. Therefore, you'll have to choose between the [[Howto: Aircraft Reflection Shader|reflection]] or [[Howto: Use the normal map effect in aircraft|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.
* 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 [[Howto: Shader aeronaves Reflexión | reflexión]] o [[Howto: Usar el efecto de mapa normal en los aviones | 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.


[[Category:Aircraft enhancement|Lightmap]]
[[Category:Aircraft enhancement|Lightmap]]
[[Category:Howto|Lightmap]]
[[Category:Howto|Lightmap]]
[[Category:Modeling|Lightmap]]
[[Category:Modeling|Lightmap]]

Revision as of 07:36, 20 April 2012

This article is currently being translated.
Boeing 744 cockpit with several lightmapped panels.
Boeing 744 exterior with lightmapped fuselage and tail.

A lightmap is a texture that contains the brightness of surfaces in a computer graphic. The darker a pixel on the lightmap, the less emissive the correpsonding pixel will be on the color/photo texture.

' Lightmap' A es una textura que contiene el brillo de las superficies en un ordenador gráfico. Cuanto más oscuro un píxel en la lightmap, menos emisiva el píxel correpsonding estará 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 lightmaps son útiles:

  • Nos permiten iluminar las superficies sin la necesidad de la creación de capas alfa (como anteriormente utilizada en muchos aviones).
  • Podemos editar los colores de una textura, sin interferir con la iluminación. Es útil si desea añadir un poco de tierra a los paneles, más adelante.
  • Luces mirada realista en todo momento del día. A diferencia de una animación textranslate, donde puede cambiar las texturas de día / noche (a menudo está muy oscuro y durante el amanecer / atardecer).

Lightmaps in FlightGear

FlightGear 2.6.0 and onwards

See FlightGear Newsletter December 2011#Shaders

2.6.0 FlightGear y en adelante === Ver FlightGear Boletín de diciembre de 2011 Shaders #

FlightGear 2.4.0

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

FlightGear 2.4.0 === 'Nota: shaders de materiales deben estar habilitadas en la vista de las opciones de presentación > </ tt de diálogo> para lightmaps para trabajar.

The lightmap

You'll have to create a lightmap for every single texture that is meant to be lightmapped. This can be done by hand, or via some 3D Software, like Blender (which will be used in the example on this page).

El lightmap ==== Vas a tener que crear un lightmap para cada textura única que está destinado a ser lightmapped. Esto puede hacerse a mano, o mediante algún software 3D, como Blender (que se utiliza en 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.