Shader Docs

This section gives you an overview of shaders and their properties. For a detailed explanation, see Material properties.

Understanding and leveraging RED4 shaders

We do not have official documentation from CDPR about how shaders are used by artists. Thus any 2d/3d artist is looking at hundreds of black-box shaders with unknown usage. This is extremely demotivating for anyone looking to bring new assets to life with REDengine. The following list of tables is an attempt to make life easier for artists by using the community to document commonly used shaders.

About the documentation

  • The name and path of each shader will be documented by the header.

  • Next we are using a table for each texture parameter with the exact name listed by CDPR in the w2mg file, how REDengine uses each specific RGBA channel, and the usable range of the channel if not 0-1/0-255.

  • When applicable, vertex color properties will be listed underneath the texture table with a similar format.

  • Scalar, vector, color, and other properties will follow with their own unique description table.

  • An asterisk (*) is used to notate some degree of uncertainty, or need for more independent testing.

Shaders

skin

The skin material is a versatile PBR (textured) shader.

base/materials/skin.mt

You can learn more about the skin shader under Material properties-> Hair and skin material properties.

While it is possible to use the skin shader for things that are not skin, you should consider using metal_base instead.

Notes

  • The DetailNormal texture contains generic normal details that are shared between most faces. This is not a tiling/procedural texture. The DetailNormalInfluence scalar parameter can be used to lower the intensity to simulate makeup or synthetic skin.\

  • The MicroDetail texture contains a microblend tiling texture used to add procedural detail to the normal map. We believe the Roughness texture blue channel is used to mask parts of the face from exhibiting this detail, such as the lips, eyelids, and ears.

mesh_decal

base/materials/mesh_decal.mt

Notes

  • DiffuseColor multiplies against the texture color to add procedural color

glass

There are many different other glass shaders. This is the most basic one, used for small objects:

base\materials\glass.mt

To see different glass materials and their configurations, check Material properties -> Transparent material properties.

television_ad

base\fx\shaders\television_ad.mt

Note

  • AdTexture: TV screen will play looping animations that are actually sprites like a .gif. We believe this is for optimization purposes since videos are heavy.

  • TilesWidth, TilesHeight, and PixelsHeight combine will help the game define the dimension of your tile (sprite) on the sprite sheet.

  • You should calculate your sprite sheet dimension so it completely fits in a square sheet. For example, a simple dimension is 5x5 tiles with 300x300 pixel sprite. Such a dimension will produce animation with 25 frames of a square sprite.

  • More examples of such sprite sheets can be found in the path below

base\environment\decoration\advertising\digital\textures\animated\textures

It's recommended that you use free tools like Ezgif.com to make .gif and convert it into a sprite sheet for AdTexture

  • There are many screen shaders, this one is used for small TV screens.

If used cleverly with a properly done mesh, you can make use of this shader to put animation on your clothing or other items

Last updated