Assigning materialsΒΆ

Using master Shaders

A master Shader contains either a surface/volume shader or a displacement shader, or both. Materials can range from physically plausible models to the most simple ones that just return a plain color.

The Guerilla library contains 3 main shaders, Surface, Curves and Displacement. See the Library documentation for more information on those materials.

You can create your own shader by creating/importing/copying a shader node into your scene. The shader will be visible in the Shader drop down list, as if it was directly in the library. If the shader has the same name than a library shader (like 'Surface'), the shader in the scene will override the shader from the library. Assigning a Shader

The Shaders are assigned to a RenderGraph flow.

  1. Go in the RenderGraph node network.
  2. Create a shader using the node picker (Ctrl+Space then type the node name you want, like 'surface', 'displacement', etc..)
    .. or select a node in 'Library > Materials'
  3. Insert the node in the flow by draging it over a connection (the mouse cursor should be over the curve).
  4. Edit the material attributes using the Properties view.
A default Surface material is assigned to everything in the default RenderGraph. Assigning a Shader preset

Guerilla Render is shipped with some presets of the default shaders.

  1. Go in the RenderGraph node network.
  2. Create a preset using the node picker (Ctrl+Space then type the node name you want, like 'carpaint', 'glass', etc..)
    .. or select a node in 'Library > rendergraph > presets'
  3. Insert the node in the flow by draging it over a connection (the mouse cursor should be over the curve).
  4. Edit the material attributes using the Properties view.

The available presets for the Surface shader are :

  • CarPaint: a mix of diffuse and metal covered with a coating varnish to be used as industrial paint.
  • Glass: a refractive material with glass index of refraction (1.5).
  • Matte: a rough material, with very low specular influence.
  • Metal: a fully metallic material.
  • Plastic: a diffuse and specular material, suitable for plastic surfaces.
  • Skin: a SSS and specular material, with color setup to match human skin.
  • VarnishWood: a rough material coated with shiny and colored varnish.
  • Water: a refractive material with water index of refraction (1.33).

Using Materials

An alternative to shaders are Materials. Materials allow more complex shading networks and allow to control several shading parameters in the same shading network. A Material can be used to set the surface, displacement and volume shaders in the same unit, and set their individual parameters in the same manner as the Shader nodes.

Assigning shaders using the Material node

In the RenderGraph, bring the Node Picker (Ctrl+Space) then type 'Material' and select Material:

In the Material properties, select the appropriate surface, displacement and volume shaders:

Unfold the Surface/Displacement/Volume Parameters to edit the shaders parameters:

Inputs can be exposed as regular inputs and will be available in the Shader properties. Subshaders can be connected to these exposed inputs. Connecting shaders parameters in shading networks

Double-click the Material node to enter its internal shading network. This action creates an empty shader named Shader inside the Material node, with a default Surface node and DiffuseColor output:

Create new outputs for the Surface output using the Create item in the Surface properties:

Connect a shading network to both parameters. In the following example, a Texture is connected to both DiffuseColor and MetalColor parameters of the Surface2 shader:

Add a displacement output

In the RenderGraph, bring the Node Picker (Ctrl+Space) then type 'Output:' and select 'Output: :

Available output node are Surface, Displacement, Volume, Blend (which allows controlling the layer blending directly in the shading network, see User Guide/Shading/Layering Shader Parameters) and Custom (which allows to output custom values such as Density for procedural control, for instance.) It is possible to create as many output node as needed for clarity, but it is not allowed to have multiple outputs of the same name for the same shader (for instance, multiple DiffuseColor outputs will result in unpredictable result.)