UV Projectors#
Overview#
UV projectors provide a method for applying UV texture coordinates to primitives in ovrtx. You can use UV projectors to apply textures to geometry that lacks proper UV texture coordinates, or override existing UV coordinates to achieve specific texture placements on objects.
UV projectors are particularly valuable when working with imported assets that have poor or missing UV mapping, allowing you to quickly apply professional texture coordinates without returning to your 3D modeling software. In this guide, you will learn how to create projectors, configure their attributes, and select the appropriate projection type for your geometry.
Note
UV projectors differ from projector lights. Projector lights project textures onto the scene from rectangular lights (similar to slide projectors), while UV projectors apply texture coordinates directly to geometry.
UV projectors applied to a variety of objects. From top to bottom: cubic, planar, spherical normalized, and triplanar projections.#
Creating a UV Projector#
Apply OmniProjectorAPI to a transformable prim to make that prim a UV
projector. This example applies the API to a dedicated CubicProjection
Xform, explicitly selects the cubic projection type, and scales the
generated UV coordinates:
def Xform "CubicProjection" (
prepend apiSchemas = ["OmniProjectorAPI"]
)
{
token omni:projector:type = "cubic"
double3 omni:projector:uv:scale = (5, 5, 5)
double3 xformOp:rotateXYZ = (0, 0, 0)
double3 xformOp:scale = (1, 1, 1)
double3 xformOp:translate = (0, 0, 0)
uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"]
}
The transform of /World/proj_cubic/cube/CubicProjection defines the
projector frame. Author the projector attributes described below on this prim.
Binding the UV Projector to a Prim#
To use the generated coordinates on geometry, apply OmniCoordSysAPI with
the desired texture-space instance and bind it to the projector. This example
applies OmniCoordSysAPI:st to the Cube and targets the separate
CubicProjection prim through coordSys:st:binding:
over "Cube" (
prepend apiSchemas = ["MaterialBindingAPI", "OmniCoordSysAPI:st"]
)
{
rel coordSys:st:binding = </World/proj_cubic/cube/CubicProjection>
rel material:binding = </World/Looks/mtl_uvalign> (
bindMaterialAs = "weakerThanDescendants"
)
}
st selects texture space 0. Use st1, st2, or st3 for the other
texture spaces. You can bind the same projector to multiple prims, apply
OmniCoordSysAPI to a parent prim to bind its descendants, or apply both APIs
to the same prim when a separate projector prim is unnecessary.
OmniProjectorAPI Attributes#
OmniProjectorAPI defines the following attributes:
Attribute |
Meaning |
|---|---|
|
Selects the projection type using a coordinate system based around the origin of the primitive to which you apply this API. Refer to Projector Types. |
|
Selects the space in which the system calculates the projection.
Object applies the projection in the local space of the primitive;
World applies it in world space; Texture takes UV coordinates from
the texture space selected by |
|
Selects the texture space to read when |
|
Translates the projection frame in the selected UV projector space. |
|
Rotates the projection frame in the selected UV projector space. |
|
Scales the projection frame in the selected UV projector space. |
|
Translates the computed projected UVs. |
|
Rotates the computed projected UVs. |
|
Scales the computed projected UVs. |
Projector Types#
You can apply the following types of UV projection to a primitive. The up direction is the Z axis in object space.
Type |
Effect |
|---|---|
|
Projects UVs from six planes, similar to how a cube would surround the primitive. |
|
Projects UVs as if the primitive were wrapped by a capped cylinder. |
|
A variant of the Cylindrical projection where the U coordinate is scaled to always fit within the standard [0,1] range, regardless of the object’s size. |
|
A Cylindrical UV mapping method that treats the cylinder as having infinite height. |
|
A combination of the Cylindrical Normalized and Infinite Cylindrical projections. |
|
Projects UVs onto the primitive from a single plane. |
|
Projects UVs as if the primitive were wrapped by a sphere. |
|
A variant of the Spherical projection where the calculated UV coordinates are always normalized to the [0,1] × [0,1] range, regardless of the object’s size. |
|
A UV mapping technique that blends UVs projected from three orthogonal planes (XY, XZ, YZ), minimizing visible seams and distortion. |
UV projectors let you quickly add or override texture coordinates without modifying your source geometry. For information about applying materials to textured geometry, refer to Material Binding.