TangentSpaceDisplayFilter

Overview

The TangentSpaceDisplayFilter is a tool used with the baking camera to produce engine-ready normal maps.


Attribute Reference

Advanced attributes

invert_mask

Bool
default: False

Invert the value of the mask

mix

Float
default: 1.0

Blend [0,1] between input and output

General attributes

N

RenderOutput
default: None

Connect a RenderOutput with State N AOV here. Used to construct tangent space.

dPds

RenderOutput
default: None

Connect a RenderOutput with State dPds AOV here. Used to construct tangent space.

input

RenderOutput
default: None

RenderOutput to transform into tangent space

mask

RenderOutput
default: None

RenderOutput used to mask the output, revealing input1

normal_map_output

Bool
default: True

When on, encodes the output to clamped [0, 1] in the same manner as a normal map


Examples

local NMapBuf = RenderOutput("/NormalMapped") {
    ["file name"] = "result_tmp.exr",
    ["result"] = 7, -- material aov
    ["material aov"] = "normal"
}

local NBuf = RenderOutput("/NormalsBase") {
    ["file name"] = "result_tmp.exr",
    ["result"] = 7, -- material aov
    ["material aov"] = "N"
}

local dPdsBuf = RenderOutput("/dPds") {
    ["file name"] = "result_tmp.exr",
    ["result"] = 7, -- material aov
    ["material aov"] = "dPds"
}

local tangents = TangentSpaceDisplayFilter("/display/tangents") {
    ["normal_map_output"] = true, -- want a [0,1] encoding (default true)    
    ["input"] = NMapBuf,          -- transforming this 
    ["N"] = NBuf,                 -- using a basis constructed from this
    ["dPds"] = dPdsBuf,           -- and this 
}

RenderOutput("/output/tangents") {
    ["file name"] = "result0.exr",
    ["result"] = "display filter",
    ["display_filter"] = tangents,
    ["channel_name"] = "Nt"
}