Mapdev:normal: Difference between revisions
From Spring
Jump to navigationJump to search
m 1cat |
|||
| Line 45: | Line 45: | ||
|} | |} | ||
<pre> | <pre> | ||
Modifies the shading normal as follows | Modifies the shading normal as follows | ||
| Line 53: | Line 51: | ||
+ detailNormalTex.rgb) | + detailNormalTex.rgb) | ||
</pre> | </pre> | ||
[[Category:Map Dev]] | |||
Revision as of 21:15, 20 March 2013
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 |
| FIXME: needs image file | FIXME: needs image file |
| Without Normal Map | With Normal Map |
|---|
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)