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...")
 
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{BeingTranslated}}
[[File:Boeing_747-400_lightmap_cockpit.png|thumb|270px|Cábina del [[Boeing 747-400|Boeing 744]] con mapeado de iluminación en varios paneles.]]
[[File:Boeing_747-400_lightmap_cockpit.png|thumb|270px|[[Boeing 747-400|Boeing 744]] cockpit with several lightmapped panels.]]
[[File:Boeing_747-400_lightmap_exterior.png|thumb|270px|Exterior del [[Boeing 747-400|Boeing 744]] con mapeado de iluminación en en fuselaje y cola.]]
[[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.


Some reasons why lightmaps are useful:
''' 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.
* 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).


== Lightmaps in FlightGear ==
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).


=== FlightGear 2.6.0 and onwards ===
== Mapeados de iluminación en FlightGear ==
See [[FlightGear Newsletter December 2011#Shaders]]
 
=== De FlightGear 2.6.0 en adelante ===
Ver [[FlightGear Newsletter December 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.
'''Nota:''' para que los mapeados de iluminación funcionen los  shaders de materiales deben estar habilitados en el dialogo de opciones de visualización <tt>View > Rendering options</tt>.


==== The lightmap ====
==== El 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).
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).


# Open/import your model in Blender.
# Abrir/importar tu modelo en Blender.
# Go to <tt>Add > Lamp</tt>, and select on of the lamp types. The light will be created in the model's origin.
# Ir a <tt> Add> Lamp </tt>, y seleccionar uno de los tipos de lámpara. La luz se creará en el origen del modelo.
#* '''Lamp:''' spreads light in all directions. Can be used for anti-collision lights, navigation lights etc.
# *'' 'Lamp:''' la lámpara propaga la luz en todas direcciones. Puede ser utilizada para las luces anticolisión, luces de navegación, etc
#* '''Area:''' long/large lamp areas, like instrument panel lighting where fluorescent lamps are used.
# *'' 'Area:''' longitud y tamaño del área de las lámparas, como en la iluminación del panel de instrumentos en el que se utilizan lámparas fluorescentes.
#* '''Spotlight:''' for lights in a specific area/direction. Used for landing lights.
# *'' 'Spotlight:''' para iluminar un area específica/dirección. Se utiliza para las luces de aterrizaje.
# Move/rotate the lamp to the prefered location/orientation. '''Note:''' leave the scale tools untouched, scaling the lamp does NOT affect the lightmap.
# Move/rotate situa la lámpara en el lugar preferido/orientación. '''Nota:''' dejar las herramientas de escala sin tocar, ampliar la lámpara NO afecta al lightmap.
# 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:
# Seleccione la lámpara (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 importantesson:
#* '''Dist:''' the distance (in meter) at which the light intensity is half as intense as at the source.
# *'' 'Dist:''' la distancia (en metros) en la que la intensidad de la luz es la mitad de intensa que en su fuente.
#* '''Energy:''' intensity of the light.  
# *'' 'Energy:''' intensidad de la luz.
#* '''R/G/B:''' the color of the light. Yes, lightmaps support colors!
# *'' 'R/G/B:''' el color de la luz. , los mapeados de iluminación admiten colores!
#* '''SpotSi:''' width of the spotlight beam in degrees.
# *'' 'SpotSi:''' anchura del haz de foco en grados.
#* '''SpotBl:''' softness of the spotlight edge. Softer edges create a more natural look for most aircraft lights.
# *'' 'SpotBl:''' suavizado del borde del haz de luz. Los bordes más suaves crean una apariencia más natural para las luces de la mayoría de los aviones.
# 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).
# Selecciona el objeto del cual deseas crear el lightmap. Entra en el modo de edición y luego de nuevo a modo de objeto (para cargar la textura del objeto).
# 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.
# Ve al menú de escena (F10) y abre la ficha Bake(hornear). Selecciona full render (render completo) y haz clic en el botón bake grande. Blender empezará a generar tu lightmap.
# Change your mainwindow (or add an extra window) to UV/Image editor. You will see the lightmap being created bit by bit.
# Cambia tu ventana principal (o añade una ventana extra) al editor de UV/Image. Verás que el lightmap se está creando poco a poco.
# When the lightmap is finished, click <tt>Image > Save as...</tt> and save the image in your aircraft's directory.
# Cuando el lightmap haya terminado, haz clic en <tt>Image > Save as...</tt> y guarda la imagen en el directorio de tu 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.


==== The xml ====
¡Eso es! Ahora, es probable que desees ver cómo se ve en tu avión, lo que se explica en el párrafo siguiente. Si aún no estás satisfecho con el resultado, puedes editar la configuración de la lámpara (paso 4) y añadir más luces para ver el resultado que tiene el efecto.
In your model's .xml file, add the following block of code:
 
==== El xml ====
En el archivo. xml de tu modelo XML, agregua el siguiente bloque de código:
<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
Line 55: Line 57:
</effect>
</effect>
</syntaxhighlight>
</syntaxhighlight>
In which:
En el que:
* '''image:''' [[#The lightmap|the lightmap itself]]
*'''image:''' es [[#The lightmap|el propio lightmap]]
* '''condition:''' when this property is greater than or equal to 1, the lightmap will be enabled.
*'''condition:''' cuando esta propiedad es mayor o igual a 1, el lightmap se habilitará.
* '''factor:''' can be used to control the intensity of the light, on a 0-1 scale.
*'''factor:''' se puede utilizar para controlar la intensidad de la luz, en una escala de 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.
Recuerda que este bloque se requiere para cada una de las texturas únicas que deseas mapear. Puedes tener varios objetos por efecto, pero no efectos múltiples por objeto.


==== Known problems ====
=== Problemas conocidos ===
* 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 no soporta múltiples shaders (sombreadores) por objeto. Por lo tanto, tendrás que elegir entre shaders o el lightmap, la [[Howto: Aircraft Reflection Shader|reflexión]] o el [[Howto: Use the normal map effect in aircraft|normalmap (mapeado normal)]].
* There is no flexible way to (de)select lightmaps on a per-object base. Currently it only listens to one per-object defineable property.
* No hay una manera flexible para (de)seleccionar un lightmap sobre una base por-objeto. En la actualidad sólo escucha a una sola de propiedad definible por objeto.


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

Latest revision as of 10:29, 20 April 2012

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.

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

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. Abrir/importar tu modelo en Blender.
  2. Ir a Add> Lamp , y seleccionar uno de los tipos de lámpara. La luz se creará en el origen del modelo.
  3. * 'Lamp:' la lámpara propaga la luz en todas direcciones. Puede ser utilizada para las luces anticolisión, luces de navegación, etc
  4. * 'Area:' longitud y tamaño del área de las lámparas, como en la iluminación del panel de instrumentos en el que se utilizan lámparas fluorescentes.
  5. * 'Spotlight:' para iluminar un area específica/dirección. Se utiliza para las luces de aterrizaje.
  6. Move/rotate situa la lámpara en el lugar preferido/orientación. Nota: dejar las herramientas de escala sin tocar, ampliar la lámpara NO afecta al lightmap.
  7. Seleccione la lámpara (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 importantesson:
  8. * 'Dist:' la distancia (en metros) en la que la intensidad de la luz es la mitad de intensa que en su fuente.
  9. * 'Energy:' intensidad de la luz.
  10. * 'R/G/B:' el color de la luz. Sí, los mapeados de iluminación admiten colores!
  11. * 'SpotSi:' anchura del haz de foco en grados.
  12. * 'SpotBl:' suavizado del borde del haz de luz. Los bordes más suaves crean una apariencia más natural para las luces de la mayoría de los aviones.
  13. Selecciona el objeto del cual deseas crear el lightmap. 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 abre la ficha Bake(hornear). Selecciona full render (render completo) y haz clic en el botón bake grande. Blender empezará a generar tu lightmap.
  15. Cambia tu ventana principal (o añade una ventana extra) al editor de UV/Image. Verás que el lightmap se está creando poco a poco.
  16. Cuando el lightmap haya terminado, haz clic en Image > Save as... y guarda la imagen en el directorio de tu 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 desees ver cómo se ve en tu avión, lo que se explica en el párrafo siguiente. Si aún no estás satisfecho con el resultado, puedes editar la configuración de la lámpara (paso 4) y añadir más luces para ver el resultado que tiene el efecto.

El xml

En el archivo. xml de tu modelo XML, agregua 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>

En el que:

  • image: es el propio lightmap
  • condition: cuando esta propiedad es mayor o igual a 1, el lightmap se habilitará.
  • factor: se puede utilizar para controlar la intensidad de la luz, en una escala de 0-1.

Recuerda que este bloque se requiere para cada una de las texturas únicas que deseas mapear. Puedes tener varios objetos por efecto, pero no efectos múltiples por objeto.

Problemas conocidos

  • FlightGear no soporta múltiples shaders (sombreadores) por objeto. Por lo tanto, tendrás que elegir entre shaders o el lightmap, la reflexión o el normalmap (mapeado normal).
  • No hay una manera flexible para (de)seleccionar un lightmap sobre una base por-objeto. En la actualidad sólo escucha a una sola de propiedad definible por objeto.