Mapdev:skyreflectmod: Difference between revisions

From Spring
Jump to navigationJump to search
Gajop (talk | contribs)
 
(3 intermediate revisions by 2 users not shown)
Line 7: Line 7:
{| class="wikitable"
{| class="wikitable"
|+ Example
|+ Example
| {{FIXME}} needs image file || {{FIXME}} needs image file
| [[File: skyreflectmod_without_example.png|300px]]|| [[File: skyreflectmod_with_example.png|300px]]
|-
|-
! Without Sky Reflection Modifier Map !! With Sky Reflection Modifier Map
! Without Sky Reflection Modifier Map !! With Sky Reflection Modifier Map
Line 15: Line 15:
== 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 24: Line 24:
   },
   },
   ...
   ...
}</pre></code>
}</pre>
 
== Image File==
== Image File==
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
Line 54: Line 55:
diffuseColor = mix(diffuseColor, reflectionColor, skyReflectModTex)
diffuseColor = mix(diffuseColor, reflectionColor, skyReflectModTex)
</pre>
</pre>
[[Category:Map Dev]]

Latest revision as of 16:39, 18 December 2018

Sky Reflection Modifier Texture

Sets the weight for mixing the diffuse texture colour with the reflected colour of the sky. This occurs before any other shading calculations use the diffuse colour.

This can be used to suggest a surface composed of reflective materials, such as ice or crystals.

Example
Without Sky Reflection Modifier Map With Sky Reflection Modifier Map

Specification

mapinfo.lua

The relevant sections of the mapinfo.lua

local mapinfo = {
   ...
   resources = {
      ...
      skyReflectModTex = "skyreflectmod.png",
      ...
   },
   ...
}

Image File

File Location ./maps/
File Format PNG, TGA
Colour Depth 8bpp
Channels RGB
Resolution Any, recommended powers of two, will be stretched over the terrain. Should be the same size as the Mapdev:specular image
Modifies the diffuse colours as follows:
diffuseColor.r = diffuseColor.r * (1 - skyReflectModTex.r) +
                   reflectionColor.r * skyReflectModTex.r
diffuseColor.g = diffuseColor.g * (1 - skyReflectModTex.g) +
                   reflectionColor.g * skyReflectModTex.g
diffuseColor.b = diffuseColor.b * (1 - skyReflectModTex.b) +
                   reflectionColor.b * skyReflectModTex.b

Equivalent to the GLSL code: (diffuseColor is a vector)
diffuseColor = mix(diffuseColor, reflectionColor, skyReflectModTex)