Material

Creating and destroying materials

Sample code to create or to destroy a material using the RED::IResourceManager.

Enumerating a material controller's properties

Get a material controller from a material and enumerate its properties.

Loading and duplicating a material

Load a material from a .red file (or start from any material) and learn how to duplicate it.

Creating a generic material

Sample code to create a generic material and getting its material controller.

Loading a material from library

Sample code to load a material from REDmaterials.

Registering and adding a shader to a material pass

This task show how to register a shader to a material and add it to a rendering pass.

Writing a simple custom rendering shader

Sample code of a custom rendering shader in ARB and in GLSL.

Adding a shader parameter to a rendering shader

This task describes the setting of a RED::RenderShaderParameter to a custom RED::RenderShader.

Defining software shader DLL entry points

Sample code to define the DLL entry points of the software shader callbacks.

Defining software shader local entry points

Sample code to define the local entry points of the software shader callbacks.

Iterating over lights in a software shader

This task contains code to loop through the lights in a RED::MTL_LIT pass of a software shader.

Modifying a material priority

Sample code to change the rendering priority of a material inside a rendering pass.

Mimicking a direct shader setup for indirect rendering passes

This task shows how to use a built-in shader for indirect rendering pass.

Checking the availability of needed input geometry channels

How to ask a material what are the geometry channels it needs from geometry.

Creating a realistic metal material

How to setup a realistic material parameters to mimic a metallic surface

Creating a realistic glass material

How to setup a realistic material parameters to mimic a glass

Creating a realistic liquid material

How to setup a realistic material parameters to mimic a liquid

Creating a realistic wood material

How to setup a realistic material parameters to mimic a wooden surface with a varnish applied over it

Creating a realistic marble material

How to setup a realistic material parameters to mimic a marble

Creating a realistic cloth material

How to setup a realistic material parameters to mimic a cloth

Converting PBR metallic data to the realistic material

How to load textures from a PBR metallic workflow and convert them to be used with the realistic material.