Aller au contenu

Shader Node

By Kriss Norde

Shader applies custom shading in compositing to a 3D-rendered image, using the Normals and Position channels to compute Diffuse + Specular with a new light direction. It lets you change the lighting after the 3D render without re-rendering everything. A powerful tool for 2D relighting and compositing fine-tuning.

Overview

Shader computes per-pixel shading with the standard Diffuse + Specular model, using the EXR's auxiliary AOV channels:

  • Normals: the direction perpendicular to the surface
  • Position: the 3D coordinates of the surface

With this data + a light direction (and optionally the Camera Position for Specular), you can recompute the shading as if the scene had been lit differently. Not a full re-render, but a convincing approximate relight.

Where to find this node

  • Effects Library: Tools > Deep Pixel > Shader
  • Quick add: right-click in the Node Editor → Add Tool > Deep Pixel > Shader

How it works

Diffuse (Lambert)
Intensity = max(0, dot(Normal, Light Direction)). Surfaces facing the light = bright, surfaces at an angle = dark. The classic diffuse lighting model.
Specular (Phong)
A shiny reflection computed from the angle between the light reflection and the camera direction. Specular highlights.
Light Direction
Directional 3D vector of the light. Change it to change the orientation of the lighting.

Inputs

  • Image (orange) - beauty image (texture / albedo) to shade.
  • Normals (green) - Normals channel (from a multilayer EXR or a specialized node).
  • Position (blue) - optional, for precise Specular computation.

Setup

Relighting a 3D scene:
EXR (Beauty + Normals + Position) → Shader (Light Direction = top)
                                  → MediaOut (relit)

Adding secondary lighting in post:
EXR → Shader 1 (Light = original position)
   → Add (with)
   → Shader 2 (Light = new source)
   → MediaOut

Post-render specular tuning:
EXR → Shader (high Specular Power for crisp highlights)
   → MediaOut

Full relight workflow:
EXR → Channel Booleans (extract individual layers)
   → Shader (custom lighting)
   → Color Corrector (final mood)
   → MediaOut

Controls tab

Light Direction X / Y / Z (defaults: 0,1,0)
3D vector of the light. (0,1,0) = light from above, (1,0,0) = light from the right. Animate it to change the lighting over time.
Light Color (default: white)
Color of the light. Lets you add warm / cool / colored lighting.
Diffuse Strength (default: 1.0)
Intensity of the diffuse component. 0 = no diffuse, 1 = standard, 2+ = exaggerated lighting.
Specular Strength (default: 0.5)
Intensity of the specular highlights. 0 = matte surface, 1+ = glossy surface.
Specular Power (default: 32)
Concentration of the specular. Low = spread-out highlights (matte), high = crisp highlights (glossy).
Camera Position X / Y / Z
Camera position for the specular computation. Must match the original render camera.
Normals Channel / Position Channel
Source channels for the normals and position data.

Use cases

  • Post-render relighting - change the orientation of the main light of a 3D scene without launching a long re-render.
  • Adding secondary lighting - rim light, fill light, alternate key light = added in post with several combined Shaders.
  • Tweaking weak specular - the 3D render has highlights that are too weak: Shader boosts them without a re-render.
  • Multi-pass lighting consistency - different 3D passes with separate lighting: unify them through Shader = more consistent.
  • Stylized toon shading effect - very high Specular Power + saturated Light Color + stylized Diffuse = a cel-shaded / anime look.
  • Lighting animation - animate Light Direction = light that moves over time (sun motion, dynamic lighting).
  • Matching a multi-source shot - harmonize the lighting of several 3D assets rendered separately.

Tips

  • A Normals AOV is required - without a Normals channel exported by the 3D engine, Shader does nothing useful. Enable the Normals AOV in 3D.
  • Position for precise Specular - without Position, the Specular is less precise. For pro relighting, plug Position in too.
  • Correct Camera Position - the Specular depends on the camera. Grab the camera coordinates from the 3D render for accuracy.
  • Visualizing Light Direction - animate Light Direction X from -1 to 1 to see the effect on the shading. Helps you understand the vector convention.
  • Combine several Shaders - add up the contributions of several virtual lights with an Add (Channel Booleans Add) between Shaders.
  • Limits of the model - no shadows, GI or refraction. It is direct shading only. For photorealistic quality, re-render in 3D.
  • Combine it with the original Beauty - adding a Shader-only pass on top of the original Beauty (Add or Multiply) gives more finesse than replacing it entirely.
  • For pro workflows, prefer a 3D re-render when possible - Fusion's Shader does approximate relighting, not full physics.