Mapdev:splatdetailnormals: Difference between revisions

From Spring
Jump to navigationJump to search
Line 10: Line 10:


The system uses the same splatDistributionTexture as regular SSMF.
The system uses the same splatDistributionTexture as regular SSMF.
'''You cannot specify these options in .smd files, only .lua!'''


Example result:
Example result:

Revision as of 11:45, 10 February 2016

Detail Normal Texture Splatting (DNTS)

This extends the existing functionality of SSMF splatted detail textures Mapdev:splatdetail, with the option of specifying 4 different (normal map + greyscale diffuse map) detail textures.

Splatted detail textures only allowed grayscale textures to be overlayed on the map, while DNTS also allows normal maps as well.

Instead of creating a combined detail texture of 4 different single-channel diffuse detail textures stored in a single RGBA image, it uses four separate normal textures.

The textures must contain the normal maps in the RGB channel (standard normal maps), with a diffuse luminance in the alpha channel.

The system uses the same splatDistributionTexture as regular SSMF.

You cannot specify these options in .smd files, only .lua!

Example result:

Distribution Image

File Location ./maps/
File Format PNG, TGA, DDS
Colour Depth 8bpp
Channels RGBA
Resolution Any, recommended powers of two, will be stretched over the terrain.

The RGBA Channels are individual greyscale distribution maps which define which detail textures to splat onto the ground. The intensity of the splatted textures is multipled by the pixel values for the corresponding channels.

Example
Detail Distribution maps Combined Result

Detail Normal Textures

File Location ./maps/
File Format PNG, TGA, [DDS is supported but not fully recommended because it does not have support for anisotropic filtering]
Colour Depth 8bpp
Channels RGB for normal maps only, RGBA for normal map + diffuse map in alpha channel The Y (green) channel of normal maps should be inverted.
Resolution Any, recommended powers of two, will be tiled over the terrain.
Detail Normal Texture Example
Normal texture in RGB channel greyscale diffuse in ALPHA channel

Specification

Specify splatDetailNormalTex1 .. splatDetailNormalTex4 in the MAP resources section. splatDetailTex will be unused if and of splatDetailNormalTex[1-4] are present.

Specify splatDetailNormalDiffuseAlpha=1 to enable diffuse textures stored in alpha channels.

splatDetailNormalDiffuseAlpha=0 is the default value, and will ignore all and any alpha channels in the splatDetailNormalTex's, resulting in a purely normal mapped surface, with no extra diffuse texturing.

texScales and texMults work identically to Mapdev:splatdetail

mapinfo.lua

local mapinfo = {
   ...
   resources = {
      ...
      splatDistrTex = "splatDistributionTex.tga",
      splatDetailNormalDiffuseAlpha = 1,
      splatDetailNormalTex = {
         "sandpebbles_NORM.tga",
         "crystal_245_dnts.dds",
         "grass_91_dnts.dds",
         "pebbles_250_dnts_u8888.dds",
          alpha = true,
      },
      ...
   },
   ...
   splats = {
      texScales = {0.02, 0.02, 0.02, 0.02},
      texMults = {1.0, 1.0, 1.0, 1.0},
   },
   ...
}