Mapdev:specular: Difference between revisions
From Spring
Jump to navigationJump to search
m →Image File: used image template styling |
m 1cat |
||
| Line 63: | Line 63: | ||
* [http://springrts.com/phpbb/viewtopic.php?f=13&t=21951 Make Your Maps Shiny(er) With SSMF] | * [http://springrts.com/phpbb/viewtopic.php?f=13&t=21951 Make Your Maps Shiny(er) With SSMF] | ||
[[Category: | [[Category:Map Dev]] | ||
Revision as of 21:15, 20 March 2013
Specular
Gives you per-pixel control over the color and intensity of specular highlights anywhere on the map. You could eg. make all highlights red, or have them depend on the type of material that a pixel represents, or something more exotic Alpha defines how "polished" the surface looks, and and the RGB color is the amount of light that gets reflected for each color channel
| Caution | |
|---|---|
| requires clients to have GLSL-spec hardware |
![]() |
|
| Example Specular Texture | Ingame Result |
|---|
Specification
mapinfo.lua
The relevant sections of the mapinfo.lua
- If specularTex points to a file that does not exist, you will get full unmoderated specularity based on whatever your map's lighting settings are
local mapinfo = {
resources = {
...
specularTex = "",
...
},
...
lighting = {
...
groundSpecularColor = {0.1, 0.1, 0.1},
...
},
...
}
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. |
- The RGB channels will control the red, green, and blue contribution per highlight
- The alpha channel (multiplied by 16) becomes the specular exponent. Or on other words controls the sharpness of the specular highlights, the higher the value the sharper the highlights.
- You have to set the RGB values to zero if you want no specular contribution
| Caution | |
|---|---|
| Do not set the alpha value of the specular texture to zero, or you will get the below graphical artefacts. Use almost zero instead. |
|

