ProjectCameraNormalMap
Overview
ProjectCameraNormalMap uses a camera frustum to directly apply a normal map texture to a material.
It uses the same setup as ProjectCameraMap_v2, requiring a projector object to directly apply the texture.
local projCam1 = Camera("projCam1")
{
["node xform"] = translate(0, 3, 75) * rotate(-5, 1, 0, 0) * rotate(90, 0, 1, 0),
["focal"] = 150,
["film width aperture"] = 24,
}
local projNormalMap = ProjectCameraNormalMap("projNormals") {
["projector"] = projCam1,
["texture"] = "myNormalTexture.tx",
["project_on_back_faces"] = false,
}
local mtl1 = DwaSolidDielectricMaterial("mtl1") {
["show diffuse"] = false,
["show specular"] = false,
["show emission"] = true,
["input_normal"] = projNormalMap,
}
Attribute Reference
General attributes
aspect_ratio_source
Int enum
0 = “from texture” (default)
1 = “custom”
Whether to use the image and pixel aspect ratio of the texture being projected, or a custom aspect ratio
custom_aspect_ratio
Float
default: 1.0
Custom aspect ratio for the projected texture to use when 'aspect_ratio_source' is set to 'custom'
normal_encoding
Int enum
0 = “[0,1]” (default)
1 = “[-1,1]”
Most normal maps are encoded [0,1]. Only certain rare floating point normal maps are encoded [-1,1]
project_on_back_faces
Bool
default: False
Toggles whether camera projections appear on back faces
projector
Camera
default: None
The camera to project from
texture
String filename
default:
Filename that points to a texture .exr or .tx file (must be mip-mapped and tiled with maketx).
use_reference_space
Bool
default: False
Use reference space position (ref_P) and normals (ref_N)