Mapdev:normal: Difference between revisions

From Spring
Jump to navigationJump to search
Flozi (talk | contribs)
m 1cat
Gajop (talk | contribs)
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
[https://code.google.com/p/gimp-normalmap/ This GIMP plugin] provides various ways to convert heightmaps into normal maps.
[https://code.google.com/p/gimp-normalmap/ This GIMP plugin] provides various ways to convert heightmaps into normal maps.


{{infobox|title=Caution|icon=icon-caution.png|color=rgba(255,0,0,0.1)
{{Caution|Requires clients to have GLSL-spec hardware}}
|body=Requires clients to have GLSL-spec hardware}}
<center>
<center>
{| class="wikitable"
{| class="wikitable"
Line 13: Line 12:
! Without Normal Map !! With Normal Map
! Without Normal Map !! With Normal Map
|}</center>
|}</center>
= Important Info =
* The normal map effect will *not* be shown unless you have a specular map defined. It can be as simple as a full-black with full-black alpha image, TGA 32-bit format is recommended.<br />
* If you want to merge two normal maps, for instance, one for the terrain and one for the resources (metal, geo vents), it's not as simple as it might sound if you want to do it properly. You can read about it in detail [http://wiki.polycount.com/wiki/Normal_map here]. The "Whiteout" technique is recommended, there is a Photoshop action available for it [https://polycount.com/discussion/163801/udn-and-whiteout-normal-map-blending-photoshop-actions here]<br />


= 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 26: Line 30:
   },
   },
   ...
   ...
}</pre></code>
}</pre>
 
== Image File==
== Image File==
{| class="wikitable" width="100%"
{| class="wikitable" width="100%"

Latest revision as of 16:39, 18 December 2018

Normal Texture

Gives the terrain a normal map. This can be used to suggest small surface details while keeping terrain flat. The RGB channels determine the XYZ of the new surface normal (in tangent space), while the alpha channel determines how much of the original surface normal is kept.

This GIMP plugin provides various ways to convert heightmaps into normal maps.

Caution
Requires clients to have GLSL-spec hardware
Example
FIXME: needs image file FIXME: needs image file
Without Normal Map With Normal Map

Important Info

  • The normal map effect will *not* be shown unless you have a specular map defined. It can be as simple as a full-black with full-black alpha image, TGA 32-bit format is recommended.
  • If you want to merge two normal maps, for instance, one for the terrain and one for the resources (metal, geo vents), it's not as simple as it might sound if you want to do it properly. You can read about it in detail here. The "Whiteout" technique is recommended, there is a Photoshop action available for it here

Specification

mapinfo.lua

The relevant sections of the mapinfo.lua

local mapinfo = {
   ...
   resources = {
      ...
      detailNormalTex = "normal.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.
Modifies the shading normal as follows

shadingNormal.xyz = NORMALIZE(terrainNormal.xyz * (1 - detailNormalTex.a) 
                               + detailNormalTex.rgb)