LightsAndColor: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Kiheru →Blend layers =: typo in header |
imported>Kiheru →Blend layers: Started blend layers |
||
| (20 intermediate revisions by the same user not shown) | |||
| Line 25: | Line 25: | ||
== Blend layers == |
== Blend layers == |
||
The other zone coloring method specifies the blend modes used by the map layers ''blend_ground'' and ''blend_roof''. The first of those is blended with all layers below the player, and the latter with the roof layer. See the map editing instructions for information about the [[HowToUseTiledToCreateStendhalMaps#Layers|layers]]. Both of the blend layers will use the same mode. |
|||
TODO |
|||
TO BE CONTINUED... |
|||
== Available blends == |
|||
TODO |
|||
== Blend modes == |
|||
Coloring in Stendhal is based on [http://en.wikipedia.org/wiki/Blend_modes blend modes]. Some of the modes provided by the Stendhal client are similar to those in image manipulation programs, but some are specifically developed for the purposes of the game. All the modes, with the exception of '''time''', can be used for both ''color_method'' and ''blend_method''. |
|||
The exact formulas for the blend modes used by Stendhal can be found in the source file [http://arianne.cvs.sourceforge.net/viewvc/arianne/stendhal/src/games/stendhal/client/gui/j2d/Blend.java?view=markup src/games/stendhal/client/gui/j2d/Blend.java]. |
|||
Currently the client provides the following modes: |
|||
=== Bleach === |
|||
This Stendhal specific mode is used for lighting. The effect is cancelling the effect of '''multiply''' based on the lightness of the blending layer image. Also the restored light is tinted based on the color of blend layer image, so it is possible to have colored lights. |
|||
'''Bleach''' is named "bleach" in the xml, and is technically available only for zones where the general mode is '''multiply''' or '''time'''. However if the general mode is something else "bleach" will fall back to '''generic light''', so specifying bleach mode when you want to use the blend layers for lighting is safe. |
|||
=== Generic light === |
|||
Also a mode that is used for lights. Unlike '''bleach''', generic light can not create colored lights, but on the other hand it works on all zones regardless of the general lighting mode, including those that have no general mode specified at all. |
|||
'''Generic light''' is turned on with "generic_light", and it also serves as a fall back mode for '''bleach''' as noted above. |
|||
=== Multiply === |
|||
Multiply is similar to a mode provided by many graphics programs. In Stendhal it is used to simulate colored lighting, that is, the normal colors on the maps correspond to white light, and multiply is used to cut out some of light, with the color components of the zone color corresponding to the amount of remaining light. |
|||
'''Multiply''' can be turned on with "multiply" in the xml. The effect depends on the zone color. This is also the method used by the '''time''' pseudo mode. If used for the blend layers the effect would depend on the blending image colors. |
|||
=== Screen === |
|||
This is a mode often provided by image manipulation programs, and gets its name from photography. In Stendhal screen is currently only used for the twilight zone haze. |
|||
'''Screen''' can be turned on in the zone xml by the name "screen". The effect depends on the zone color, and in the case of using it for the blend layers, on the blending image colors. |
|||
=== Soft light === |
|||
This is a mode that would be typically used in image manipulation to create shadows and highlights. In Stendhal it is currently used to tint zones where the darkening effect of '''multiply''' is not desired. It us used for example in at ''-1_semos_yeti_cave''. |
|||
'''Soft light''' can be turned on by name "softlight" in the zone xml. The effect depends on the zone color, and in the case of using it for the blend layers, on the blending image colors. |
|||
=== True color === |
|||
This is the blend mode that is used for coloring player outfits, but it is also available for zones to use. The effect is coloring the underlaying image with the zone color, or in the case of using the mode in blend layers, with the color of the blending image. Also the lightness of the image is bent to the direction of the brightness of the blending color, so darker blends make the image generally darker, and lighter make the image lighter. The easiest place to observe the effect is the |
|||
outfit selection dialog. '''True color''' is used to create the green flames at ''int_magic_shrine''. |
|||
'''True color''' is named "truecolor" in the xml. |
|||
=== Time === |
|||
Time is not an actual mode at all, but it will tell the server to specify a time dependent '''multiply''' mode for the zone, and '''bleach''' for the blend layers. This is the mode used for all the outside zones to provide them their daylight cycle. |
|||
'''Time''' can be turned on by name "time" in the zone xml. Zones using this coloring mode can not specify another mode for the blend layers, as '''bleach''' is used automatically. Also, "time" is not a valid mode for the bland layers. |
|||