Mapdev:parallax: Difference between revisions

From Spring
Jump to navigationJump to search
created page
 
Gajop (talk | contribs)
 
(2 intermediate revisions by 2 users not shown)
Line 14: Line 14:
== 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 23: Line 23:
   },
   },
   ...
   ...
}</pre></code>
}</pre>
 
== Image File==
== Image File==
* Location: ./maps/
{| class="wikitable" width="100%"
* 8bpp RGBA, any resolution(will be stretched over the terrain).
! width="15%" | File Location
* Should be the same size as the specular tex
| ./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
|}
{{FIXME}} needs cleaning.
{{FIXME}} needs cleaning.
<pre>
<pre>
Line 42: Line 56:
* [http://springrts.com/phpbb/viewtopic.php?f=13&t=29108 Parallax Maps?]
* [http://springrts.com/phpbb/viewtopic.php?f=13&t=29108 Parallax Maps?]


[[Category:Development]]
[[Category:Map Dev]]
[[Category:Mapdev]]

Latest revision as of 16:37, 18 December 2018

Parallax Texture

modifies the diffuse, normal, and specular TEXTURE COORDINATES before sampling is done

FIXME: description as to why you want to use Parallax textures.

Example
FIXME: needs image file FIXME: needs image file
Without Parallax Map With Parallax Map

Specification

mapinfo.lua

The relevant sections of the mapinfo.lua

local mapinfo = {
   ...
   resources = {
      ...
      parallaxHeightTex = "parallax.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

FIXME: needs cleaning.

height, scale, and bias parameters are packed
as follows to produce a texel offset-factor f

h = (parallaxHeightTex.r * 65280 + parallaxHeightTex.g * 256) / 65536
s = (parallaxHeightTex.b)
b = (parallaxHeightTex.a - 0.5)
f = h * s + b

Forum Discussions