Pivot Painter Tool 2.0 Material Functions

Choose your OS:

Pivot Painter 2 Material Functions enable you to tap into and decode useful model information stored by Pivot Painter 2 MAXScript using textures. Each texture output by the MAXScript can be referenced directly in a Material but without applying the proper steps after sampling the texture the values would be incorrect. These Material Functions found in this page make it easy to quickly decode the texture information.

A lot of the Material Functions included in this page will enable you to use the Pivot Painter 2 pivot and rotational information to do specific effects via your Material, however, one of the greater benefits of Pivot Painter 2 is its ease of use with the provided sample shader for foliage; PivotPainter2FoliageShader. This specific Material Function enables you to quickly setup your model and its Pivot Painter 2 generated textures with your foliage to quickly create wind and turbulence without having to create your own Material network.

Pivot Painter 2 Functions

The following is a list of all the functions related to Pivot Painter 2.0.

PivotPainter2FoliageShader

PP2_FoliageShader.png

This Material Function contains texture and numeric parameters that should be altered to fit your particular asset.

PivotPainter2FoliageShader Workflow

For this particular function, you should create a Material Instance of your Material so that you can access the Material Function's already setup parameters for wind and turbulence.

Also, for this particular function, it is suggested that you create a Material Instance, where the Material Function's parameters will be accessible to make changes to your Pivot Painter 2 shader.

Click image for full size view.

Item

Description

Inputs

Material Attributes

Make sure that you are using tangent space normals within your material and that the Use Tangent Space Normals option is unchecked. The normals will be transformed to world space internally.

Pivot Painter Texture Coordinate

Takes an input to reference which texture coordinate UV is being used.

Outputs

Final Material with World Space Normals

This output material attribute replaces the input material attribute's world position offset and normal output if Animate Level "X" Normals is enabled in the Material Instance.

Updating the model's normals is fairly expensive and can be done selectively.

Modified World Space Normal Component

This output returns the modified asset normals by itself.

World Position Offset Component

This output returns the new world position offset values.

ms_PivotPainter2_CalculateMeshElementIndex

PP2_CalculateMeshElementIndex.png

This Material Function pulls the model's Element ID from the model's UVs.

Item

Description

Inputs

Data Texture Dimensions

Use the texture property node to gather the texture's dimensions.

Pivot Painter UV Coordinates

Pulls the model elements element ID from the model's UVs.

Outputs

Index

This output pulls the model element ID from the model's UVs.

ms_PivotPainter2_Decode8BitAlphaAxisExtent

PP2_Decode8bitAlphaAxisExtent.png

This Material Function rescales 8-bit axis extent texture data information from Pivot Painter 2 MAXScript into world space data.

Item

Description

Inputs

8 Bit Alpha Extent Value

Insert a Pivot Painter 2 alpha texture component from a texture with an 8-bit alpha extent value. This can be generated by selecting the appropriate option from the alpha output drop-down option in the Pivot Painter 2 MAXScript under the Render Options.

Outputs

Rescaled Extent

The output value represents the chosen models' length along a given axis starting at the object's pivot points. The return value can represent values between 8 to 2048 in increments of 8.

ms_PivotPainter2_DecodeAxisVector

PP2_DecodeAxisVector.png

This Material Function transforms Pivot Painter 2's local space vector information into world space vectors.

Item

Description

Inputs

Axis Vector RGB

Input RGB vector information from a Pivot Painter 2 texture that output those values.

Outputs

Result

The input axis vector information has now been transformed to world space.

ms_PivotPainter2_DecodePosition

PP2_DecodePosition.png

This Material Function transforms Pivot Painter 2's local space information into world position information.

Item

Description

Inputs

Position RGB

Insert the RGB values of a texture that contain Pivot Painter 2 Pivot Position (16-bit) data.

Outputs

Result

The output value is the world space location of each model's pivot point position as it was captured by Pivot Painter 2.

ms_PivotPainter2_ReturnParentTextureInfo

PP2_ReturnParentTextureInfo.png

This Material Function reads a parent sub-object's texture data using Pivot Painter 2's Parent Index (Integer as Float) texture data.

Item

Description

Inputs

Parent Index As Float

This input assumes that the data is in float form. If you're reading from a parent index "int as float" texture, first decode the asset using the Material Function ms_PivotPainter2_UnpackIntegerAsFloat.

Texture Dimensions

The current dimensions of the texture.

Current Index

Providing this value is only necessary if you would like to determine if this asset is a child of another component.

Outputs

Parent UVs

This outputs the UV coordinates for the element's parent element pixel location.

Is Child?

This returns 1 if the object is a child of another object. It returns 0 otherwise. This requires that the current index to be entered in the Current Index input. The current index can be found by using ms_PivotPainter2_CalculateMeshElementIndex if you are referencing your textures using the model's UVs.

ms_PivotPainter2_UnpackIntegerAsFloat

PP2_UnpackIntegerAsFloat.png

This Material Function decodes Pivot Painter 2's Integer as Float texture data.

Item

Description

Inputs

Integer as Float

This decodes the integer data for conversion to float data.

Outputs

Result

This outputs Pivot Painter integer as float data.