Note:  The Katana scene file for this example - textureProjection.katana - is included in$KATANA_RESOURCES/Examples/katana_files. 

In this example, we use texture projections as layer masks.

Texture projection using a camera coordinate system can be done via the following shaders:

 

Projection Manifold

To create a projection manifold:


It's a good idea to double-check the RIB to make sure the CoordinateSystem and its transformation are emitted. For example:

TransformBegin
Translate 0.99622 1.84374 12.2671
Rotate -1.98663e-06 0 0 1
Rotate 0.572957 0 1 0
Rotate 9.74029 1 0 0
Scale 1 1 1
CoordinateSystem "frontProjCamCoordSys"
TransformEnd



Projection Layer

The PxrProjectionLayer node is similar to PxrTexture except it is optimized for using with PxrProjector and it handles the projection mask appropriately.


If necessary, adjust the Missing Color and Missing Alpha for the area that are missed by the projection.


Projection Stack

The PxrProjectionStack node combines the projection layer nodes.


It is tricky in Katana to connect a dynamic array of shader nodes, so we need to create a ShadingNodeArrayConnector that holds the array. Here are the steps:


Wire resultRGB of the Projection Stack to any color parameter for a pattern or material (Bxdf) and you'll see the projected texture!