---
title: "PxrRoundCube"
canonical: "https://rmanwiki-27.pixar.com/space/REN27/542224705/PxrRoundCube"
format: markdown
---
![PxrRoundCube_AjaxMarble.png](media://5ce3435c-1788-45b6-9c88-34e1bbc5df1c)

This is a projection manifold for triplanar mapping. This technique is also sometimes called "blended cube". It is often used to texture a large environment without having to worry about UVs.

PxrRoundCube computes texture coordinates (UV) based on an object's surface position and orientation and can handle up to 6 sets of coordinates. It also outputs blending weights to be used by PxrMultiTexture.

The sculpture on the left was 3d-scanned and the irregular topology of the mesh makes it tricky to create nice UVs. This is a perfect use case for PxrRoundCube.



> ⚠️ You will need to modify your shading networks when importing old scenes.

## Input Parameters

#### Number Of Textures

You can choose to project 1, 3, or 6 images. The table below shows which textures will be used by the PxrMultiTexture node.

| **Number of textures** | **+X** | **+Y** | **+Z** | **-X** | **-Y** | **-Z** |
| --- | --- | --- | --- | --- | --- | --- |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 |
| 3 | 0 | 1 | 2 | 0 | 1 | 3 |
| 6 | 0 | 1 | 2 | 3 | 4 | 5 |

  


### Tiling

#### Tiling Mode

Select between Regular and Hexagonal tiling modes

### **Frequency**

  


### Manifold 3D

#### Transition Width


#### Pref

  


#### Nref

The name of the reference normal primvar (Maya uses __Nref). The normal reference may be used to keep the texture anchored to the surface while the object is deforming. If your deforming object is textured with PxrRoundCube, **you need __Nref AND __Pref** !

  


  


#### Coordinate System

Name of coordinate system transform (e.g. place3dtexture node in Maya). You can either use one of the predefined spaces ("world", "object", "current", etc) or the name of a coordinate system node in your scene. If empty, PxrRoundCube use "object" space.

  


  


#### Use Undisplaced Position

When an object is displaced using PxrRoundCube, textures used during shading by the bxdf will not line up correctly with regard to the displacement map. The reason is simple : the displacement shader has moved P and the patterns attached to the bxdf are using the displaced P instead of the original. To avoid this problem, enable useUndisplacedPosition and the pattern will use the undisplaced position (Po) instead of the current position (P). Note that, under the hood, PxrRoundCube also uses the original normal (Non) instead of the current normal (N) when this is enabled.

  


  


### Randomize

Sometimes, it is useful to randomize some of the parameters to make things look more natural...

#### Random Source

For each object to get a different variation, you need to select something unique about them to create a unique seed. You have a choice between the object's id and the object's name. These attributes are created by the software outputting the RIB and depending on your host, one may work better than the other.

| **Value** | **Meaning** | **Depends on** |
| --- | --- | --- |
| <sup>0</sup> | <sup>Object ID</sup> | <sup>Attribute "identifier" "float id"</sup> |
| <sup>1</sup> | <sup>Object Name</sup> | <sup>Attribute "identifier" "string name")</sup> |

  


  


#### Extra Seed

When set to zero, all PxrRoundCube patterns operating on the same node will compute the same random seed. If you want one of these patterns to compute a different variation, set the randomExtraSeed to a non-zero value.

![random_all_seed.gif](media://c8e5e0f9-46fe-400c-92ad-1409ad0ad27b)

#### Random Orientation

Set this parameter to 1 to randomly rotate the triplanar projection. By default, the axes will be in object-space. This means that 3 spheres with the same PxrRoundCube pattern will look exactly the same. When you randomize the axes' orientation, they all look different, even though they might have the same transform. Typically, this is useful to control random variations of a lot of objects (think "rocks on the ground") from a single source.

![orientation.gif](media://0392e0cd-0548-449f-9df6-7eafe780a097)

   


#### Random Flip

This switch will randomly flip st coordinates of each axis of the triplanar projection.

![flip.gif](media://b4240c93-4db0-4956-a9b6-9e3590c34f5a)

   


#### Random Offset

This switch will randomly offset st coordinates of each axis of the triplanar projection. You should probably make sure seams are not visible your texture is tiling.

![offsett.gif](media://291c8bd5-5f28-4d4d-b591-91d3809bf612)

   


### X Axis

#### Enable X

Enable or disable textures on the X axis.

![axis_none.gif](media://696d0e0d-0652-47f8-bc11-99241d09bad5)

   


  


> ✅ ### Project a label
> ✅ 
> ✅ You can create a simple label projection by enabling only one of the axes.

  


#### Scale S

Scale the textures on the X axis in the s direction (horizontal).

  


  


#### Scale T

Scale the textures on the X axis in the t direction (vertical).

  


  


#### Offset S

Offset the textures on the X axis in the s direction (horizontal).

  


  


#### Offset T

Offset the textures on the X axis in the t direction (vertical).

  


  


#### Invert S

Flip the textures on the X axis in the s direction (horizontal).

  


  


#### Invert T

Flip the textures on the X axis in the t direction (vertical).

  


  


#### Swap ST

Swap the s and t direction on the X axis. This is equivalent to a 90 degree rotation.

  


  


#### Pivot S

Position in s of the scaling center on the X axis.

  


  


#### Pivot T

Position in t of the scaling center on the X axis.

  


  


### Y Axis

Same controls as above for Y axis.

  


### Z Axis

Same controls as above for Z axis.

  


### Output Parameters

#### resultMask

The blending weights of the 3 axes, as an RGB output. Useful to tweak the projection result either in comp or further down the graph.

#### resultMulti

The struct outputting all required information for a PxrMultiTexture pattern.

  


  


  


  


# Tutorial

## Making rocks on the cheap

  


They all look different and reasonably natural (for a 10 mn job). We've earned that coffee !