Procedural Textures

From Bohemia Interactive Community
Revision as of 19:29, 31 January 2022 by Lou Montana (talk | contribs) (Add Point and Dithering + wiki formatting)
Jump to navigation Jump to search

Procedural textures are textures generated by the engine on the basis of their text description. They can be used anywhere instead of normal textures.
Text description of procedural texture is set in standard place of texture path and filename. To identify that a procedural texture is used, the character "#" is set at the beginning of the string.
Usually the string consists of procedural texture type name and arguments on both sides enclosed in brackets, in format #(leftArgs)TypeName(rightArgs).

Textures may be generated procedurally and they take nearly no space on HDD but they still use space in video memory. Yet, if two materials use the exact same procedural texture string, the texture already existing in video memory is used and not duplicated - thus it may be important to try and avoid creating unnecessary similar textures.

  • There cannot be any spaces or mathematical expressions within the string.
  • Decimals always have to be preceded by a 0 (e.g. 0.5 instead of .5).

Procedural Texture Types

Note that all texture types have in common the left-hand parameters list:

  • format - texture color format (can be rgb, argb, ai), a), i)
  • width - number of pixels in X, in power of two (e.g 1, 2, 4, 8, 16, 32, 64, 128 etc)
  • height - number of pixels in Y, in power of two (e.g 1, 2, 4, 8, 16, 32, 64, 128 etc)
  • mipmapsAmount - number of mipmaps




  • r, g, b, a - texture channels (Red, Green, Blue, Alpha)
  • textureType - texture type which match texture name ending without "_" (optional)


#(rgb,1,1,1)color(0.5,0.5,0.5,1)	// empty 1×1 detail map
#(rgb,1,1,1)color(0.5,0.5,1,1)		// empty 1×1 normal map

Render To Texture

  • surface - The name that will later be used as reference in the camera script
  • aspect - Aspect ratio of the image
Do not use capital letters when naming RTT surfaces.



Perlin Noise

  • xScale - horizontal noise scale (typically a multiple of 256)
  • yScale - horizontal noise scale (typically a multiple of 256)
  • min - minimum value
  • max - minimum value




  • specularPower - specular strenght

It is a values table that is used with per-pixel lighting. Modern shaders are not using this type of texture anymore.




see Super shader - Fresnel function



Fresnel Glass




Water Irradiance

  • specularPower - specular strenght

This texture main value is solely with special pixel shaders for water.


Tree Crown




for ambient lighting.

  • density - defines how much light passes thought tree-top via the longest line segment

This texture is used only for diffuse lighting actually it just counts exponential function (v PS2 can be done easily w/o texture).

Parameter defines how much surrounding light passes into the defined point. It uses an exponential function of distance from circle boundary.





Create a white dot on a transparent background.




  • min - minimum value
  • max - minimum value

The format has to be ai