Skip to main content

PhysicalMaterial.MaterialChannel

A private class in Root.Township, the global namespace. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

Private: the render materials for one channel of a PhysicalMaterial, plus its atlas rect when the non-deforming material is baked into an atlas.

Constructors​

MemberWhat it is
MaterialChannel()Creates a PhysicalMaterial.MaterialChannel with default values.

Fields​

5 private and internal fields
MemberWhat it is
private Material atlasedMaterialBaked atlas material, set by SetupOffsetScale.
private Material materialBacking field for Material.
private bool needsFixingTrue once the material is mapped into an atlas.
private Material nonDeformingMaterialBacking field for NonAtlasedNonDeformingMaterial.
private Vector4 offsetScaleBacking field for OffsetScale.

Properties​

MemberWhat it is
Material Material { get; }The normal material.
Material NonAtlasedNonDeformingMaterial { get; }The non-deforming material before atlasing.
MaterialRect NonDeformingMaterial { get; }The atlased material with its offset and scale, as a MaterialRect.
Vector4 OffsetScale { get; }Atlas offset and scale of this material.

Methods​

MemberWhat it is
void CleanUp()Clears the atlas offset and the needs-fixing flag.
void Setup(Material material, Material nonDeformingMaterial)Sets the normal and non-deforming materials.
bool SetupOffsetScale(AtlasDefinition definition)If the atlas holds the non-deforming material, stores its rect and the baked material. Returns true on a match.

Used in​

Members of other types that take, return or hold a MaterialChannel: