Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Mapdev:lightemission: Difference between revisions

From FIGHTORDER
imported>Shadowfury333
imported>Gajop
 
(3 intermediate revisions by 2 users not shown)
Line 6: Line 6:
{| class="wikitable"
{| class="wikitable"
|+ Example
|+ Example
| {{FIXME}} needs image file || {{FIXME}} needs image file
|  
[[File:Map without light emission.jpg|frameless|Map without light emission]]
||
[[File:Map with light emission.jpg|frameless|Map with light emission]]
|-
|-
! Without Light Emission Texture!! With Light Emission Texture
! Without Light Emission Texture!! With Light Emission Texture
|}</center>
|}</center>
= Specification =
= Specification =
== mapinfo.lua ==
== mapinfo.lua ==
The relevant sections of the [[Mapdev:mapinfo.lua|mapinfo.lua]]
The relevant sections of the [[Mapdev:mapinfo.lua|mapinfo.lua]]
<code><pre>
<pre>
local mapinfo = {
local mapinfo = {
   ...
   ...
Line 22: Line 26:
   },
   },
   ...
   ...
}</pre></code>
}</pre>
 
== Image File==
== Image File==
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
Line 45: Line 50:
fragmentColor.rgb = fragmentColor.rgb * (1 - lightEmissionTex.a) + lightEmissionTex.rgb
fragmentColor.rgb = fragmentColor.rgb * (1 - lightEmissionTex.a) + lightEmissionTex.rgb
</pre>
</pre>
[[Category:Map Dev]]

Latest revision as of 15:39, 18 December 2018

Light Emission Texture

Adds colour to a fragment (pixel). The colour added is the RGB colour of the emission texture, while the alpha of the emission texture determines the amount of the original colour that remains.

Can be used for accentuation. For example, metal spots in shadowed regions

Example

Map without light emission

Map with light emission

Without Light Emission Texture With Light Emission Texture

Specification

mapinfo.lua

The relevant sections of the mapinfo.lua

local mapinfo = {
   ...
   resources = {
      ...
      lightEmissionTex = "light_emission.png",
      ...
   },
   ...
}

Image File

File Location ./maps/
File Format PNG, TGA
Colour Depth 8bpp
Channels RGBA
Resolution Any, recommended powers of two, will be stretched over the terrain. Should be the same size as the Mapdev:specular image
Modifies the fragment color as follows
 
fragmentColor.rgb = fragmentColor.rgb * (1 - lightEmissionTex.a) + lightEmissionTex.rgb