MasterTech.Matter.Runtime
Product: Matter
Compiled public/protected signature count: 780.
This reference includes source-authored summaries when available, plus compiled signatures, overloads, parameters, and return types. Where source comments are absent, conservative descriptions are derived from member names, accessors, and signatures. C# aliases are used while namespace qualification is retained for unambiguous lookup.
MasterTech.Matter.Data.ReactionGpuData
Advanced reference. Descriptions may be generated from compiled signatures.
public struct MasterTech.Matter.Data.ReactionGpuData
Dense pair-table entry consumed by MatterCommon.hlsl. A zero rate is an unused entry. The explicit two-lane layout must remain exactly 32 bytes.
Properties
| Member | Signature | Description |
|---|---|---|
Empty |
MasterTech.Matter.Data.ReactionGpuData Empty { get:public; } |
Gets an empty value. |
IsActive |
bool IsActive { get:public; } |
Gets whether this value is active. |
Fields
| Member | Signature | Description |
|---|---|---|
flags |
public uint flags |
Stores the flags value. |
heatDelta |
public float heatDelta |
Stores the heat delta value. |
padding0 |
public uint padding0 |
Stores the padding 0 value. |
padding1 |
public uint padding1 |
Stores the padding 1 value. |
padding2 |
public uint padding2 |
Stores the padding 2 value. |
productA |
public uint productA |
Stores the product a value. |
productB |
public uint productB |
Stores the product b value. |
rate |
public float rate |
Stores the rate value. |
SizeInBytes |
public static int SizeInBytes |
Provides the size in bytes value. |
MasterTech.Matter.Data.ReactionGpuFlags
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Data.ReactionGpuFlags
Defines the available reaction GPU flags values.
Fields
| Member | Signature | Description |
|---|---|---|
Bidirectional |
public static MasterTech.Matter.Data.ReactionGpuFlags Bidirectional |
Provides the bidirectional value. |
None |
public static MasterTech.Matter.Data.ReactionGpuFlags None |
Provides the none value. |
MasterTech.Matter.Data.ReactionRule
Advanced reference. Descriptions may be generated from compiled signatures.
public class MasterTech.Matter.Data.ReactionRule
Authoring-time pair reaction stored with Unity's native serializer.
Properties
| Member | Signature | Description |
|---|---|---|
Bidirectional |
bool Bidirectional { get:public; } |
Gets whether bidirectional. |
HeatDelta |
float HeatDelta { get:public; } |
Gets the heat delta. |
ProductA |
MasterTech.Matter.Data.SubstanceDefinition ProductA { get:public; } |
Gets the product a. |
ProductB |
MasterTech.Matter.Data.SubstanceDefinition ProductB { get:public; } |
Gets the product b. |
Rate |
float Rate { get:public; } |
Gets the rate. |
SubstanceA |
MasterTech.Matter.Data.SubstanceDefinition SubstanceA { get:public; } |
Gets the substance a. |
SubstanceB |
MasterTech.Matter.Data.SubstanceDefinition SubstanceB { get:public; } |
Gets the substance b. |
Constructors
ReactionRule
Overload 1
Creates a new ReactionRule instance.
Signature
public void .ctor()
Overload 2
Creates a new ReactionRule instance.
Signature
public void .ctor(MasterTech.Matter.Data.SubstanceDefinition first, MasterTech.Matter.Data.SubstanceDefinition second, MasterTech.Matter.Data.SubstanceDefinition firstProduct, MasterTech.Matter.Data.SubstanceDefinition secondProduct, float reactionRate, float reactionHeatDelta, bool isBidirectional)
Parameters
| Name | Type | Description |
|---|---|---|
first |
MasterTech.Matter.Data.SubstanceDefinition |
The first value. |
second |
MasterTech.Matter.Data.SubstanceDefinition |
The second value. |
firstProduct |
MasterTech.Matter.Data.SubstanceDefinition |
The first product value. |
secondProduct |
MasterTech.Matter.Data.SubstanceDefinition |
The second product value. |
reactionRate |
float |
The reaction rate value. |
reactionHeatDelta |
float |
The reaction heat delta value. |
isBidirectional |
bool |
Whether is bidirectional. |
Methods
Configure
Configure the supplied values.
Signature
public void Configure(MasterTech.Matter.Data.SubstanceDefinition first, MasterTech.Matter.Data.SubstanceDefinition second, MasterTech.Matter.Data.SubstanceDefinition firstProduct, MasterTech.Matter.Data.SubstanceDefinition secondProduct, float reactionRate, float reactionHeatDelta, bool isBidirectional)
Parameters
| Name | Type | Description |
|---|---|---|
first |
MasterTech.Matter.Data.SubstanceDefinition |
The first value. |
second |
MasterTech.Matter.Data.SubstanceDefinition |
The second value. |
firstProduct |
MasterTech.Matter.Data.SubstanceDefinition |
The first product value. |
secondProduct |
MasterTech.Matter.Data.SubstanceDefinition |
The second product value. |
reactionRate |
float |
The reaction rate value. |
reactionHeatDelta |
float |
The reaction heat delta value. |
isBidirectional |
bool |
Whether is bidirectional. |
MasterTech.Matter.Data.SubstanceBakeData
Advanced reference. Descriptions may be generated from compiled signatures.
public class MasterTech.Matter.Data.SubstanceBakeData
Represents substance bake data.
Properties
| Member | Signature | Description |
|---|---|---|
Count |
int Count { get:public; } |
Gets the count. |
Reactions |
MasterTech.Matter.Data.ReactionGpuData[] Reactions { get:public; } |
Gets the reactions. |
Substances |
MasterTech.Matter.Data.SubstanceGpuData[] Substances { get:public; } |
Gets the substances. |
Constructors
SubstanceBakeData
Creates a new SubstanceBakeData instance.
Signature
public void .ctor(MasterTech.Matter.Data.SubstanceGpuData[] substances, MasterTech.Matter.Data.ReactionGpuData[] reactions)
Parameters
| Name | Type | Description |
|---|---|---|
substances |
MasterTech.Matter.Data.SubstanceGpuData[] |
The substances value. |
reactions |
MasterTech.Matter.Data.ReactionGpuData[] |
The reactions value. |
Methods
GetReaction
Get the reaction.
Signature
public MasterTech.Matter.Data.ReactionGpuData GetReaction(int materialA, int materialB)
Parameters
| Name | Type | Description |
|---|---|---|
materialA |
int |
The material a value. |
materialB |
int |
The material b value. |
Returns
MasterTech.Matter.Data.ReactionGpuData: The resulting reaction GPU data value.
MasterTech.Matter.Data.SubstanceBoundaryBlendSettings
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Data.SubstanceBoundaryBlendSettings
Controls the render-only transition between this substance and another terrain substance. Consumers must resolve a material pair symmetrically: hard-interface is the logical OR of both records and each remaining numeric control is the arithmetic mean of the two authored values. Organic noise must likewise be seeded from the unordered pair of stable substance IDs so swapping A and B cannot move the boundary.
Properties
| Member | Signature | Description |
|---|---|---|
BlendWidthCells |
float BlendWidthCells { get:public; set:public; } |
Visual material-transition width in reference cells. |
HardInterface |
bool HardInterface { get:public; set:public; } |
Preserves a sharp visual interface rather than a soft material blend. |
HeightContrast |
float HeightContrast { get:public; set:public; } |
Contrast applied to the boundary's height-based blend signal. |
HeightInfluence |
float HeightInfluence { get:public; set:public; } |
Contribution of authored texture height to material-boundary blending. |
OrganicIrregularity |
float OrganicIrregularity { get:public; set:public; } |
Visual variation that breaks up uniform material-transition edges. |
Constructors
SubstanceBoundaryBlendSettings
Creates a new SubstanceBoundaryBlendSettings instance.
Signature
public void .ctor()
MasterTech.Matter.Data.SubstanceDatabase
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Data.SubstanceDatabase
Ordered substance and reaction authoring asset. Its list positions define persistent material IDs.
Properties
| Member | Signature | Description |
|---|---|---|
BakedReactions |
System.Collections.Generic.IReadOnlyList<MasterTech.Matter.Data.ReactionGpuData> BakedReactions { get:public; } |
Current baked reaction records, including generated reverse rules where requested. |
BakedSubstances |
System.Collections.Generic.IReadOnlyList<MasterTech.Matter.Data.SubstanceGpuData> BakedSubstances { get:public; } |
Current baked simulation records; rebake after changing authored behavior. |
BakeRevision |
uint BakeRevision { get:public; } |
Revision incremented when simulation data is rebaked; consumers use it to refresh bindings. |
Count |
int Count { get:public; } |
Number of authored substance slots, including any invalid null entries awaiting repair. |
HasGpuBuffers |
bool HasGpuBuffers { get:public; } |
True when both database GPU buffer references exist; simulation-only consumers need not allocate them. |
ReactionBuffer |
UnityEngine.ComputeBuffer ReactionBuffer { get:public; } |
Database-owned reaction GPU buffer; do not dispose it from a consumer. |
Reactions |
System.Collections.Generic.IReadOnlyList<MasterTech.Matter.Data.ReactionRule> Reactions { get:public; } |
Read-only view of authored reaction rules to validate and bake. |
RenderLibrary |
MasterTech.Matter.Data.SubstanceRenderLibrary RenderLibrary { get:public; } |
Separate baked presentation asset associated with this database. |
SubstanceBuffer |
UnityEngine.ComputeBuffer SubstanceBuffer { get:public; } |
Database-owned simulation GPU buffer; do not dispose it from a consumer. |
Substances |
System.Collections.Generic.IReadOnlyList<MasterTech.Matter.Data.SubstanceDefinition> Substances { get:public; } |
Read-only view of ordered definitions. Reordering changes saved and replicated material identities. |
Constructors
SubstanceDatabase
Creates a new SubstanceDatabase instance.
Signature
public void .ctor()
Methods
Bake
Builds CPU records and uploads them to structured GPU buffers.
Signature
public void Bake()
BakeToCpu
Validates and bakes deterministic CPU records without requiring a graphics device. IDs are the stable positions in the explicitly ordered substance list.
Signature
public MasterTech.Matter.Data.SubstanceBakeData BakeToCpu()
Returns
MasterTech.Matter.Data.SubstanceBakeData: The validated baked substance and reaction records, with ordered IDs assigned.
CollectRenderValidationErrors
Collects presentation validation failures separately from physical and reaction validation.
Signature
public System.Collections.Generic.List<string> CollectRenderValidationErrors()
Returns
System.Collections.Generic.List<string>: An owned list of errors; empty when rendering inputs validate.
CollectValidationErrors
Collects authored substance and reaction errors without repairing or baking assets.
Signature
public System.Collections.Generic.List<string> CollectValidationErrors()
Returns
System.Collections.Generic.List<string>: An owned list of errors; empty when simulation inputs validate.
Dispose
Releases GPU resources; it does not delete the ScriptableObject or its authored definitions.
Signature
public void Dispose()
GetDefinition
Returns the definition at a material ID. Throws ArgumentOutOfRangeException when the ID is outside the ordered list.
Signature
public MasterTech.Matter.Data.SubstanceDefinition GetDefinition(ushort materialId)
Parameters
| Name | Type | Description |
|---|---|---|
materialId |
ushort |
Stable positional ID in the target substance database. |
Returns
MasterTech.Matter.Data.SubstanceDefinition: The definition in that slot; a null slot indicates invalid authored data.
ReleaseGpuBuffers
Releases the database's allocated simulation GPU buffers while retaining authored and baked records.
Signature
public void ReleaseGpuBuffers()
SetReactions
Replaces authored reaction rules; validate and rebake before consuming them in simulation.
Signature
public void SetReactions(System.Collections.Generic.IEnumerable<MasterTech.Matter.Data.ReactionRule> rules)
Parameters
| Name | Type | Description |
|---|---|---|
rules |
System.Collections.Generic.IEnumerable<MasterTech.Matter.Data.ReactionRule> |
Reaction rules whose substance references belong to this database. |
SetRenderLibrary
Associates the generated render-only library with this stable substance ordering.
Signature
public void SetRenderLibrary(MasterTech.Matter.Data.SubstanceRenderLibrary library)
Parameters
| Name | Type | Description |
|---|---|---|
library |
MasterTech.Matter.Data.SubstanceRenderLibrary |
Generated render-library asset corresponding to this database ordering. |
SetSubstances
Replaces the authored ordering. Establish IDs before shipping; this does not remap existing saved cells.
Signature
public void SetSubstances(System.Collections.Generic.IEnumerable<MasterTech.Matter.Data.SubstanceDefinition> definitions)
Parameters
| Name | Type | Description |
|---|---|---|
definitions |
System.Collections.Generic.IEnumerable<MasterTech.Matter.Data.SubstanceDefinition> |
Definitions in their permanent material-ID order. |
TryGetMaterialId
Finds a definition in the current ordered list without changing the database.
Signature
public bool TryGetMaterialId(MasterTech.Matter.Data.SubstanceDefinition definition, ushort& materialId)
Parameters
| Name | Type | Description |
|---|---|---|
definition |
MasterTech.Matter.Data.SubstanceDefinition |
Definition whose identity or configuration is being used. |
materialId |
ushort& |
Stable positional ID in the target substance database. |
Returns
bool: True if the definition is present; materialId then contains its index.
MasterTech.Matter.Data.SubstanceDefinition
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Data.SubstanceDefinition
Authored material behavior and appearance; its database assigns the stable positional ID.
Properties
| Member | Signature | Description |
|---|---|---|
BaseColor |
UnityEngine.Color BaseColor { get:public; } |
Base color of the substance. Cell temperature applies the Temperature Color Gradient on top of this authored appearance. |
BoiledResult |
MasterTech.Matter.Data.SubstanceDefinition BoiledResult { get:public; } |
Substance produced when this substance reaches or exceeds Boil Point. Leave empty for no boil transition. |
BoilPoint |
float BoilPoint { get:public; } |
Boil or transition point in degrees Celsius. |
CollideWithTerrain |
bool CollideWithTerrain { get:public; } |
Prevents this substance from moving through Matter terrain occupancy when terrain collision is evaluated. |
ColorGradient |
UnityEngine.Gradient ColorGradient { get:public; } |
Maps encoded cell temperature from 0 °C at the left edge to 255 °C at the right edge. The runtime blends from Base Color toward the gradient's right-edge color. |
Compressibility |
float Compressibility { get:public; } |
Allowed fill-pressure imbalance before liquid equalization. Higher values tolerate a larger imbalance. |
CondensedResult |
MasterTech.Matter.Data.SubstanceDefinition CondensedResult { get:public; } |
Substance produced when this substance cools after boiling. Leave empty when condensation is not applicable. |
Density |
float Density { get:public; } |
Relative mass density. Denser substances settle below lighter substances when their phases can exchange positions. |
Dispersion |
float Dispersion { get:public; } |
How strongly a gas spreads toward neighboring cells. Zero stays ballistic; one uses the full dispersion rate. |
DisplayName |
string DisplayName { get:public; } |
Name shown in Matter authoring tools and substance lists. |
DynamicObjectCollisionLayers |
UnityEngine.LayerMask DynamicObjectCollisionLayers { get:public; } |
Unity object layers that block this substance in the optional dynamic-object coupling. Displacement layers always imply collision even when they are not also selected here. |
DynamicObjectDisplacementLayers |
UnityEngine.LayerMask DynamicObjectDisplacementLayers { get:public; } |
Unity object layers that may conservatively push this substance out of newly occupied cells when displacement is enabled. |
DynamicObjectImpactWaveLayers |
UnityEngine.LayerMask DynamicObjectImpactWaveLayers { get:public; } |
Unity object layers that may create entry and underwater waves when this substance is a liquid. |
Flammable |
bool Flammable { get:public; } |
Allows the substance to enter the burning state when ignition conditions are met. |
FlowRate |
float FlowRate { get:public; } |
Maximum mobility used by liquid and powder flow. Zero does not flow; one uses the full available transfer rate. |
FreezePoint |
float FreezePoint { get:public; } |
Freeze point in degrees Celsius. |
FrozenResult |
MasterTech.Matter.Data.SubstanceDefinition FrozenResult { get:public; } |
Substance produced when this substance reaches or falls below Freeze Point. Leave empty for no freeze transition. |
Id |
ushort Id { get:public; } |
Last assigned database index; use the owning database to resolve membership rather than editing this value. |
Phase |
MasterTech.Matter.Data.SubstancePhase Phase { get:public; } |
Simulation category that determines how the substance moves and which renderer path displays it. |
Rendering |
MasterTech.Matter.Data.SubstanceRenderingSettings Rendering { get:public; } |
Texture, mapping, blending, transparency, and lighting settings baked into the Substance Render Library. |
SelfTemperatureStrength |
float SelfTemperatureStrength { get:public; } |
Maximum self heating/cooling rate in Celsius degrees per simulated second; zero disables it. |
StandardTemperature |
byte StandardTemperature { get:public; } |
Default paint temperature in degrees Celsius. |
SurroundingTemperatureStrength |
float SurroundingTemperatureStrength { get:public; } |
Rate contributed to each occupied edge neighbor toward the target, in Celsius degrees per simulated second. |
TargetTemperature |
int TargetTemperature { get:public; } |
Persistent target in whole Celsius degrees, from zero through 255. |
Viscosity |
float Viscosity { get:public; } |
Resistance to movement. Zero is freely mobile; one prevents the normal flow contribution. |
Constructors
SubstanceDefinition
Creates a new SubstanceDefinition instance.
Signature
public void .ctor()
Methods
Configure
Runtime/editor construction API used by importers and tests.
Signature
public void Configure(string name, MasterTech.Matter.Data.SubstancePhase substancePhase, float substanceDensity, float substanceViscosity, float substanceFlowRate, float substanceDispersion, float substanceCompressibility, UnityEngine.Color substanceColor, bool isFlammable, bool collidesWithTerrain, byte standardTemperatureCelsius)
Parameters
| Name | Type | Description |
|---|---|---|
name |
string |
Asset name sought by the editor lookup. |
substancePhase |
MasterTech.Matter.Data.SubstancePhase |
Movement/rendering phase of the authored substance. |
substanceDensity |
float |
Nonnegative relative mass density. |
substanceViscosity |
float |
Resistance to normal flow, in [0, 1]. |
substanceFlowRate |
float |
Normal transfer mobility factor in [0, 1]. |
substanceDispersion |
float |
Gas-spreading factor in [0, 1]. |
substanceCompressibility |
float |
Allowed fill-pressure imbalance factor. |
substanceColor |
UnityEngine.Color |
Base authored cell color. |
isFlammable |
bool |
Whether the authored substance can participate in burning behavior. |
collidesWithTerrain |
bool |
Whether this substance participates in authored terrain-collision classification. |
standardTemperatureCelsius |
byte |
Default paint temperature in the representable Celsius range. |
ConfigureDynamicObjectInteraction
Configures optional dynamic-object coupling without changing the packed cell or simulation substance GPU ABIs.
Signature
public void ConfigureDynamicObjectInteraction(UnityEngine.LayerMask collisionLayers, UnityEngine.LayerMask displacementLayers, UnityEngine.LayerMask impactWaveLayers)
Parameters
| Name | Type | Description |
|---|---|---|
collisionLayers |
UnityEngine.LayerMask |
Unity object layers whose dynamic silhouettes can block this material when coupling is enabled. |
displacementLayers |
UnityEngine.LayerMask |
Object layers permitted to displace this material when displacement coupling is enabled. |
impactWaveLayers |
UnityEngine.LayerMask |
Object layers permitted to drive this material's impact waves when that coupling is enabled. |
ConfigurePhaseChanges
Assigns freeze/boil thresholds and product definitions. Validate and rebake the owning database afterward.
Signature
public void ConfigurePhaseChanges(float freezingTemperature, float boilingTemperature, MasterTech.Matter.Data.SubstanceDefinition frozen, MasterTech.Matter.Data.SubstanceDefinition boiled, MasterTech.Matter.Data.SubstanceDefinition condensed)
Parameters
| Name | Type | Description |
|---|---|---|
freezingTemperature |
float |
Freeze threshold in degrees Celsius. |
boilingTemperature |
float |
Boil threshold in degrees Celsius, not below the freeze threshold. |
frozen |
MasterTech.Matter.Data.SubstanceDefinition |
Optional product below the freeze threshold. |
boiled |
MasterTech.Matter.Data.SubstanceDefinition |
Optional product above the boil threshold. |
condensed |
MasterTech.Matter.Data.SubstanceDefinition |
Optional condensation product; referenced products must belong to the same database. |
ConfigureRendering
Assigns rendering-only authoring data without changing the simulation GPU ABI.
Signature
public void ConfigureRendering(MasterTech.Matter.Data.SubstanceRenderingSettings settings)
Parameters
| Name | Type | Description |
|---|---|---|
settings |
MasterTech.Matter.Data.SubstanceRenderingSettings |
Value-type settings to compare or apply; caller retains its copy. |
ConfigureTemperatureControl
Sets active thermal behavior. Validate and rebake the owning database after changing it.
Signature
public void ConfigureTemperatureControl(int targetCelsius, float selfDegreesPerSecond, float surroundingDegreesPerSecond)
Parameters
| Name | Type | Description |
|---|---|---|
targetCelsius |
int |
Target temperature from zero through 255 Celsius degrees. |
selfDegreesPerSecond |
float |
Self rate in [0, 65535]; zero disables this contribution. |
surroundingDegreesPerSecond |
float |
Rate for each edge neighbor in [0, 65535]; zero disables this contribution. |
SetColorGradient
Replaces the temperature-color gradient, using a valid fallback when none is supplied.
Signature
public void SetColorGradient(UnityEngine.Gradient gradient)
Parameters
| Name | Type | Description |
|---|---|---|
gradient |
UnityEngine.Gradient |
Authored mapping from encoded cell temperature to color. |
MasterTech.Matter.Data.SubstanceGlossMapChannel
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Data.SubstanceGlossMapChannel
Defines the available substance gloss map channel values.
Fields
| Member | Signature | Description |
|---|---|---|
Alpha |
public static MasterTech.Matter.Data.SubstanceGlossMapChannel Alpha |
Provides the alpha value. |
Red |
public static MasterTech.Matter.Data.SubstanceGlossMapChannel Red |
Provides the red value. |
MasterTech.Matter.Data.SubstanceGlossMapEncoding
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Data.SubstanceGlossMapEncoding
Defines the available substance gloss map encoding values.
Fields
| Member | Signature | Description |
|---|---|---|
Roughness |
public static MasterTech.Matter.Data.SubstanceGlossMapEncoding Roughness |
Provides the roughness value. |
Smoothness |
public static MasterTech.Matter.Data.SubstanceGlossMapEncoding Smoothness |
Provides the smoothness value. |
MasterTech.Matter.Data.SubstanceGpuData
Advanced reference. Descriptions may be generated from compiled signatures.
public struct MasterTech.Matter.Data.SubstanceGpuData
Baked material record consumed by MatterCommon.hlsl. The explicit five-lane layout is part of the compute-shader ABI and must remain exactly 80 bytes.
Fields
| Member | Signature | Description |
|---|---|---|
auxiliary |
public UnityEngine.Vector4 auxiliary |
Stores the auxiliary value. |
boiledId |
public uint boiledId |
Stores the boiled ID value. |
boilPoint |
public float boilPoint |
Stores the boil point value. |
color |
public UnityEngine.Vector4 color |
Stores the color value. |
compressibility |
public float compressibility |
Stores the compressibility value. |
condensedId |
public uint condensedId |
Stores the condensed ID value. |
density |
public float density |
Stores the density value. |
dispersion |
public float dispersion |
Stores the dispersion value. |
flags |
public uint flags |
Stores the flags value. |
flowRate |
public float flowRate |
Stores the flow rate value. |
freezePoint |
public float freezePoint |
Stores the freeze point value. |
frozenId |
public uint frozenId |
Stores the frozen ID value. |
InvalidSubstanceId |
public static uint InvalidSubstanceId |
Provides the invalid substance ID value. |
phase |
public uint phase |
Stores the phase value. |
SizeInBytes |
public static int SizeInBytes |
Provides the size in bytes value. |
viscosity |
public float viscosity |
Stores the viscosity value. |
MasterTech.Matter.Data.SubstanceGpuFlags
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Data.SubstanceGpuFlags
Defines the available substance GPU flags values.
Fields
| Member | Signature | Description |
|---|---|---|
CollidesWithTerrain |
public static MasterTech.Matter.Data.SubstanceGpuFlags CollidesWithTerrain |
Provides the collides with terrain value. |
Flammable |
public static MasterTech.Matter.Data.SubstanceGpuFlags Flammable |
Provides the flammable value. |
None |
public static MasterTech.Matter.Data.SubstanceGpuFlags None |
Provides the none value. |
MasterTech.Matter.Data.SubstanceHeightBlendSettings
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Data.SubstanceHeightBlendSettings
Controls height-aware blending within one substance's texture sets.
Properties
| Member | Signature | Description |
|---|---|---|
DetailBias |
float DetailBias { get:public; set:public; } |
Bias shifting the detail-height blend signal relative to base height. |
DetailContrast |
float DetailContrast { get:public; set:public; } |
Contrast applied to the detail-height blend signal. |
DetailInfluence |
float DetailInfluence { get:public; set:public; } |
Contribution of detail-map height to base/detail blending. |
VariantBias |
float VariantBias { get:public; set:public; } |
Bias shifting which height samples dominate variant transitions. |
VariantContrast |
float VariantContrast { get:public; set:public; } |
Contrast applied to heights used when blending variants. |
VariantInfluence |
float VariantInfluence { get:public; set:public; } |
Contribution of authored height to texture-variant transitions. |
Constructors
SubstanceHeightBlendSettings
Creates a new SubstanceHeightBlendSettings instance.
Signature
public void .ctor()
MasterTech.Matter.Data.SubstancePhase
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Data.SubstancePhase
Defines the available substance phase values.
Fields
| Member | Signature | Description |
|---|---|---|
Gas |
public static MasterTech.Matter.Data.SubstancePhase Gas |
Provides the gas value. |
Liquid |
public static MasterTech.Matter.Data.SubstancePhase Liquid |
Provides the liquid value. |
Powder |
public static MasterTech.Matter.Data.SubstancePhase Powder |
Provides the powder value. |
Solid |
public static MasterTech.Matter.Data.SubstancePhase Solid |
Provides the solid value. |
Static |
public static MasterTech.Matter.Data.SubstancePhase Static |
Provides the static value. |
MasterTech.Matter.Data.SubstanceRenderGpuData
Advanced reference. Descriptions may be generated from compiled signatures.
public struct MasterTech.Matter.Data.SubstanceRenderGpuData
Render-only data indexed by the stable substance ID. This deliberately stays separate from the simulation's 80-byte SubstanceGpuData ABI.
Fields
| Member | Signature | Description |
|---|---|---|
absorption |
public UnityEngine.Vector4 absorption |
RGB absorption color; A absorption strength. |
boundary |
public UnityEngine.Vector4 boundary |
X inter-material blend width in cells; Y height influence; Z height contrast; W interface behavior (-1 hard, otherwise organic irregularity). |
detail |
public UnityEngine.Vector4 detail |
X detail influence; Y detail contrast; Z detail bias; W gloss-map influence. |
edgeTint |
public UnityEngine.Vector4 edgeTint |
RGB edge tint; A tint strength. |
emission |
public UnityEngine.Vector4 emission |
RGB emission color; A temperature-emission strength. |
firstTextureSet |
public uint firstTextureSet |
Stores the first texture set value. |
flags |
public uint flags |
Stores the flags value. |
heightNormal |
public UnityEngine.Vector4 heightNormal |
X height influence; Y height contrast; Z height-normal strength; W map-normal strength. |
hotEmission |
public UnityEngine.Vector4 hotEmission |
RGB hot-emission color; A rim power. |
lightControl |
public UnityEngine.Vector4 lightControl |
X direct strength; Y ambient strength; Z shadow strength; W diffuse band count. |
mapping |
public UnityEngine.Vector4 mapping |
X stochastic patch world size; Y stochastic blend width; Z render-only surface elevation; W elevation-edge strength. |
mappingMode |
public uint mappingMode |
Stores the mapping mode value. |
misc |
public UnityEngine.Vector4 misc |
X soft edge; Y variant bias; Z diffuse-band softness; W surface model. |
response |
public UnityEngine.Vector4 response |
X specular intensity; Y sharpness; Z cavity strength; W emission strength. |
rim |
public UnityEngine.Vector4 rim |
RGB rim color; A rim strength. |
SizeInBytes |
public static int SizeInBytes |
Provides the size in bytes value. |
textureSetCount |
public uint textureSetCount |
Stores the texture set count value. |
tintAndAlbedo |
public UnityEngine.Vector4 tintAndAlbedo |
RGB overall texture tint; A authored-color to texture-color influence. |
topTint |
public UnityEngine.Vector4 topTint |
RGB top-surface tint; A tint strength. |
transparency |
public UnityEngine.Vector4 transparency |
X opacity; Y cutout threshold; Z refraction; W surface highlight. |
variation |
public UnityEngine.Vector4 variation |
X region world size; Y transition width; Z deterministic seed; W total set weight. |
MasterTech.Matter.Data.SubstanceRenderGpuFlags
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Data.SubstanceRenderGpuFlags
Defines the available substance render GPU flags values.
Fields
| Member | Signature | Description |
|---|---|---|
None |
public static MasterTech.Matter.Data.SubstanceRenderGpuFlags None |
Provides the none value. |
RandomizePatchMirror |
public static MasterTech.Matter.Data.SubstanceRenderGpuFlags RandomizePatchMirror |
Provides the randomize patch mirror value. |
RandomizePatchRotation |
public static MasterTech.Matter.Data.SubstanceRenderGpuFlags RandomizePatchRotation |
Provides the randomize patch rotation value. |
MasterTech.Matter.Data.SubstanceRenderingSettings
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Data.SubstanceRenderingSettings
Rendering-only authoring data owned by a substance definition. It is intentionally separate from MasterTech.Matter.Data.SubstanceGpuData.
Properties
| Member | Signature | Description |
|---|---|---|
BoundaryBlending |
MasterTech.Matter.Data.SubstanceBoundaryBlendSettings BoundaryBlending { get:public; set:public; } |
Visual transitions between this material and its neighbors. |
HeightBlending |
MasterTech.Matter.Data.SubstanceHeightBlendSettings HeightBlending { get:public; set:public; } |
Height-based variant and base/detail blending settings. |
Lighting |
MasterTech.Matter.Data.SubstanceStylizedLightingSettings Lighting { get:public; set:public; } |
Per-substance light response, relief, highlights and emission settings. |
Mapping |
MasterTech.Matter.Data.SubstanceTextureMappingSettings Mapping { get:public; set:public; } |
World-space placement settings shared by the substance's aligned maps. |
TextureColorInfluence |
float TextureColorInfluence { get:public; set:public; } |
Blend between authored substance color and sampled albedo color. |
TextureSets |
System.Collections.Generic.IReadOnlyList<MasterTech.Matter.Data.SubstanceTextureSet> TextureSets { get:public; } |
Read-only view of the authored weighted base/detail texture sets. |
Transparency |
MasterTech.Matter.Data.SubstanceTransparencySettings Transparency { get:public; set:public; } |
Per-substance surface model and optical settings. |
Variation |
MasterTech.Matter.Data.SubstanceTextureVariationSettings Variation { get:public; set:public; } |
Deterministic texture-set region selection settings. |
Fields
| Member | Signature | Description |
|---|---|---|
MaxTextureSetCount |
public static int MaxTextureSetCount |
Maximum of eight texture sets per substance supported by the baked representation. |
Constructors
SubstanceRenderingSettings
Creates a new SubstanceRenderingSettings instance.
Signature
public void .ctor()
Methods
AddTextureSet
Adds an authored texture set; validation enforces the supported count and map requirements.
Signature
public void AddTextureSet(MasterTech.Matter.Data.SubstanceTextureSet set)
Parameters
| Name | Type | Description |
|---|---|---|
set |
MasterTech.Matter.Data.SubstanceTextureSet |
Texture-set definition to add. |
ClearTextureSets
Removes authored texture-set references; existing baked output must be regenerated.
Signature
public void ClearTextureSets()
SetTextureSets
Replaces the authored texture-set collection. Validate and bake rendering data before use.
Signature
public void SetTextureSets(System.Collections.Generic.IEnumerable<MasterTech.Matter.Data.SubstanceTextureSet> sets)
Parameters
| Name | Type | Description |
|---|---|---|
sets |
System.Collections.Generic.IEnumerable<MasterTech.Matter.Data.SubstanceTextureSet> |
Authored texture sets in their intended order. |
MasterTech.Matter.Data.SubstanceRenderLibrary
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Data.SubstanceRenderLibrary
Baked material presentation and texture-tier ownership. Author definitions and rebake rather than editing generated buffers.
Properties
| Member | Signature | Description |
|---|---|---|
ActiveTextureResolution |
int ActiveTextureResolution { get:public; } |
Most recently resolved active tier resolution, falling back to the base bake resolution. |
AlbedoArray |
UnityEngine.Texture2DArray AlbedoArray { get:public; } |
Borrowed array for base albedo/opacity from the resolved default tier or baked fallback. Do not destroy it from a consumer. |
BakeRevision |
uint BakeRevision { get:public; } |
Revision used to detect replacement of baked presentation data. |
DetailAlbedoArray |
UnityEngine.Texture2DArray DetailAlbedoArray { get:public; } |
Borrowed array for detail albedo/opacity from the resolved default tier or baked fallback. Do not destroy it from a consumer. |
DetailHeightArray |
UnityEngine.Texture2DArray DetailHeightArray { get:public; } |
Borrowed array for detail height from the resolved default tier or baked fallback. Do not destroy it from a consumer. |
DetailNormalArray |
UnityEngine.Texture2DArray DetailNormalArray { get:public; } |
Borrowed array for detail tangent-space normals from the resolved default tier or baked fallback. Do not destroy it from a consumer. |
DetailSurfaceArray |
UnityEngine.Texture2DArray DetailSurfaceArray { get:public; } |
Borrowed array for detail packed surface properties from the resolved default tier or baked fallback. Do not destroy it from a consumer. |
HasGpuBuffers |
bool HasGpuBuffers { get:public; } |
True while both render-record and texture-set GPU buffers are usable. |
HasNativeQualityTiers |
bool HasNativeQualityTiers { get:public; } |
True when project-generated texture tiers are addressable through the cache path prefix. |
HeightArray |
UnityEngine.Texture2DArray HeightArray { get:public; } |
Borrowed array for base height from the resolved default tier or baked fallback. Do not destroy it from a consumer. |
NormalArray |
UnityEngine.Texture2DArray NormalArray { get:public; } |
Borrowed array for base tangent-space normals from the resolved default tier or baked fallback. Do not destroy it from a consumer. |
RenderData |
System.Collections.Generic.IReadOnlyList<MasterTech.Matter.Data.SubstanceRenderGpuData> RenderData { get:public; } |
Read-only view of baked per-substance shader records. |
SubstanceCount |
int SubstanceCount { get:public; } |
Number of per-substance render records in the current bake. |
SurfaceArray |
UnityEngine.Texture2DArray SurfaceArray { get:public; } |
Borrowed array for base packed surface properties from the resolved default tier or baked fallback. Do not destroy it from a consumer. |
TextureArrayResourcePathPrefix |
string TextureArrayResourcePathPrefix { get:public; } |
Project runtime-cache resource prefix used to resolve platform texture tiers. |
TextureResolution |
int TextureResolution { get:public; } |
Authored base texture-array resolution recorded by the bake. |
TextureSetCount |
int TextureSetCount { get:public; } |
Number of baked texture-set records referenced by the substance records. |
TextureSets |
System.Collections.Generic.IReadOnlyList<MasterTech.Matter.Data.SubstanceTextureSetGpuData> TextureSets { get:public; } |
Read-only view of baked texture-set shader records. |
UsesSeparatedHeightPacking |
bool UsesSeparatedHeightPacking { get:public; } |
True when height maps use their own arrays instead of legacy packed channels. |
Constructors
SubstanceRenderLibrary
Creates a new SubstanceRenderLibrary instance.
Signature
public void .ctor()
Methods
BindDisabled
Writes disabled material-library bindings into a property block for an untextured fallback.
Signature
public static void BindDisabled(UnityEngine.MaterialPropertyBlock block)
Parameters
| Name | Type | Description |
|---|---|---|
block |
UnityEngine.MaterialPropertyBlock |
Caller-owned reusable material property block; its consumer must release a retained binding when finished. |
CollectValidationErrors
Collects missing-array, record and count problems without baking or changing source assets.
Signature
public System.Collections.Generic.List<string> CollectValidationErrors(int expectedSubstanceCount)
Parameters
| Name | Type | Description |
|---|---|---|
expectedSubstanceCount |
int |
Required record count, or -1 to skip that external count check. |
Returns
System.Collections.Generic.List<string>: An owned list of render-library failures; empty when validation succeeds.
ConfigureBakedData
Overload 1
Editor baker entry point. Arrays are expected to be persistent assets.
Signature
public void ConfigureBakedData(int resolution, UnityEngine.Texture2DArray bakedAlbedoArray, UnityEngine.Texture2DArray bakedHeightArray, UnityEngine.Texture2DArray bakedSurfaceArray, UnityEngine.Texture2DArray bakedNormalArray, UnityEngine.Texture2DArray bakedDetailAlbedoArray, UnityEngine.Texture2DArray bakedDetailHeightArray, UnityEngine.Texture2DArray bakedDetailSurfaceArray, UnityEngine.Texture2DArray bakedDetailNormalArray, MasterTech.Matter.Data.SubstanceRenderGpuData[] bakedRenderData, MasterTech.Matter.Data.SubstanceTextureSetGpuData[] bakedTextureSets)
Parameters
| Name | Type | Description |
|---|---|---|
resolution |
int |
Positive source-normalization or texture-array resolution in pixels. |
bakedAlbedoArray |
UnityEngine.Texture2DArray |
Baked base albedo/opacity array aligned with texture-set slice indices. |
bakedHeightArray |
UnityEngine.Texture2DArray |
Optional separated base-height array. |
bakedSurfaceArray |
UnityEngine.Texture2DArray |
Baked packed base surface-property array. |
bakedNormalArray |
UnityEngine.Texture2DArray |
Baked base normal array. |
bakedDetailAlbedoArray |
UnityEngine.Texture2DArray |
Baked detail albedo/opacity array aligned with texture-set slice indices. |
bakedDetailHeightArray |
UnityEngine.Texture2DArray |
Optional separated detail-height array. |
bakedDetailSurfaceArray |
UnityEngine.Texture2DArray |
Baked packed detail surface-property array. |
bakedDetailNormalArray |
UnityEngine.Texture2DArray |
Baked detail normal array. |
bakedRenderData |
MasterTech.Matter.Data.SubstanceRenderGpuData[] |
Baked per-substance render records in database order. |
bakedTextureSets |
MasterTech.Matter.Data.SubstanceTextureSetGpuData[] |
Baked texture-set records with aligned array slices. |
Overload 2
Compatibility entry point for libraries baked before height was separated from RGBA surface packing. It deliberately preserves the original six arrays and never rewrites their texture assets.
Signature
public void ConfigureBakedData(int resolution, UnityEngine.Texture2DArray bakedAlbedoArray, UnityEngine.Texture2DArray bakedSurfaceArray, UnityEngine.Texture2DArray bakedNormalArray, UnityEngine.Texture2DArray bakedDetailAlbedoArray, UnityEngine.Texture2DArray bakedDetailSurfaceArray, UnityEngine.Texture2DArray bakedDetailNormalArray, MasterTech.Matter.Data.SubstanceRenderGpuData[] bakedRenderData, MasterTech.Matter.Data.SubstanceTextureSetGpuData[] bakedTextureSets)
Parameters
| Name | Type | Description |
|---|---|---|
resolution |
int |
Positive source-normalization or texture-array resolution in pixels. |
bakedAlbedoArray |
UnityEngine.Texture2DArray |
Baked base albedo/opacity array aligned with texture-set slice indices. |
bakedSurfaceArray |
UnityEngine.Texture2DArray |
Baked packed base surface-property array. |
bakedNormalArray |
UnityEngine.Texture2DArray |
Baked base normal array. |
bakedDetailAlbedoArray |
UnityEngine.Texture2DArray |
Baked detail albedo/opacity array aligned with texture-set slice indices. |
bakedDetailSurfaceArray |
UnityEngine.Texture2DArray |
Baked packed detail surface-property array. |
bakedDetailNormalArray |
UnityEngine.Texture2DArray |
Baked detail normal array. |
bakedRenderData |
MasterTech.Matter.Data.SubstanceRenderGpuData[] |
Baked per-substance render records in database order. |
bakedTextureSets |
MasterTech.Matter.Data.SubstanceTextureSetGpuData[] |
Baked texture-set records with aligned array slices. |
ConfigureTieredBakedData
Configures lightweight render metadata that resolves shared binary texture tiers from Resources at runtime.
Signature
public void ConfigureTieredBakedData(int fullResolution, string resourcePathPrefix, MasterTech.Matter.Data.SubstanceRenderGpuData[] bakedRenderData, MasterTech.Matter.Data.SubstanceTextureSetGpuData[] bakedTextureSets)
Parameters
| Name | Type | Description |
|---|---|---|
fullResolution |
int |
Resolution in pixels of the full available texture tier. |
resourcePathPrefix |
string |
Project Resources prefix used to load generated platform texture tiers. |
bakedRenderData |
MasterTech.Matter.Data.SubstanceRenderGpuData[] |
Baked per-substance render records in database order. |
bakedTextureSets |
MasterTech.Matter.Data.SubstanceTextureSetGpuData[] |
Baked texture-set records with aligned array slices. |
Dispose
Releases this library's runtime resources and retained consumer bindings without deleting the asset.
Signature
public void Dispose()
ReleaseBinding
Releases the texture-tier ownership associated with a property block after its renderer stops using it. Other bindings remain valid. Disposing the library releases all remaining bindings.
Signature
public void ReleaseBinding(UnityEngine.MaterialPropertyBlock block)
Parameters
| Name | Type | Description |
|---|---|---|
block |
UnityEngine.MaterialPropertyBlock |
The previously bound property block. |
ReleaseGpuBuffers
Releases generated GPU buffers and retained runtime tier bindings; authored metadata remains intact.
Signature
public void ReleaseGpuBuffers()
TryBind
Binds presentation data and retains the selected texture tier for this property block. Reuse the block while rendering and call MasterTech.Matter.Data.SubstanceRenderLibrary.ReleaseBinding(UnityEngine.MaterialPropertyBlock) when its consumer stops using it.
Signature
public bool TryBind(UnityEngine.MaterialPropertyBlock block, int expectedSubstanceCount, int textureQuality)
Parameters
| Name | Type | Description |
|---|---|---|
block |
UnityEngine.MaterialPropertyBlock |
The reusable property block owned by the consumer. |
expectedSubstanceCount |
int |
The simulation's substance count. |
textureQuality |
int |
Texture tier: 0 = 2K, 1 = 1K, 2 = 512, 3 = 256, 4 = 4K, 5 = 8K. |
Returns
bool: Whether the library was valid and its resources were bound.
MasterTech.Matter.Data.SubstanceStylizedLightingSettings
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Data.SubstanceStylizedLightingSettings
Per-substance lighting, elevation, highlights, tint and emission baked into presentation records.
Properties
| Member | Signature | Description |
|---|---|---|
AmbientStrength |
float AmbientStrength { get:public; set:public; } |
Multiplier for ambient illumination on this substance. |
CavityStrength |
float CavityStrength { get:public; set:public; } |
Darkening of fine surface recesses for this material. |
DiffuseBandCount |
int DiffuseBandCount { get:public; set:public; } |
Number of discrete diffuse bands used by stylized lighting. |
DiffuseBandSoftness |
float DiffuseBandSoftness { get:public; set:public; } |
Softens transitions between the substance's diffuse lighting bands. |
DirectLightStrength |
float DirectLightStrength { get:public; set:public; } |
Multiplier for direct illumination on this substance. |
EdgeTint |
UnityEngine.Color EdgeTint { get:public; set:public; } |
Tint applied along the material's visible edge. |
EdgeTintStrength |
float EdgeTintStrength { get:public; set:public; } |
Blend amount for the material edge tint. |
ElevationEdgeStrength |
float ElevationEdgeStrength { get:public; set:public; } |
Strength of lighting at elevation transitions between materials. |
EmissionColor |
UnityEngine.Color EmissionColor { get:public; set:public; } |
Authored emission color, independent of thermal simulation changes. |
EmissionStrength |
float EmissionStrength { get:public; set:public; } |
Multiplier for the material's non-temperature emission. |
GlossMapInfluence |
float GlossMapInfluence { get:public; set:public; } |
Contribution of the authored gloss map to the specular response. |
HeightNormalStrength |
float HeightNormalStrength { get:public; set:public; } |
Strength of shading normals derived from authored height maps. |
NormalMapStrength |
float NormalMapStrength { get:public; set:public; } |
Influence of authored tangent-space normal maps on lighting. |
RimColor |
UnityEngine.Color RimColor { get:public; set:public; } |
Color of the material's edge/rim contribution. |
RimPower |
float RimPower { get:public; set:public; } |
Controls the concentration of the rim response. |
RimStrength |
float RimStrength { get:public; set:public; } |
Intensity of rim lighting on this material. |
ShadowStrength |
float ShadowStrength { get:public; set:public; } |
Amount of shadow attenuation applied to this material's lighting. |
SpecularIntensity |
float SpecularIntensity { get:public; set:public; } |
Strength of specular highlights on this substance. |
SpecularSharpness |
float SpecularSharpness { get:public; set:public; } |
Sharpness of the specular response; larger values concentrate highlights. |
SurfaceElevation |
float SurfaceElevation { get:public; set:public; } |
Render-only elevation bias affecting material relief; does not move cells or colliders. |
TemperatureEmissionColor |
UnityEngine.Color TemperatureEmissionColor { get:public; set:public; } |
Emission color reached through the encoded cell-temperature response. |
TemperatureEmissionStrength |
float TemperatureEmissionStrength { get:public; set:public; } |
Multiplier for temperature-driven visual emission. |
TopSurfaceTint |
UnityEngine.Color TopSurfaceTint { get:public; set:public; } |
Tint applied to the substance's visual top cap. |
TopSurfaceTintStrength |
float TopSurfaceTintStrength { get:public; set:public; } |
Blend amount for the top-surface tint. |
Constructors
SubstanceStylizedLightingSettings
Creates a new SubstanceStylizedLightingSettings instance.
Signature
public void .ctor()
MasterTech.Matter.Data.SubstanceSurfaceModel
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Data.SubstanceSurfaceModel
Defines the available substance surface model values.
Fields
| Member | Signature | Description |
|---|---|---|
Cutout |
public static MasterTech.Matter.Data.SubstanceSurfaceModel Cutout |
Provides the cutout value. |
Gas |
public static MasterTech.Matter.Data.SubstanceSurfaceModel Gas |
Provides the gas value. |
Liquid |
public static MasterTech.Matter.Data.SubstanceSurfaceModel Liquid |
Provides the liquid value. |
Opaque |
public static MasterTech.Matter.Data.SubstanceSurfaceModel Opaque |
Provides the opaque value. |
Translucent |
public static MasterTech.Matter.Data.SubstanceSurfaceModel Translucent |
Provides the translucent value. |
MasterTech.Matter.Data.SubstanceTextureArrayLibrary
Advanced reference. Descriptions may be generated from compiled signatures.
public class MasterTech.Matter.Data.SubstanceTextureArrayLibrary
Binary-serialized texture payload shared by any number of render-library metadata assets. Runtime-installed quality tiers live in separate Resources assets so only the selected resolution needs to remain resident.
Properties
| Member | Signature | Description |
|---|---|---|
AlbedoArray |
UnityEngine.Texture2DArray AlbedoArray { get:public; } |
Gets the albedo array. |
BakeFingerprint |
string BakeFingerprint { get:public; } |
Gets the bake fingerprint. |
BakeRevision |
uint BakeRevision { get:public; } |
Gets the bake revision. |
BaseSliceCount |
int BaseSliceCount { get:public; } |
Gets the base slice count. |
DetailAlbedoArray |
UnityEngine.Texture2DArray DetailAlbedoArray { get:public; } |
Gets the detail albedo array. |
DetailHeightArray |
UnityEngine.Texture2DArray DetailHeightArray { get:public; } |
Gets the detail height array. |
DetailNormalArray |
UnityEngine.Texture2DArray DetailNormalArray { get:public; } |
Gets the detail normal array. |
DetailSliceCount |
int DetailSliceCount { get:public; } |
Gets the detail slice count. |
DetailSurfaceArray |
UnityEngine.Texture2DArray DetailSurfaceArray { get:public; } |
Gets the detail surface array. |
HeightArray |
UnityEngine.Texture2DArray HeightArray { get:public; } |
Gets the height array. |
NormalArray |
UnityEngine.Texture2DArray NormalArray { get:public; } |
Gets the normal array. |
SurfaceArray |
UnityEngine.Texture2DArray SurfaceArray { get:public; } |
Gets the surface array. |
TextureResolution |
int TextureResolution { get:public; } |
Gets the texture resolution. |
Constructors
SubstanceTextureArrayLibrary
Creates a new SubstanceTextureArrayLibrary instance.
Signature
public void .ctor()
Methods
Bind
Bind the supplied values.
Signature
public void Bind(UnityEngine.MaterialPropertyBlock block)
Parameters
| Name | Type | Description |
|---|---|---|
block |
UnityEngine.MaterialPropertyBlock |
The block value. |
CollectValidationErrors
Collect the validation errors.
Signature
public System.Collections.Generic.List<string> CollectValidationErrors(int expectedResolution, int minimumBaseSlices, int minimumDetailSlices, bool requireRuntimeFormatSupport)
Parameters
| Name | Type | Description |
|---|---|---|
expectedResolution |
int |
The expected resolution value. |
minimumBaseSlices |
int |
The minimum base slices value. |
minimumDetailSlices |
int |
The minimum detail slices value. |
requireRuntimeFormatSupport |
bool |
Whether require runtime format support. |
Returns
System.Collections.Generic.List<string>: The resulting collection.
ConfigureBakedData
Configure the baked data.
Signature
public void ConfigureBakedData(int resolution, UnityEngine.Texture2DArray bakedAlbedoArray, UnityEngine.Texture2DArray bakedHeightArray, UnityEngine.Texture2DArray bakedSurfaceArray, UnityEngine.Texture2DArray bakedNormalArray, UnityEngine.Texture2DArray bakedDetailAlbedoArray, UnityEngine.Texture2DArray bakedDetailHeightArray, UnityEngine.Texture2DArray bakedDetailSurfaceArray, UnityEngine.Texture2DArray bakedDetailNormalArray, string fingerprint)
Parameters
| Name | Type | Description |
|---|---|---|
resolution |
int |
The resolution value. |
bakedAlbedoArray |
UnityEngine.Texture2DArray |
The baked albedo array value. |
bakedHeightArray |
UnityEngine.Texture2DArray |
The baked height array value. |
bakedSurfaceArray |
UnityEngine.Texture2DArray |
The baked surface array value. |
bakedNormalArray |
UnityEngine.Texture2DArray |
The baked normal array value. |
bakedDetailAlbedoArray |
UnityEngine.Texture2DArray |
The baked detail albedo array value. |
bakedDetailHeightArray |
UnityEngine.Texture2DArray |
The baked detail height array value. |
bakedDetailSurfaceArray |
UnityEngine.Texture2DArray |
The baked detail surface array value. |
bakedDetailNormalArray |
UnityEngine.Texture2DArray |
The baked detail normal array value. |
fingerprint |
string |
The fingerprint value. |
MasterTech.Matter.Data.SubstanceTextureMappingMode
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Data.SubstanceTextureMappingMode
Defines the available substance texture mapping mode values.
Fields
| Member | Signature | Description |
|---|---|---|
Repeat |
public static MasterTech.Matter.Data.SubstanceTextureMappingMode Repeat |
Provides the repeat value. |
StochasticPatch |
public static MasterTech.Matter.Data.SubstanceTextureMappingMode StochasticPatch |
Provides the stochastic patch value. |
MasterTech.Matter.Data.SubstanceTextureMappingSettings
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Data.SubstanceTextureMappingSettings
World-space texture placement shared by a substance's aligned PBR maps.
Properties
| Member | Signature | Description |
|---|---|---|
Mode |
MasterTech.Matter.Data.SubstanceTextureMappingMode Mode { get:public; set:public; } |
Selects repeating or stochastic-patch mapping; world-clamp behavior is an independent axis-clamp option. |
RandomizePatchMirror |
bool RandomizePatchMirror { get:public; set:public; } |
Allows deterministic mirroring within stochastic patches. |
RandomizePatchRotation |
bool RandomizePatchRotation { get:public; set:public; } |
Allows deterministic patch rotations to reduce repeated patterns. |
RotationDegrees |
float RotationDegrees { get:public; set:public; } |
Rotation of the mapped texture axes in degrees. |
StochasticBlendWidth |
float StochasticBlendWidth { get:public; set:public; } |
Normalized transition width used to blend neighboring stochastic patches. |
StochasticPatchWorldSize |
float StochasticPatchWorldSize { get:public; set:public; } |
World-space size of randomized texture patches. |
WorldUnitsPerTile |
UnityEngine.Vector2 WorldUnitsPerTile { get:public; set:public; } |
World-space width and height of one texture repeat; positive values are required for meaningful mapping. |
Constructors
SubstanceTextureMappingSettings
Creates a new SubstanceTextureMappingSettings instance.
Signature
public void .ctor()
MasterTech.Matter.Data.SubstanceTextureMaps
Advanced reference. Descriptions may be generated from compiled signatures.
public class MasterTech.Matter.Data.SubstanceTextureMaps
Source textures for one layer. These remain authoring inputs; a render-library baker can normalize and pack them without changing the simulation database ABI.
Properties
| Member | Signature | Description |
|---|---|---|
AlbedoOpacity |
UnityEngine.Texture2D AlbedoOpacity { get:public; set:public; } |
Gets or sets the albedo opacity. |
AmbientOcclusion |
UnityEngine.Texture2D AmbientOcclusion { get:public; set:public; } |
Gets or sets the ambient occlusion. |
Emission |
UnityEngine.Texture2D Emission { get:public; set:public; } |
Gets or sets the emission. |
Gloss |
UnityEngine.Texture2D Gloss { get:public; set:public; } |
Gets or sets the gloss. |
GlossChannel |
MasterTech.Matter.Data.SubstanceGlossMapChannel GlossChannel { get:public; set:public; } |
Gets or sets the gloss channel. |
GlossEncoding |
MasterTech.Matter.Data.SubstanceGlossMapEncoding GlossEncoding { get:public; set:public; } |
Gets or sets the gloss encoding. |
HasAnyTexture |
bool HasAnyTexture { get:public; } |
Gets whether this value has any texture. |
Height |
UnityEngine.Texture2D Height { get:public; set:public; } |
Gets or sets the height. |
HeightMidpoint |
float HeightMidpoint { get:public; set:public; } |
Gets or sets the height midpoint. |
InvertNormalGreen |
bool InvertNormalGreen { get:public; set:public; } |
Gets or sets whether invert normal green. |
Normal |
UnityEngine.Texture2D Normal { get:public; set:public; } |
Gets or sets the normal. |
Constructors
SubstanceTextureMaps
Overload 1
Creates a new SubstanceTextureMaps instance.
Signature
public void .ctor()
Overload 2
Creates a new SubstanceTextureMaps instance.
Signature
public void .ctor(UnityEngine.Texture2D albedoOpacity, UnityEngine.Texture2D height, UnityEngine.Texture2D normal, UnityEngine.Texture2D gloss, UnityEngine.Texture2D ambientOcclusion, UnityEngine.Texture2D emission)
Parameters
| Name | Type | Description |
|---|---|---|
albedoOpacity |
UnityEngine.Texture2D |
The albedo opacity value. |
height |
UnityEngine.Texture2D |
The height value. |
normal |
UnityEngine.Texture2D |
The normal value. |
gloss |
UnityEngine.Texture2D |
The gloss value. |
ambientOcclusion |
UnityEngine.Texture2D |
The ambient occlusion value. |
emission |
UnityEngine.Texture2D |
The emission value. |
MasterTech.Matter.Data.SubstanceTextureSet
Advanced reference. Descriptions may be generated from compiled signatures.
public class MasterTech.Matter.Data.SubstanceTextureSet
One weighted visual variant for a substance. All maps in a set share the same deterministic selection and UV transform so their features stay aligned.
Properties
| Member | Signature | Description |
|---|---|---|
BaseMaps |
MasterTech.Matter.Data.SubstanceTextureMaps BaseMaps { get:public; set:public; } |
Gets or sets the base maps. |
DetailColorStrength |
float DetailColorStrength { get:public; set:public; } |
Gets or sets the detail color strength. |
DetailHeightStrength |
float DetailHeightStrength { get:public; set:public; } |
Gets or sets the detail height strength. |
DetailMaps |
MasterTech.Matter.Data.SubstanceTextureMaps DetailMaps { get:public; set:public; } |
Gets or sets the detail maps. |
DetailNormalStrength |
float DetailNormalStrength { get:public; set:public; } |
Gets or sets the detail normal strength. |
DetailScaleMultiplier |
float DetailScaleMultiplier { get:public; set:public; } |
Gets or sets the detail scale multiplier. |
DisplayName |
string DisplayName { get:public; set:public; } |
Gets or sets the display name. |
HeightAmplitude |
float HeightAmplitude { get:public; set:public; } |
Gets or sets the height amplitude. |
HeightBias |
float HeightBias { get:public; set:public; } |
Gets or sets the height bias. |
NormalStrength |
float NormalStrength { get:public; set:public; } |
Gets or sets the normal strength. |
RotationDegrees |
float RotationDegrees { get:public; set:public; } |
Gets or sets the rotation degrees. |
ScaleMultiplier |
UnityEngine.Vector2 ScaleMultiplier { get:public; set:public; } |
Gets or sets the scale multiplier. |
SelectionWeight |
float SelectionWeight { get:public; set:public; } |
Gets or sets the selection weight. |
Tint |
UnityEngine.Color Tint { get:public; set:public; } |
Gets or sets the tint. |
Constructors
SubstanceTextureSet
Overload 1
Creates a new SubstanceTextureSet instance.
Signature
public void .ctor()
Overload 2
Creates a new SubstanceTextureSet instance.
Signature
public void .ctor(string displayName, MasterTech.Matter.Data.SubstanceTextureMaps baseMaps, float selectionWeight)
Parameters
| Name | Type | Description |
|---|---|---|
displayName |
string |
The display name value. |
baseMaps |
MasterTech.Matter.Data.SubstanceTextureMaps |
The base maps value. |
selectionWeight |
float |
The selection weight value. |
MasterTech.Matter.Data.SubstanceTextureSetGpuData
Advanced reference. Descriptions may be generated from compiled signatures.
public struct MasterTech.Matter.Data.SubstanceTextureSetGpuData
Render-only data for one weighted texture variant.
Fields
| Member | Signature | Description |
|---|---|---|
baseMapping |
public UnityEngine.Vector4 baseMapping |
XY world-to-UV scale; Z cosine and W sine of authored rotation. |
baseOffsetSurface |
public UnityEngine.Vector4 baseOffsetSurface |
XY UV offset; Z height amplitude; W midpoint-folded height bias. |
baseSlice |
public uint baseSlice |
Stores the base slice value. |
detailMapping |
public UnityEngine.Vector4 detailMapping |
XY world-to-detail-UV scale; Z cosine and W sine. |
detailOffsetSurface |
public UnityEngine.Vector4 detailOffsetSurface |
XY detail UV offset; Z detail-height strength; W detail-color strength. |
detailSlice |
public uint detailSlice |
Stores the detail slice value. |
flags |
public uint flags |
Stores the flags value. |
reserved |
public uint reserved |
Two IEEE-754 half values: base-normal strength, then detail-normal strength. |
SizeInBytes |
public static int SizeInBytes |
Provides the size in bytes value. |
tint |
public UnityEngine.Vector4 tint |
RGB set tint; A weighted-selection weight. |
MasterTech.Matter.Data.SubstanceTextureSetGpuFlags
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Data.SubstanceTextureSetGpuFlags
Defines the available substance texture set GPU flags values.
Fields
| Member | Signature | Description |
|---|---|---|
HasBaseAmbientOcclusion |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasBaseAmbientOcclusion |
Provides the has base ambient occlusion value. |
HasBaseEmission |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasBaseEmission |
Provides the has base emission value. |
HasBaseGloss |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasBaseGloss |
Provides the has base gloss value. |
HasBaseHeight |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasBaseHeight |
Provides the has base height value. |
HasBaseNormal |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasBaseNormal |
Provides the has base normal value. |
HasDetail |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasDetail |
Provides the has detail value. |
HasDetailAlbedo |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasDetailAlbedo |
Provides the has detail albedo value. |
HasDetailAmbientOcclusion |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasDetailAmbientOcclusion |
Provides the has detail ambient occlusion value. |
HasDetailEmission |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasDetailEmission |
Provides the has detail emission value. |
HasDetailGloss |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasDetailGloss |
Provides the has detail gloss value. |
HasDetailHeight |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasDetailHeight |
Provides the has detail height value. |
HasDetailHeightMidpoint |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasDetailHeightMidpoint |
Provides the has detail height midpoint value. |
HasDetailNormal |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags HasDetailNormal |
Provides the has detail normal value. |
InvertBaseNormalGreen |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags InvertBaseNormalGreen |
Provides the invert base normal green value. |
InvertDetailNormalGreen |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags InvertDetailNormalGreen |
Provides the invert detail normal green value. |
None |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags None |
Provides the none value. |
RandomizePatchMirror |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags RandomizePatchMirror |
Provides the randomize patch mirror value. |
RandomizePatchRotation |
public static MasterTech.Matter.Data.SubstanceTextureSetGpuFlags RandomizePatchRotation |
Provides the randomize patch rotation value. |
MasterTech.Matter.Data.SubstanceTextureVariationSettings
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Data.SubstanceTextureVariationSettings
Deterministic region-based selection of a substance's weighted texture sets.
Properties
| Member | Signature | Description |
|---|---|---|
RegionWorldSize |
float RegionWorldSize { get:public; set:public; } |
World-space size of texture-variant regions. |
Seed |
int Seed { get:public; set:public; } |
Seed controlling stable region selection without changing simulation randomness. |
TransitionWidth |
float TransitionWidth { get:public; set:public; } |
Width of the visual transition between neighboring variant regions. |
Constructors
SubstanceTextureVariationSettings
Creates a new SubstanceTextureVariationSettings instance.
Signature
public void .ctor()
MasterTech.Matter.Data.SubstanceTransparencySettings
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Data.SubstanceTransparencySettings
Per-substance optical presentation; these values do not change mass or fluid transport.
Properties
| Member | Signature | Description |
|---|---|---|
AbsorptionColor |
UnityEngine.Color AbsorptionColor { get:public; set:public; } |
Color used to tint light through the liquid's estimated optical thickness. |
AbsorptionStrength |
float AbsorptionStrength { get:public; set:public; } |
Strength of absorption through the visual liquid thickness estimate. |
CutoutThreshold |
float CutoutThreshold { get:public; set:public; } |
Alpha threshold used by the cutout surface model. |
Opacity |
float Opacity { get:public; set:public; } |
Base optical opacity of the substance, separate from encoded cell fill. |
RefractionStrength |
float RefractionStrength { get:public; set:public; } |
Amount of visual background distortion for transparent matter. |
SoftEdgeStrength |
float SoftEdgeStrength { get:public; set:public; } |
Softens the transparent material's visible boundary. |
SurfaceHighlightStrength |
float SurfaceHighlightStrength { get:public; set:public; } |
Strength of the transparent surface-edge highlight. |
SurfaceModel |
MasterTech.Matter.Data.SubstanceSurfaceModel SurfaceModel { get:public; set:public; } |
Chooses opaque, cutout, translucent, liquid or gas shading; independent of the simulation phase. |
Constructors
SubstanceTransparencySettings
Creates a new SubstanceTransparencySettings instance.
Signature
public void .ctor()
MasterTech.Matter.MatterRuntimeCapabilities
Advanced reference. Descriptions may be generated from compiled signatures.
public static class MasterTech.Matter.MatterRuntimeCapabilities
Runtime graphics capabilities that affect Matter's simulation and presentation paths.
Properties
| Member | Signature | Description |
|---|---|---|
GraphicsApiLabel |
string GraphicsApiLabel { get:public; } |
Gets the graphics API label. |
GraphicsDeviceType |
UnityEngine.Rendering.GraphicsDeviceType GraphicsDeviceType { get:public; } |
Gets the graphics device type. |
IsWebGpu |
bool IsWebGpu { get:public; } |
Gets whether this value is web GPU. |
RequiresAsyncGpuReadback |
bool RequiresAsyncGpuReadback { get:public; } |
WebGPU deliberately exposes GPU data through asynchronous readback. Synchronous ComputeBuffer.GetData calls are not supported. |
SupportsGpuSimulation |
bool SupportsGpuSimulation { get:public; } |
Gets whether this value supports GPU simulation. |
MasterTech.Matter.Replication.BandwidthTokenBucket
Advanced reference. Descriptions may be generated from compiled signatures.
public class MasterTech.Matter.Replication.BandwidthTokenBucket
Deterministic token bucket used by edit and chunk-stream rate limits.
Properties
| Member | Signature | Description |
|---|---|---|
Available |
double Available { get:public; } |
Gets the available. |
Capacity |
double Capacity { get:public; } |
Gets the capacity. |
RatePerSecond |
double RatePerSecond { get:public; } |
Gets the rate per second. |
Constructors
BandwidthTokenBucket
Creates a new BandwidthTokenBucket instance.
Signature
public void .ctor(double ratePerSecond, double capacity, bool startFull)
Parameters
| Name | Type | Description |
|---|---|---|
ratePerSecond |
double |
The rate per second value. |
capacity |
double |
The capacity value. |
startFull |
bool |
Whether start full. |
Methods
Refill
Refill the supplied values.
Signature
public void Refill(double deltaSeconds)
Parameters
| Name | Type | Description |
|---|---|---|
deltaSeconds |
double |
The delta seconds value. |
TryConsume
Attempt to perform the consume operation.
Signature
public bool TryConsume(double amount)
Parameters
| Name | Type | Description |
|---|---|---|
amount |
double |
The amount value. |
Returns
bool: true when the operation succeeds; otherwise, false.
MasterTech.Matter.Replication.ChunkApplyResult
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Replication.ChunkApplyResult
Defines the available chunk apply result values.
Fields
| Member | Signature | Description |
|---|---|---|
AlreadyCurrent |
public static MasterTech.Matter.Replication.ChunkApplyResult AlreadyCurrent |
Provides the already current value. |
Applied |
public static MasterTech.Matter.Replication.ChunkApplyResult Applied |
Provides the applied value. |
CorruptPayload |
public static MasterTech.Matter.Replication.ChunkApplyResult CorruptPayload |
Provides the corrupt payload value. |
InvalidChunk |
public static MasterTech.Matter.Replication.ChunkApplyResult InvalidChunk |
Provides the invalid chunk value. |
InvalidVersion |
public static MasterTech.Matter.Replication.ChunkApplyResult InvalidVersion |
Provides the invalid version value. |
RequiresFullSnapshot |
public static MasterTech.Matter.Replication.ChunkApplyResult RequiresFullSnapshot |
Provides the requires full snapshot value. |
Stale |
public static MasterTech.Matter.Replication.ChunkApplyResult Stale |
Provides the stale value. |
TargetRejected |
public static MasterTech.Matter.Replication.ChunkApplyResult TargetRejected |
Provides the target rejected value. |
MasterTech.Matter.Replication.ChunkGrid
Advanced reference. Descriptions may be generated from compiled signatures.
public struct MasterTech.Matter.Replication.ChunkGrid
Immutable mapping between world cells and fixed-size networking chunks. Partial edge chunks are represented and zero-padded on the wire.
Properties
| Member | Signature | Description |
|---|---|---|
CellsPerChunk |
int CellsPerChunk { get:public; } |
Gets the cells per chunk. |
ChunkSize |
int ChunkSize { get:public; } |
Gets the chunk size. |
Columns |
int Columns { get:public; } |
Gets the columns. |
Count |
int Count { get:public; } |
Gets the count. |
Height |
int Height { get:public; } |
Gets the height. |
Rows |
int Rows { get:public; } |
Gets the rows. |
Width |
int Width { get:public; } |
Gets the width. |
Constructors
ChunkGrid
Creates a new ChunkGrid instance.
Signature
public void .ctor(int width, int height, int chunkSize)
Parameters
| Name | Type | Description |
|---|---|---|
width |
int |
The width value. |
height |
int |
The height value. |
chunkSize |
int |
The chunk size value. |
Methods
CellToChunkIndex
Convert the cell to chunk index.
Signature
public int CellToChunkIndex(int cellX, int cellY)
Parameters
| Name | Type | Description |
|---|---|---|
cellX |
int |
The cell x value. |
cellY |
int |
The cell y value. |
Returns
int: The calculated value.
ChunkCoordinateToIndex
Convert the chunk coordinate to index.
Signature
public int ChunkCoordinateToIndex(int chunkX, int chunkY)
Parameters
| Name | Type | Description |
|---|---|---|
chunkX |
int |
The chunk x value. |
chunkY |
int |
The chunk y value. |
Returns
int: The calculated value.
DistanceSquared
Calculate the squared distance.
Signature
public int DistanceSquared(int chunkIndex, int centerChunkIndex)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The chunk index. |
centerChunkIndex |
int |
The center chunk index. |
Returns
int: The calculated value.
GetChunksInInterest
Get the chunks in interest.
Signature
public void GetChunksInInterest(int centerChunkIndex, int radius, System.Collections.Generic.List<int> destination)
Parameters
| Name | Type | Description |
|---|---|---|
centerChunkIndex |
int |
The center chunk index. |
radius |
int |
The radius value. |
destination |
System.Collections.Generic.List<int> |
The destination that receives the output. |
IndexToCoordinate
Convert the index to coordinate.
Signature
public UnityEngine.Vector2Int IndexToCoordinate(int chunkIndex)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The chunk index. |
Returns
UnityEngine.Vector2Int: The resulting vector 2 int value.
IsInInterest
Determine whether is in interest.
Signature
public bool IsInInterest(int chunkIndex, int centerChunkIndex, int radius)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The chunk index. |
centerChunkIndex |
int |
The center chunk index. |
radius |
int |
The radius value. |
Returns
bool: true when the stated condition is met; otherwise, false.
MasterTech.Matter.Replication.ChunkPayloadDecodeResult
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Replication.ChunkPayloadDecodeResult
Defines the available chunk payload decode result values.
Fields
| Member | Signature | Description |
|---|---|---|
BaselineMismatch |
public static MasterTech.Matter.Replication.ChunkPayloadDecodeResult BaselineMismatch |
Provides the baseline mismatch value. |
CorruptPayload |
public static MasterTech.Matter.Replication.ChunkPayloadDecodeResult CorruptPayload |
Provides the corrupt payload value. |
Decoded |
public static MasterTech.Matter.Replication.ChunkPayloadDecodeResult Decoded |
Provides the decoded value. |
MasterTech.Matter.Replication.ChunkReconciler
Advanced reference. Descriptions may be generated from compiled signatures.
public class MasterTech.Matter.Replication.ChunkReconciler
Applies authoritative chunks to the client simulation. Versions and CPU baselines are committed only after both decode and the GPU overwrite succeed, so a delta can never be applied to the wrong chunk version. Full snapshots at the current version are reapplied to repair local prediction; repeated deltas at that version are ignored.
Constructors
ChunkReconciler
Creates a new ChunkReconciler instance.
Signature
public void .ctor(MasterTech.Matter.Replication.ChunkGrid grid, System.Func<int,MasterTech.Matter.Simulation.Cell[],bool> applyChunk)
Parameters
| Name | Type | Description |
|---|---|---|
grid |
MasterTech.Matter.Replication.ChunkGrid |
The grid value. |
applyChunk |
System.Func<int,MasterTech.Matter.Simulation.Cell[],bool> |
The apply chunk value. |
Methods
Apply
Apply the supplied values.
Signature
public MasterTech.Matter.Replication.ChunkApplyResult Apply(int chunkIndex, uint version, byte[] payload, string& error)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The chunk index. |
version |
uint |
The version value. |
payload |
byte[] |
The payload value. |
error |
string& |
Receives an explanation when the operation cannot complete. |
Returns
MasterTech.Matter.Replication.ChunkApplyResult: The resulting chunk apply result value.
GetVersion
Get the version.
Signature
public uint GetVersion(int chunkIndex)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The chunk index. |
Returns
uint: The calculated value.
Reset
Reset the supplied values.
Signature
public void Reset()
MasterTech.Matter.Replication.ChunkSerializer
Advanced reference. Descriptions may be generated from compiled signatures.
public static class MasterTech.Matter.Replication.ChunkSerializer
Lossless serializer for cell chunks. Full snapshots select raw or RLE, whichever is smaller. Sparse deltas contain exact cell replacements and an explicit baseline version. Every body is protected with CRC32.
Methods
Decode
Decode the supplied values.
Signature
public static MasterTech.Matter.Replication.ChunkPayloadDecodeResult Decode(byte[] payload, int expectedCellCount, uint baselineVersion, MasterTech.Matter.Simulation.Cell[] baseline, MasterTech.Matter.Simulation.Cell[]& cells, string& error)
Parameters
| Name | Type | Description |
|---|---|---|
payload |
byte[] |
The payload value. |
expectedCellCount |
int |
The expected cell count. |
baselineVersion |
uint |
The baseline version value. |
baseline |
MasterTech.Matter.Simulation.Cell[] |
The baseline value. |
cells |
MasterTech.Matter.Simulation.Cell[]& |
The cells value. |
error |
string& |
Receives an explanation when the operation cannot complete. |
Returns
MasterTech.Matter.Replication.ChunkPayloadDecodeResult: The resulting chunk payload decode result value.
Encode
Overload 1
Encode the supplied values.
Signature
public static byte[] Encode(MasterTech.Matter.Simulation.Cell[] cells, int offset, int count)
Parameters
| Name | Type | Description |
|---|---|---|
cells |
MasterTech.Matter.Simulation.Cell[] |
The cells value. |
offset |
int |
The offset value. |
count |
int |
The count. |
Returns
byte[]: The resulting collection.
Overload 2
Encode the supplied values.
Signature
public static byte[] Encode(MasterTech.Matter.Simulation.Cell[] cells)
Parameters
| Name | Type | Description |
|---|---|---|
cells |
MasterTech.Matter.Simulation.Cell[] |
The cells value. |
Returns
byte[]: The resulting collection.
EncodeDelta
Encodes sparse replacements against baselineVersion. The result is always a delta; callers that retain a full fallback should use it only when it is smaller than MasterTech.Matter.Replication.ChunkSerializer.Encode(MasterTech.Matter.Simulation.Cell[]).
Signature
public static byte[] EncodeDelta(MasterTech.Matter.Simulation.Cell[] baseline, MasterTech.Matter.Simulation.Cell[] cells, uint baselineVersion)
Parameters
| Name | Type | Description |
|---|---|---|
baseline |
MasterTech.Matter.Simulation.Cell[] |
The baseline value. |
cells |
MasterTech.Matter.Simulation.Cell[] |
The cells value. |
baselineVersion |
uint |
The baseline version value. |
Returns
byte[]: The resulting collection.
GetEncoding
Get the encoding.
Signature
public static MasterTech.Matter.Replication.ChunkSnapshotEncoding GetEncoding(byte[] payload)
Parameters
| Name | Type | Description |
|---|---|---|
payload |
byte[] |
The payload value. |
Returns
MasterTech.Matter.Replication.ChunkSnapshotEncoding: The resulting chunk snapshot encoding value.
TryDecode
Overload 1
Attempt to decode the supplied values.
Signature
public static bool TryDecode(byte[] payload, int expectedCellCount, MasterTech.Matter.Simulation.Cell[]& cells, string& error)
Parameters
| Name | Type | Description |
|---|---|---|
payload |
byte[] |
The payload value. |
expectedCellCount |
int |
The expected cell count. |
cells |
MasterTech.Matter.Simulation.Cell[]& |
The cells value. |
error |
string& |
Receives an explanation when the operation cannot complete. |
Returns
bool: true when the operation succeeds; otherwise, false.
Overload 2
Attempt to decode the supplied values.
Signature
public static bool TryDecode(byte[] payload, int expectedCellCount, MasterTech.Matter.Simulation.Cell[]& cells)
Parameters
| Name | Type | Description |
|---|---|---|
payload |
byte[] |
The payload value. |
expectedCellCount |
int |
The expected cell count. |
cells |
MasterTech.Matter.Simulation.Cell[]& |
The cells value. |
Returns
bool: true when the operation succeeds; otherwise, false.
Overload 3
Attempt to decode the supplied values.
Signature
public static bool TryDecode(byte[] payload, int expectedCellCount, uint baselineVersion, MasterTech.Matter.Simulation.Cell[] baseline, MasterTech.Matter.Simulation.Cell[]& cells, string& error)
Parameters
| Name | Type | Description |
|---|---|---|
payload |
byte[] |
The payload value. |
expectedCellCount |
int |
The expected cell count. |
baselineVersion |
uint |
The baseline version value. |
baseline |
MasterTech.Matter.Simulation.Cell[] |
The baseline value. |
cells |
MasterTech.Matter.Simulation.Cell[]& |
The cells value. |
error |
string& |
Receives an explanation when the operation cannot complete. |
Returns
bool: true when the operation succeeds; otherwise, false.
TryGetDeltaBaseVersion
Attempt to get the delta base version.
Signature
public static bool TryGetDeltaBaseVersion(byte[] payload, uint& baselineVersion)
Parameters
| Name | Type | Description |
|---|---|---|
payload |
byte[] |
The payload value. |
baselineVersion |
uint& |
The baseline version value. |
Returns
bool: true when the operation succeeds; otherwise, false.
MasterTech.Matter.Replication.ChunkSnapshot
Advanced reference. Descriptions may be generated from compiled signatures.
public class MasterTech.Matter.Replication.ChunkSnapshot
Immutable server-side representation of a chunk version. FullPayload is always independently decodable. A smaller delta may also be retained and selected only for a client that acknowledged DeltaBaseVersion.
Properties
| Member | Signature | Description |
|---|---|---|
ChunkIndex |
int ChunkIndex { get:public; } |
Gets the chunk index. |
DeltaBaseVersion |
uint DeltaBaseVersion { get:public; } |
Gets the delta base version. |
DeltaPayload |
byte[] DeltaPayload { get:public; } |
Gets the delta payload. |
FullPayload |
byte[] FullPayload { get:public; } |
Gets the full payload. |
HasDelta |
bool HasDelta { get:public; } |
Gets whether this value has delta. |
IsDelta |
bool IsDelta { get:public; } |
Gets whether this value is delta. |
Payload |
byte[] Payload { get:public; } |
Gets the payload. |
Version |
uint Version { get:public; } |
Gets the version. |
WireBytes |
int WireBytes { get:public; } |
Gets the wire bytes. |
Constructors
ChunkSnapshot
Overload 1
Creates a new ChunkSnapshot instance.
Signature
public void .ctor(int chunkIndex, uint version, byte[] fullPayload, uint deltaBaseVersion, byte[] deltaPayload)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The chunk index. |
version |
uint |
The version value. |
fullPayload |
byte[] |
The full payload value. |
deltaBaseVersion |
uint |
The delta base version value. |
deltaPayload |
byte[] |
The delta payload value. |
Overload 2
Creates a new ChunkSnapshot instance.
Signature
public void .ctor(int chunkIndex, uint version, byte[] payload)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The chunk index. |
version |
uint |
The version value. |
payload |
byte[] |
The payload value. |
MasterTech.Matter.Replication.ChunkSnapshotEncoding
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Replication.ChunkSnapshotEncoding
Encoding used for the body of a chunk snapshot. Raw and run-length payloads are independently decodable full chunks. Delta payloads contain sparse cell replacements against one explicitly versioned full chunk.
Fields
| Member | Signature | Description |
|---|---|---|
Delta |
public static MasterTech.Matter.Replication.ChunkSnapshotEncoding Delta |
Provides the delta value. |
Raw |
public static MasterTech.Matter.Replication.ChunkSnapshotEncoding Raw |
Provides the raw value. |
RunLength |
public static MasterTech.Matter.Replication.ChunkSnapshotEncoding RunLength |
Provides the run length value. |
MasterTech.Matter.Replication.ChunkStreamCounters
Advanced reference. Descriptions may be generated from compiled signatures.
public struct MasterTech.Matter.Replication.ChunkStreamCounters
Represents chunk stream counters data.
Fields
| Member | Signature | Description |
|---|---|---|
BytesSent |
public ulong BytesSent |
Stores the bytes sent value. |
DeltaSnapshotsSent |
public ulong DeltaSnapshotsSent |
Stores the delta snapshots sent value. |
FullSnapshotsSent |
public ulong FullSnapshotsSent |
Stores the full snapshots sent value. |
SendsDeferredByBudget |
public ulong SendsDeferredByBudget |
Stores the sends deferred by budget value. |
SnapshotsAcknowledged |
public ulong SnapshotsAcknowledged |
Stores the snapshots acknowledged value. |
SnapshotsPublished |
public ulong SnapshotsPublished |
Stores the snapshots published value. |
SnapshotsRetried |
public ulong SnapshotsRetried |
Stores the snapshots retried value. |
SnapshotsSent |
public ulong SnapshotsSent |
Stores the snapshots sent value. |
SnapshotsSuperseded |
public ulong SnapshotsSuperseded |
Stores the snapshots superseded value. |
MasterTech.Matter.Replication.ChunkStreamer
Advanced reference. Descriptions may be generated from compiled signatures.
public class MasterTech.Matter.Replication.ChunkStreamer
Per-client interest, prioritization, ACK/retry, and token-bucket bandwidth scheduling. This class deliberately has no transport dependency and is unit testable; an optional adapter performs the actual network calls.
Properties
| Member | Signature | Description |
|---|---|---|
CachedSnapshotCount |
int CachedSnapshotCount { get:public; } |
Gets the cached snapshot count. |
ClientCount |
int ClientCount { get:public; } |
Gets the client count. |
Counters |
MasterTech.Matter.Replication.ChunkStreamCounters Counters { get:public; } |
Gets the counters. |
Fields
| Member | Signature | Description |
|---|---|---|
RpcOverheadBytes |
public static int RpcOverheadBytes |
Provides the rpc overhead bytes value. |
Constructors
ChunkStreamer
Creates a new ChunkStreamer instance.
Signature
public void .ctor(MasterTech.Matter.Replication.ChunkGrid grid, int defaultInterestRadius, double bytesPerSecond, double burstBytes, double resendIntervalSeconds)
Parameters
| Name | Type | Description |
|---|---|---|
grid |
MasterTech.Matter.Replication.ChunkGrid |
The grid value. |
defaultInterestRadius |
int |
The default interest radius value. |
bytesPerSecond |
double |
The bytes per second value. |
burstBytes |
double |
The burst bytes value. |
resendIntervalSeconds |
double |
The resend interval seconds value. |
Methods
Acknowledge
Acknowledge the supplied values.
Signature
public bool Acknowledge(int clientId, int chunkIndex, uint version)
Parameters
| Name | Type | Description |
|---|---|---|
clientId |
int |
The client ID value. |
chunkIndex |
int |
The chunk index. |
version |
uint |
The version value. |
Returns
bool: true when the stated condition is met; otherwise, false.
Advance
Advance the supplied values.
Signature
public void Advance(double deltaSeconds)
Parameters
| Name | Type | Description |
|---|---|---|
deltaSeconds |
double |
The delta seconds value. |
ContainsClient
Determine whether the value contains client.
Signature
public bool ContainsClient(int clientId)
Parameters
| Name | Type | Description |
|---|---|---|
clientId |
int |
The client ID value. |
Returns
bool: true when the stated condition is met; otherwise, false.
GetInterestedChunks
Get the interested chunks.
Signature
public void GetInterestedChunks(int clientId, System.Collections.Generic.List<int> destination)
Parameters
| Name | Type | Description |
|---|---|---|
clientId |
int |
The client ID value. |
destination |
System.Collections.Generic.List<int> |
The destination that receives the output. |
IsInterested
Determine whether is interested.
Signature
public bool IsInterested(int clientId, int chunkIndex)
Parameters
| Name | Type | Description |
|---|---|---|
clientId |
int |
The client ID value. |
chunkIndex |
int |
The chunk index. |
Returns
bool: true when the stated condition is met; otherwise, false.
Publish
Publish the supplied values.
Signature
public bool Publish(MasterTech.Matter.Replication.ChunkSnapshot snapshot)
Parameters
| Name | Type | Description |
|---|---|---|
snapshot |
MasterTech.Matter.Replication.ChunkSnapshot |
The snapshot value. |
Returns
bool: true when the stated condition is met; otherwise, false.
RegisterClient
Register the client.
Signature
public void RegisterClient(int clientId)
Parameters
| Name | Type | Description |
|---|---|---|
clientId |
int |
The client ID value. |
RequestFullResend
Queues a cached full snapshot regardless of the normal ACK state. Returns false when the server must perform a fresh GPU readback first.
Signature
public bool RequestFullResend(int clientId, int chunkIndex)
Parameters
| Name | Type | Description |
|---|---|---|
clientId |
int |
The client ID value. |
chunkIndex |
int |
The chunk index. |
Returns
bool: true when the stated condition is met; otherwise, false.
SetInterest
Set the interest.
Signature
public void SetInterest(int clientId, int centerChunkIndex, int radius)
Parameters
| Name | Type | Description |
|---|---|---|
clientId |
int |
The client ID value. |
centerChunkIndex |
int |
The center chunk index. |
radius |
int |
The radius value. |
TryDequeue
Attempt to perform the dequeue operation.
Signature
public bool TryDequeue(int clientId, MasterTech.Matter.Replication.ChunkSnapshot& snapshot)
Parameters
| Name | Type | Description |
|---|---|---|
clientId |
int |
The client ID value. |
snapshot |
MasterTech.Matter.Replication.ChunkSnapshot& |
The snapshot value. |
Returns
bool: true when the operation succeeds; otherwise, false.
TryGetCached
Attempt to get the cached.
Signature
public bool TryGetCached(int chunkIndex, MasterTech.Matter.Replication.ChunkSnapshot& snapshot)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The chunk index. |
snapshot |
MasterTech.Matter.Replication.ChunkSnapshot& |
The snapshot value. |
Returns
bool: true when the operation succeeds; otherwise, false.
UnregisterClient
Unregister the client.
Signature
public void UnregisterClient(int clientId)
Parameters
| Name | Type | Description |
|---|---|---|
clientId |
int |
The client ID value. |
MasterTech.Matter.Replication.ChunkSystem
Advanced reference. Descriptions may be generated from compiled signatures.
public class MasterTech.Matter.Replication.ChunkSystem
Networking-owned GPU readback coordinator. Dirty flags are consumed atomically, then fixed-size chunks are copied to staging buffers and read asynchronously without stalling the simulation's cell buffer.
Properties
| Member | Signature | Description |
|---|---|---|
CompletedReadbacks |
ulong CompletedReadbacks { get:public; } |
Gets the completed readbacks. |
InFlightChunkCount |
int InFlightChunkCount { get:public; } |
Gets the in flight chunk count. |
QueuedChunkCount |
int QueuedChunkCount { get:public; } |
Gets the queued chunk count. |
ReadbackErrors |
ulong ReadbackErrors { get:public; } |
Gets the readback errors. |
Events
| Member | Signature | Description |
|---|---|---|
SnapshotReady |
public event System.Action<int,uint,MasterTech.Matter.Simulation.Cell[]> SnapshotReady |
Raised when snapshot ready. |
Constructors
ChunkSystem
Creates a new ChunkSystem instance.
Signature
public void .ctor(MasterTech.Matter.Simulation.MatterSimManager simulation, int concurrentReadbacks)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
The simulation value. |
concurrentReadbacks |
int |
The concurrent readbacks value. |
Methods
Dispose
Releases resources owned by this instance.
Signature
public void Dispose()
GetVersion
Get the version.
Signature
public uint GetVersion(int chunkIndex)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The chunk index. |
Returns
uint: The calculated value.
Pump
Starts as many tightly packed chunk readbacks as staging slots permit. Call from a networking transport tick.
Signature
public void Pump()
RequestDirtyScan
Consumes accumulated dirty bits. If another flag readback is still in flight, GPU dirty flags remain accumulated for the following request.
Signature
public void RequestDirtyScan()
RequestSnapshot
Requests a full snapshot. Set stateChanged when the chunk became dirty while an older readback might already be in flight.
Signature
public bool RequestSnapshot(int chunkIndex, bool stateChanged)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The chunk index. |
stateChanged |
bool |
Whether state changed. |
Returns
bool: true when the stated condition is met; otherwise, false.
TryWriteFullChunk
Writes a padded full network chunk into both simulation ping-pong buffers. Handles partial edge chunks by compacting each valid row.
Signature
public static bool TryWriteFullChunk(MasterTech.Matter.Simulation.MatterSimManager simulation, int chunkIndex, MasterTech.Matter.Simulation.Cell[] cells)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
The simulation value. |
chunkIndex |
int |
The chunk index. |
cells |
MasterTech.Matter.Simulation.Cell[] |
The cells value. |
Returns
bool: true when the operation succeeds; otherwise, false.
MasterTech.Matter.Replication.ChunkVersion
Advanced reference. Descriptions may be generated from compiled signatures.
public static class MasterTech.Matter.Replication.ChunkVersion
RFC-1982-style serial number comparison for monotonically increasing uint chunk versions. Version zero is reserved as the uninitialized value.
Methods
IsNewer
Determine whether is newer.
Signature
public static bool IsNewer(uint candidate, uint current)
Parameters
| Name | Type | Description |
|---|---|---|
candidate |
uint |
The candidate value. |
current |
uint |
The current value. |
Returns
bool: true when the stated condition is met; otherwise, false.
IsNewerOrEqual
Determine whether is newer or equal.
Signature
public static bool IsNewerOrEqual(uint candidate, uint current)
Parameters
| Name | Type | Description |
|---|---|---|
candidate |
uint |
The candidate value. |
current |
uint |
The current value. |
Returns
bool: true when the stated condition is met; otherwise, false.
Next
Get the next value.
Signature
public static uint Next(uint current)
Parameters
| Name | Type | Description |
|---|---|---|
current |
uint |
The current value. |
Returns
uint: The calculated value.
MasterTech.Matter.Replication.EditCommandValidator
Advanced reference. Descriptions may be generated from compiled signatures.
public static class MasterTech.Matter.Replication.EditCommandValidator
Provides edit command validator operations.
Methods
EstimateCellCost
Estimate the cell cost.
Signature
public static int EstimateCellCost(MasterTech.Matter.Simulation.EditCommand command)
Parameters
| Name | Type | Description |
|---|---|---|
command |
MasterTech.Matter.Simulation.EditCommand |
The command value. |
Returns
int: The calculated value.
IsValid
Determine whether is valid.
Signature
public static bool IsValid(MasterTech.Matter.Simulation.EditCommand command, MasterTech.Matter.Simulation.MatterSimulationSettings config, uint maximumRadius, int materialCount, string& reason)
Parameters
| Name | Type | Description |
|---|---|---|
command |
MasterTech.Matter.Simulation.EditCommand |
The command value. |
config |
MasterTech.Matter.Simulation.MatterSimulationSettings |
The config value. |
maximumRadius |
uint |
The maximum radius value. |
materialCount |
int |
The material count. |
reason |
string& |
Receives an explanation when the operation cannot complete. |
Returns
bool: true when the stated condition is met; otherwise, false.
MasterTech.Matter.Replication.IMatterReplicationAdapter
Supported integration API. All declared source members have authored documentation.
public interface MasterTech.Matter.Replication.IMatterReplicationAdapter
Transport-neutral surface used by gameplay code that can operate either locally or through an optional networking integration.
Properties
| Member | Signature | Description |
|---|---|---|
Diagnostics |
MasterTech.Matter.Replication.MatterReplicationDiagnostics Diagnostics { get:public; } |
Snapshot of stream, rejected-edit and readback diagnostics supplied by the adapter. |
IsClientReady |
bool IsClientReady { get:public; } |
Whether client prediction/replication is currently ready. |
IsServerReady |
bool IsServerReady { get:public; } |
Whether the adapter can currently accept authoritative server work. |
Simulation |
MasterTech.Matter.Simulation.MatterSimManager Simulation { get:public; } |
Simulation controlled by this transport-specific adapter, or null before it is configured. |
Methods
SubmitPredictedEdit
Submits a client prediction request through the adapter's validation and transport policy.
Signature
public abstract bool SubmitPredictedEdit(MasterTech.Matter.Simulation.EditCommand command)
Parameters
| Name | Type | Description |
|---|---|---|
command |
MasterTech.Matter.Simulation.EditCommand |
Edit command in the adapter's simulation coordinates, subject to authority and validation policy. |
Returns
bool: True when the adapter accepts the prediction request; false when unavailable or rejected.
TrySubmitAuthoritativeEdit
Attempts to enqueue an authoritative server edit through the adapter.
Signature
public abstract bool TrySubmitAuthoritativeEdit(MasterTech.Matter.Simulation.EditCommand command)
Parameters
| Name | Type | Description |
|---|---|---|
command |
MasterTech.Matter.Simulation.EditCommand |
Edit command in the adapter's simulation coordinates, subject to authority and validation policy. |
Returns
bool: True when the authoritative edit is accepted by the adapter.
MasterTech.Matter.Replication.IMatterWorldTransferAdapter
Supported integration API. All declared source members have authored documentation.
public interface MasterTech.Matter.Replication.IMatterWorldTransferAdapter
Optional transport surface for loading one serialized Matter world on the authoritative peer and transferring the exact save to connected clients. Core Matter defines the contract but contains no transport implementation.
Properties
| Member | Signature | Description |
|---|---|---|
CanLoadAndBroadcastWorld |
bool CanLoadAndBroadcastWorld { get:public; } |
Whether this adapter currently has the authority and readiness to replace and broadcast a world. |
Methods
LoadAndBroadcastWorldAsync
Requests a saved-world replacement and broadcast through the transport adapter's authority policy.
Signature
public abstract System.Threading.Tasks.Task<MasterTech.Matter.Replication.MatterWorldTransferResult> LoadAndBroadcastWorldAsync(byte[] serializedWorld, System.Threading.CancellationToken cancellationToken)
Parameters
| Name | Type | Description |
|---|---|---|
serializedWorld |
byte[] |
Complete checksummed .matterworld document bytes. |
cancellationToken |
System.Threading.CancellationToken |
Cancellation checked around asynchronous work; already submitted GPU or filesystem work may finish. |
Returns
System.Threading.Tasks.Task<MasterTech.Matter.Replication.MatterWorldTransferResult>: A task yielding the transport's transfer result, including failure information.
MasterTech.Matter.Replication.MatterReplicationAdapterLocator
Advanced reference. Descriptions may be generated from compiled signatures.
public static class MasterTech.Matter.Replication.MatterReplicationAdapterLocator
Provides matter replication adapter locator operations.
Methods
FindBehaviour
Find the behaviour.
Signature
public static UnityEngine.MonoBehaviour FindBehaviour(UnityEngine.Component localContext)
Parameters
| Name | Type | Description |
|---|---|---|
localContext |
UnityEngine.Component |
The local context value. |
Returns
UnityEngine.MonoBehaviour: The resulting mono behaviour value.
Resolve
Resolve the supplied values.
Signature
public static MasterTech.Matter.Replication.IMatterReplicationAdapter Resolve(UnityEngine.MonoBehaviour preferred, UnityEngine.Component localContext)
Parameters
| Name | Type | Description |
|---|---|---|
preferred |
UnityEngine.MonoBehaviour |
The preferred value. |
localContext |
UnityEngine.Component |
The local context value. |
Returns
MasterTech.Matter.Replication.IMatterReplicationAdapter: The resulting i matter replication adapter value.
MasterTech.Matter.Replication.MatterReplicationDiagnostics
Supported integration API. All declared source members have authored documentation.
public struct MasterTech.Matter.Replication.MatterReplicationDiagnostics
Immutable snapshot of transport stream counters and simulation exchange failures; counters are diagnostic, not an acknowledgement of delivery.
Properties
| Member | Signature | Description |
|---|---|---|
ReadbackErrors |
ulong ReadbackErrors { get:public; } |
Number of cell-state readback failures recorded by the adapter. |
RejectedEdits |
ulong RejectedEdits { get:public; } |
Number of edit submissions rejected by the adapter or simulation. |
StreamCounters |
MasterTech.Matter.Replication.ChunkStreamCounters StreamCounters { get:public; } |
Transport stream statistics captured when this diagnostic value was created. |
Constructors
MatterReplicationDiagnostics
Creates a diagnostic snapshot from the current stream counters and cumulative exchange failures.
Signature
public void .ctor(MasterTech.Matter.Replication.ChunkStreamCounters streamCounters, ulong readbackErrors, ulong rejectedEdits)
Parameters
| Name | Type | Description |
|---|---|---|
streamCounters |
MasterTech.Matter.Replication.ChunkStreamCounters |
Transport stream counters to include in this snapshot. |
readbackErrors |
ulong |
Cumulative cell-state readback failure count. |
rejectedEdits |
ulong |
Cumulative rejected edit count. |
MasterTech.Matter.Replication.MatterWorldTransferAdapterExtensions
Advanced reference. Descriptions may be generated from compiled signatures.
public static class MasterTech.Matter.Replication.MatterWorldTransferAdapterExtensions
Convenience overloads shared by optional transport plugins. Loaded worlds remain first-class serializable documents and can be handed directly to a transfer adapter.
Methods
LoadAndBroadcastWorldAsync
Load the and broadcast world asynchronously.
Signature
public static System.Threading.Tasks.Task<MasterTech.Matter.Replication.MatterWorldTransferResult> LoadAndBroadcastWorldAsync(MasterTech.Matter.Replication.IMatterWorldTransferAdapter adapter, MasterTech.Matter.Serialization.MatterWorldSave world, MasterTech.Matter.Serialization.MatterWorldEncodingPreference encoding, System.Threading.CancellationToken cancellationToken)
Parameters
| Name | Type | Description |
|---|---|---|
adapter |
MasterTech.Matter.Replication.IMatterWorldTransferAdapter |
The adapter value. |
world |
MasterTech.Matter.Serialization.MatterWorldSave |
The world value. |
encoding |
MasterTech.Matter.Serialization.MatterWorldEncodingPreference |
The encoding value. |
cancellationToken |
System.Threading.CancellationToken |
A token that can cancel the operation. |
Returns
System.Threading.Tasks.Task<MasterTech.Matter.Replication.MatterWorldTransferResult>: A task that completes with the operation result.
MasterTech.Matter.Replication.MatterWorldTransferResult
Supported integration API. All declared source members have authored documentation.
public struct MasterTech.Matter.Replication.MatterWorldTransferResult
Outcome of a serialized world transfer, including payload size and recipient counts; transport success does not guarantee that remote application code has applied the world.
Properties
| Member | Signature | Description |
|---|---|---|
Error |
string Error { get:public; } |
Failure explanation, or an empty string when no explanation was provided. |
FailedClientCount |
int FailedClientCount { get:public; } |
Number of targeted clients whose transfer failed. |
SerializedBytes |
int SerializedBytes { get:public; } |
Serialized world payload size in bytes, excluding transport framing. |
Succeeded |
bool Succeeded { get:public; } |
Whether the operation reported success for its intended recipients. |
TargetClientCount |
int TargetClientCount { get:public; } |
Number of clients targeted by the transfer. |
Constructors
MatterWorldTransferResult
Creates a world-transfer outcome, normalizing a null error message to an empty string.
Signature
public void .ctor(bool succeeded, int serializedBytes, int targetClientCount, int failedClientCount, string error)
Parameters
| Name | Type | Description |
|---|---|---|
succeeded |
bool |
Whether this transfer completed successfully. |
serializedBytes |
int |
Size of the serialized world payload in bytes. |
targetClientCount |
int |
Number of intended recipient clients. |
failedClientCount |
int |
Number of recipient transfers that failed. |
error |
string |
Human-readable failure description; null is normalized to an empty string. |
Methods
Failure
Creates a failed transfer result with recipient counts and an explanation.
Signature
public static MasterTech.Matter.Replication.MatterWorldTransferResult Failure(int serializedBytes, int targetClientCount, int failedClientCount, string error)
Parameters
| Name | Type | Description |
|---|---|---|
serializedBytes |
int |
Size of the serialized world payload in bytes. |
targetClientCount |
int |
Number of intended recipient clients. |
failedClientCount |
int |
Number of recipient transfers that failed. |
error |
string |
Human-readable failure description; null is normalized to an empty string. |
Returns
MasterTech.Matter.Replication.MatterWorldTransferResult: A failed transfer result carrying the supplied counts and error.
Success
Creates a successful transfer result with zero failed clients.
Signature
public static MasterTech.Matter.Replication.MatterWorldTransferResult Success(int serializedBytes, int targetClientCount)
Parameters
| Name | Type | Description |
|---|---|---|
serializedBytes |
int |
Size of the serialized world payload in bytes. |
targetClientCount |
int |
Number of intended recipient clients. |
Returns
MasterTech.Matter.Replication.MatterWorldTransferResult: A successful transfer result with an empty error message.
MasterTech.Matter.Serialization.MatterWorldAsset
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Serialization.MatterWorldAsset
Typed Unity representation of an imported .matterworld document. The source bytes remain authoritative and are preserved exactly.
Properties
| Member | Signature | Description |
|---|---|---|
CellCount |
int CellCount { get:public; } |
Checked number of saved grid cells. |
Encoding |
MasterTech.Matter.Serialization.MatterWorldEncoding Encoding { get:public; } |
Payload encoding used by the imported source document. |
FormatVersion |
ushort FormatVersion { get:public; } |
Format version read from the imported document, not the package version. |
Metadata |
MasterTech.Matter.Serialization.MatterWorldMetadata Metadata { get:public; } |
Saved descriptive/application metadata; does not include scene GameObjects. |
SerializedByteSize |
int SerializedByteSize { get:public; } |
Length of the exact imported document in bytes. |
Settings |
MasterTech.Matter.Serialization.MatterWorldSettings Settings { get:public; } |
Saved layout, tick, solver configuration, mapping and schema metadata. |
SubstanceCount |
int SubstanceCount { get:public; } |
Number of substances recorded in the saved ordered schema. |
SubstanceSchemaHash |
ulong SubstanceSchemaHash { get:public; } |
Hash of the saved ordered substance schema used during compatibility validation. |
Constructors
MatterWorldAsset
Creates a new MatterWorldAsset instance.
Signature
public void .ctor()
Methods
CopySerializedBytes
Returns a caller-owned copy of the exact source document.
Signature
public byte[] CopySerializedBytes()
Returns
byte[]: A caller-owned copy of the original document bytes.
Deserialize
Deserializes a complete immutable copy of this world.
Signature
public MasterTech.Matter.Serialization.MatterWorldSave Deserialize()
Returns
MasterTech.Matter.Serialization.MatterWorldSave: An immutable world snapshot decoded from the retained source bytes.
LoadInto
Loads the imported world into a simulation manager.
Signature
public void LoadInto(MasterTech.Matter.Simulation.MatterSimManager simulation, MasterTech.Matter.Serialization.MatterWorldLoadOptions options)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
options |
MasterTech.Matter.Serialization.MatterWorldLoadOptions |
Application policies; null uses defaults including substance-schema validation. |
MasterTech.Matter.Serialization.MatterWorldEncoding
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Serialization.MatterWorldEncoding
Defines the available matter world encoding values.
Fields
| Member | Signature | Description |
|---|---|---|
Raw |
public static MasterTech.Matter.Serialization.MatterWorldEncoding Raw |
Provides the raw value. |
RunLength |
public static MasterTech.Matter.Serialization.MatterWorldEncoding RunLength |
Provides the run length value. |
MasterTech.Matter.Serialization.MatterWorldEncodingPreference
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Serialization.MatterWorldEncodingPreference
Defines the available matter world encoding preference values.
Fields
| Member | Signature | Description |
|---|---|---|
Auto |
public static MasterTech.Matter.Serialization.MatterWorldEncodingPreference Auto |
Provides the auto value. |
Raw |
public static MasterTech.Matter.Serialization.MatterWorldEncodingPreference Raw |
Provides the raw value. |
RunLength |
public static MasterTech.Matter.Serialization.MatterWorldEncodingPreference RunLength |
Provides the run length value. |
MasterTech.Matter.Serialization.MatterWorldLoadOptions
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Serialization.MatterWorldLoadOptions
Policies for applying a world document; all four options default to true.
Properties
| Member | Signature | Description |
|---|---|---|
ApplySimulationSettings |
bool ApplySimulationSettings { get:public; set:public; } |
Restore saved cadence, solver and capacity settings rather than retaining the current values. |
ApplyWorldMapping |
bool ApplyWorldMapping { get:public; set:public; } |
Restore the saved grid origin and cell dimensions in world units. |
ReconfigureSimulation |
bool ReconfigureSimulation { get:public; set:public; } |
Allow reallocating an incompatible saved layout. False rejects a load that requires reconfiguration. |
ValidateSubstanceSchema |
bool ValidateSubstanceSchema { get:public; set:public; } |
Require matching ordered substance identity. Disabling this does not remap material IDs. |
Constructors
MatterWorldLoadOptions
Creates a new MatterWorldLoadOptions instance.
Signature
public void .ctor()
MasterTech.Matter.Serialization.MatterWorldMetadata
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Serialization.MatterWorldMetadata
User-facing information stored beside the deterministic simulation state. UserDataJson is intentionally opaque to Matter.
Properties
| Member | Signature | Description |
|---|---|---|
ApplicationVersion |
string ApplicationVersion { get:public; } |
Application version recorded by the caller; Matter does not interpret it as a schema version. |
CreatedUtc |
System.DateTime CreatedUtc { get:public; } |
Creation timestamp with DateTimeKind.Utc. |
CreatedUtcTicks |
long CreatedUtcTicks { get:public; } |
Creation time expressed as .NET DateTime ticks in UTC. |
Description |
string Description { get:public; } |
Application-defined description stored with the world. |
UserDataJson |
string UserDataJson { get:public; } |
Opaque application data stored verbatim; Matter does not parse or validate the JSON. |
WorldName |
string WorldName { get:public; } |
Application-defined display name; this is not a path or stable world identifier. |
Constructors
MatterWorldMetadata
Creates descriptive metadata, replacing null strings with empty strings and zero creation ticks with the current UTC time.
Signature
public void .ctor(string worldName, string description, string applicationVersion, string userDataJson, long createdUtcTicks)
Parameters
| Name | Type | Description |
|---|---|---|
worldName |
string |
Display name; null becomes an empty string. |
description |
string |
Descriptive text; null becomes an empty string. |
applicationVersion |
string |
Caller-defined application version; null becomes an empty string. |
userDataJson |
string |
Opaque application JSON string; null becomes an empty string. |
createdUtcTicks |
long |
UTC DateTime ticks, or zero to capture the current UTC time. Values outside the DateTime range throw. |
MasterTech.Matter.Serialization.MatterWorldPersistence
Supported integration API. All declared source members have authored documentation.
public static class MasterTech.Matter.Serialization.MatterWorldPersistence
Backend-neutral capture, byte serialization, file persistence, and restoration helpers. Async capture is safe for WebGPU; sync capture is retained for CPU and native compute backends.
Fields
| Member | Signature | Description |
|---|---|---|
FileExtension |
public static string FileExtension |
Canonical world-document extension, including the leading dot: .matterworld. |
Methods
Apply
Synchronously validates and applies a world, restoring captured prior state if application fails where rollback is available.
Signature
public static void Apply(MasterTech.Matter.Simulation.MatterSimManager simulation, MasterTech.Matter.Serialization.MatterWorldSave world, MasterTech.Matter.Serialization.MatterWorldLoadOptions options)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
world |
MasterTech.Matter.Serialization.MatterWorldSave |
Validated world document to serialize or apply. Do not mutate shared inputs during asynchronous use. |
options |
MasterTech.Matter.Serialization.MatterWorldLoadOptions |
Application policies; null uses defaults including substance-schema validation. |
ApplyAsync
Applies a saved world with asynchronous rollback capture, including on WebGPU where synchronous GPU readback is unavailable.
Signature
public static System.Threading.Tasks.Task ApplyAsync(MasterTech.Matter.Simulation.MatterSimManager simulation, MasterTech.Matter.Serialization.MatterWorldSave world, MasterTech.Matter.Serialization.MatterWorldLoadOptions options, System.Threading.CancellationToken cancellationToken)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
world |
MasterTech.Matter.Serialization.MatterWorldSave |
Validated world document to serialize or apply. Do not mutate shared inputs during asynchronous use. |
options |
MasterTech.Matter.Serialization.MatterWorldLoadOptions |
Application policies; null uses defaults including substance-schema validation. |
cancellationToken |
System.Threading.CancellationToken |
Cancellation checked around asynchronous work; already submitted GPU or filesystem work may finish. |
Returns
System.Threading.Tasks.Task: A task that completes after application; validation, cancellation and rollback failures are propagated.
Remarks
Coordinate concurrent ticks, edits and backend replacement at the application layer. A failed application attempts to restore captured prior state; if rollback also fails, the exception retains both failures.
Capture
Synchronously copies a complete initialized world. Native GPU capture may block; use CaptureAsync on WebGPU.
Signature
public static MasterTech.Matter.Serialization.MatterWorldSave Capture(MasterTech.Matter.Simulation.MatterSimManager simulation, MasterTech.Matter.Serialization.MatterWorldMetadata metadata)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
metadata |
MasterTech.Matter.Serialization.MatterWorldMetadata |
Optional descriptive/application metadata stored with the cells, not scene-object state. |
Returns
MasterTech.Matter.Serialization.MatterWorldSave: A caller-owned immutable world snapshot.
CaptureAsync
Captures metadata before asynchronous cell readback so it describes those cells. The manager must be initialized.
Signature
public static System.Threading.Tasks.Task<MasterTech.Matter.Serialization.MatterWorldSave> CaptureAsync(MasterTech.Matter.Simulation.MatterSimManager simulation, MasterTech.Matter.Serialization.MatterWorldMetadata metadata, System.Threading.CancellationToken cancellationToken)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
metadata |
MasterTech.Matter.Serialization.MatterWorldMetadata |
Optional descriptive/application metadata stored with the cells, not scene-object state. |
cancellationToken |
System.Threading.CancellationToken |
Cancellation checked around asynchronous work; already submitted GPU or filesystem work may finish. |
Returns
System.Threading.Tasks.Task<MasterTech.Matter.Serialization.MatterWorldSave>: A task yielding the captured snapshot after readback.
Remarks
Metadata and mapping are captured before readback. This is not a lock on gameplay mutations; coordinate loads, edits and backend switching while awaiting the snapshot.
LoadFileInto
Reads a native world file and synchronously applies it using the supplied load policies.
Signature
public static void LoadFileInto(MasterTech.Matter.Simulation.MatterSimManager simulation, string path, MasterTech.Matter.Serialization.MatterWorldLoadOptions options)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
path |
string |
Native filesystem destination or source path. Browser integrations should supply their own byte storage. |
options |
MasterTech.Matter.Serialization.MatterWorldLoadOptions |
Application policies; null uses defaults including substance-schema validation. |
LoadFileIntoAsync
Awaits file reading and rollback-aware world application; exceptions describe read, validation or application failures.
Signature
public static System.Threading.Tasks.Task LoadFileIntoAsync(MasterTech.Matter.Simulation.MatterSimManager simulation, string path, MasterTech.Matter.Serialization.MatterWorldLoadOptions options, System.Threading.CancellationToken cancellationToken)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
path |
string |
Native filesystem destination or source path. Browser integrations should supply their own byte storage. |
options |
MasterTech.Matter.Serialization.MatterWorldLoadOptions |
Application policies; null uses defaults including substance-schema validation. |
cancellationToken |
System.Threading.CancellationToken |
Cancellation checked around asynchronous work; already submitted GPU or filesystem work may finish. |
Returns
System.Threading.Tasks.Task: A task that completes after application or faults with the read/load failure.
LoadFromFile
Reads and validates a world file without applying it to a simulation.
Signature
public static MasterTech.Matter.Serialization.MatterWorldSave LoadFromFile(string path)
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Native filesystem destination or source path. Browser integrations should supply their own byte storage. |
Returns
MasterTech.Matter.Serialization.MatterWorldSave: The validated world document; invalid data or I/O failures throw.
LoadFromFileAsync
Reads and validates a world file asynchronously without changing simulation state.
Signature
public static System.Threading.Tasks.Task<MasterTech.Matter.Serialization.MatterWorldSave> LoadFromFileAsync(string path, System.Threading.CancellationToken cancellationToken)
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Native filesystem destination or source path. Browser integrations should supply their own byte storage. |
cancellationToken |
System.Threading.CancellationToken |
Cancellation checked around asynchronous work; already submitted GPU or filesystem work may finish. |
Returns
System.Threading.Tasks.Task<MasterTech.Matter.Serialization.MatterWorldSave>: A task yielding the validated world document; invalid data or I/O failures fault it.
LoadInto
Deserializes bytes and synchronously applies the world with rollback support; use ApplyAsync on WebGPU.
Signature
public static void LoadInto(MasterTech.Matter.Simulation.MatterSimManager simulation, byte[] serializedWorld, MasterTech.Matter.Serialization.MatterWorldLoadOptions options)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
serializedWorld |
byte[] |
Complete checksummed .matterworld document bytes. |
options |
MasterTech.Matter.Serialization.MatterWorldLoadOptions |
Application policies; null uses defaults including substance-schema validation. |
SaveToBytes
Synchronously captures and serializes a checksummed world into caller-owned bytes.
Signature
public static byte[] SaveToBytes(MasterTech.Matter.Simulation.MatterSimManager simulation, MasterTech.Matter.Serialization.MatterWorldMetadata metadata, MasterTech.Matter.Serialization.MatterWorldEncodingPreference encoding)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
metadata |
MasterTech.Matter.Serialization.MatterWorldMetadata |
Optional descriptive/application metadata stored with the cells, not scene-object state. |
encoding |
MasterTech.Matter.Serialization.MatterWorldEncodingPreference |
Payload encoding preference; Auto chooses the serializer's supported compact representation. |
Returns
byte[]: Caller-owned serialized world bytes.
SaveToBytesAsync
Asynchronously captures an initialized world and serializes it into caller-owned bytes.
Signature
public static System.Threading.Tasks.Task<byte[]> SaveToBytesAsync(MasterTech.Matter.Simulation.MatterSimManager simulation, MasterTech.Matter.Serialization.MatterWorldMetadata metadata, MasterTech.Matter.Serialization.MatterWorldEncodingPreference encoding, System.Threading.CancellationToken cancellationToken)
Parameters
| Name | Type | Description |
|---|---|---|
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
metadata |
MasterTech.Matter.Serialization.MatterWorldMetadata |
Optional descriptive/application metadata stored with the cells, not scene-object state. |
encoding |
MasterTech.Matter.Serialization.MatterWorldEncodingPreference |
Payload encoding preference; Auto chooses the serializer's supported compact representation. |
cancellationToken |
System.Threading.CancellationToken |
Cancellation checked around asynchronous work; already submitted GPU or filesystem work may finish. |
Returns
System.Threading.Tasks.Task<byte[]>: A task yielding caller-owned serialized world bytes.
SaveToFile
Overload 1
Atomically writes an already-constructed world document without reading a MasterTech.Matter.Simulation.MatterSimManager. This is intended for authoring tools and import pipelines that own a CPU working copy.
Signature
public static void SaveToFile(string path, MasterTech.Matter.Serialization.MatterWorldSave world, MasterTech.Matter.Serialization.MatterWorldEncodingPreference encoding)
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Native filesystem destination or source path. Browser integrations should supply their own byte storage. |
world |
MasterTech.Matter.Serialization.MatterWorldSave |
Validated world document to serialize or apply. Do not mutate shared inputs during asynchronous use. |
encoding |
MasterTech.Matter.Serialization.MatterWorldEncodingPreference |
Payload encoding preference; Auto chooses the serializer's supported compact representation. |
Overload 2
Captures an initialized world and atomically replaces the destination file with its serialized document.
Signature
public static void SaveToFile(string path, MasterTech.Matter.Simulation.MatterSimManager simulation, MasterTech.Matter.Serialization.MatterWorldMetadata metadata, MasterTech.Matter.Serialization.MatterWorldEncodingPreference encoding)
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Native filesystem destination or source path. Browser integrations should supply their own byte storage. |
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
metadata |
MasterTech.Matter.Serialization.MatterWorldMetadata |
Optional descriptive/application metadata stored with the cells, not scene-object state. |
encoding |
MasterTech.Matter.Serialization.MatterWorldEncodingPreference |
Payload encoding preference; Auto chooses the serializer's supported compact representation. |
SaveToFileAsync
Overload 1
Serializes and atomically writes an already-constructed world on a worker thread. The immutable save is used directly; no simulation capture or graphics readback is performed.
Signature
public static System.Threading.Tasks.Task SaveToFileAsync(string path, MasterTech.Matter.Serialization.MatterWorldSave world, MasterTech.Matter.Serialization.MatterWorldEncodingPreference encoding, System.Threading.CancellationToken cancellationToken)
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Native filesystem destination or source path. Browser integrations should supply their own byte storage. |
world |
MasterTech.Matter.Serialization.MatterWorldSave |
Validated world document to serialize or apply. Do not mutate shared inputs during asynchronous use. |
encoding |
MasterTech.Matter.Serialization.MatterWorldEncodingPreference |
Payload encoding preference; Auto chooses the serializer's supported compact representation. |
cancellationToken |
System.Threading.CancellationToken |
Cancellation checked around asynchronous work; already submitted GPU or filesystem work may finish. |
Returns
System.Threading.Tasks.Task: A task that completes after writing; observe it for I/O, validation and cancellation errors.
Overload 2
Captures through asynchronous readback and atomically writes the document using the native filesystem.
Signature
public static System.Threading.Tasks.Task SaveToFileAsync(string path, MasterTech.Matter.Simulation.MatterSimManager simulation, MasterTech.Matter.Serialization.MatterWorldMetadata metadata, MasterTech.Matter.Serialization.MatterWorldEncodingPreference encoding, System.Threading.CancellationToken cancellationToken)
Parameters
| Name | Type | Description |
|---|---|---|
path |
string |
Native filesystem destination or source path. Browser integrations should supply their own byte storage. |
simulation |
MasterTech.Matter.Simulation.MatterSimManager |
Configured target manager; capture/read operations require it to be initialized. |
metadata |
MasterTech.Matter.Serialization.MatterWorldMetadata |
Optional descriptive/application metadata stored with the cells, not scene-object state. |
encoding |
MasterTech.Matter.Serialization.MatterWorldEncodingPreference |
Payload encoding preference; Auto chooses the serializer's supported compact representation. |
cancellationToken |
System.Threading.CancellationToken |
Cancellation checked around asynchronous work; already submitted GPU or filesystem work may finish. |
Returns
System.Threading.Tasks.Task: A task that completes after writing; observe it for I/O, validation and cancellation errors.
MasterTech.Matter.Serialization.MatterWorldSave
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Serialization.MatterWorldSave
Immutable loaded or captured Matter world. Cell data is copied at the public boundary so caller mutation cannot silently change a save.
Properties
| Member | Signature | Description |
|---|---|---|
CellCount |
int CellCount { get:public; } |
Number of cells contained in the snapshot. |
Item |
MasterTech.Matter.Simulation.Cell Item { get:public; } |
Returns a value copy of the cell at a flattened row-major index; an invalid index throws IndexOutOfRangeException. |
Metadata |
MasterTech.Matter.Serialization.MatterWorldMetadata Metadata { get:public; } |
Descriptive metadata owned by this immutable snapshot. |
Settings |
MasterTech.Matter.Serialization.MatterWorldSettings Settings { get:public; } |
Validated grid, solver, world-mapping, and schema information captured with the cells. |
Constructors
MatterWorldSave
Creates an immutable world by copying exactly Settings.CellCount cells; null cells or a mismatched length throw, and null metadata creates default metadata.
Signature
public void .ctor(MasterTech.Matter.Serialization.MatterWorldSettings settings, MasterTech.Matter.Simulation.Cell[] cells, MasterTech.Matter.Serialization.MatterWorldMetadata metadata)
Parameters
| Name | Type | Description |
|---|---|---|
settings |
MasterTech.Matter.Serialization.MatterWorldSettings |
Validated configuration whose CellCount must match the supplied array length. |
cells |
MasterTech.Matter.Simulation.Cell[] |
Non-null complete cell array; copied by the constructor. |
metadata |
MasterTech.Matter.Serialization.MatterWorldMetadata |
Optional descriptive/application metadata stored with the cells, not scene-object state. |
Methods
CopyCells
Copies the complete cell array so callers can modify their copy without changing this snapshot.
Signature
public MasterTech.Matter.Simulation.Cell[] CopyCells()
Returns
MasterTech.Matter.Simulation.Cell[]: A new caller-owned array containing every saved cell.
MasterTech.Matter.Serialization.MatterWorldSerializationException
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Serialization.MatterWorldSerializationException
Reports an unsupported, corrupt, or unsafe world document or a failure to encode a world.
Constructors
MatterWorldSerializationException
Overload 1
Creates a serialization failure with a human-readable message and, when supplied, its original cause.
Signature
public void .ctor(string message, System.Exception innerException)
Parameters
| Name | Type | Description |
|---|---|---|
message |
string |
Human-readable failure explanation. |
innerException |
System.Exception |
Original failure that caused serialization to stop. |
Overload 2
Creates a serialization failure with a human-readable message and, when supplied, its original cause.
Signature
public void .ctor(string message)
Parameters
| Name | Type | Description |
|---|---|---|
message |
string |
Human-readable failure explanation. |
MasterTech.Matter.Serialization.MatterWorldSerializer
Supported integration API. All declared source members have authored documentation.
public static class MasterTech.Matter.Serialization.MatterWorldSerializer
Versioned, little-endian whole-world serializer. The envelope includes simulation settings, tick state, world mapping, metadata, substance compatibility information, and a CRC32 over the complete document.
Fields
| Member | Signature | Description |
|---|---|---|
CurrentFormatVersion |
public static ushort CurrentFormatVersion |
Current binary world-document format version; independent of the package release version. |
MaximumCellCount |
public static int MaximumCellCount |
Safety limit for decoded cell count, derived from the byte budget and the packed cell size. |
MaximumMetadataBytes |
public static int MaximumMetadataBytes |
Maximum encoded metadata size in bytes (1 MiB). |
MaximumSerializedBytes |
public static int MaximumSerializedBytes |
Maximum accepted document size in bytes (256 MiB), including headers, metadata, and cell payload. |
Methods
Deserialize
Validates and decodes a complete world document; malformed or unsupported data throws MatterWorldSerializationException.
Signature
public static MasterTech.Matter.Serialization.MatterWorldSave Deserialize(byte[] serializedWorld)
Parameters
| Name | Type | Description |
|---|---|---|
serializedWorld |
byte[] |
Complete checksummed .matterworld document bytes. |
Returns
MasterTech.Matter.Serialization.MatterWorldSave: A validated immutable snapshot; no simulation is created or modified.
GetEncoding
Reads the encoding marker after checking the minimum header, magic, version, and encoding; invalid headers throw ArgumentException. This does not validate the complete document checksum.
Signature
public static MasterTech.Matter.Serialization.MatterWorldEncoding GetEncoding(byte[] serializedWorld)
Parameters
| Name | Type | Description |
|---|---|---|
serializedWorld |
byte[] |
Complete checksummed .matterworld document bytes. |
Returns
MasterTech.Matter.Serialization.MatterWorldEncoding: The raw or run-length encoding declared by the supported document header.
Serialize
Encodes an immutable world, metadata, schema identity, and checksum; null worlds throw ArgumentNullException and unsafe or invalid payloads throw serialization errors.
Signature
public static byte[] Serialize(MasterTech.Matter.Serialization.MatterWorldSave world, MasterTech.Matter.Serialization.MatterWorldEncodingPreference encodingPreference)
Parameters
| Name | Type | Description |
|---|---|---|
world |
MasterTech.Matter.Serialization.MatterWorldSave |
Non-null immutable snapshot with valid material IDs and bounded metadata. |
encodingPreference |
MasterTech.Matter.Serialization.MatterWorldEncodingPreference |
Raw, run-length, or automatic selection of the smaller cell encoding. |
Returns
byte[]: A new caller-owned binary document with its checksum.
TryDeserialize
Validates document size, format, checksum, cell payload, and settings without mutating a simulation; returns a diagnostic message on rejection.
Signature
public static bool TryDeserialize(byte[] serializedWorld, MasterTech.Matter.Serialization.MatterWorldSave& world, string& error)
Parameters
| Name | Type | Description |
|---|---|---|
serializedWorld |
byte[] |
Complete checksummed .matterworld document bytes. |
world |
MasterTech.Matter.Serialization.MatterWorldSave& |
Decoded immutable world on success; null on rejection. |
error |
string& |
Human-readable rejection reason on failure; null on success. |
Returns
bool: True when validation and decoding succeed; otherwise false with an error message.
MasterTech.Matter.Serialization.MatterWorldSettings
Supported integration API. All declared source members have authored documentation.
public struct MasterTech.Matter.Serialization.MatterWorldSettings
Simulation configuration and compatibility information captured with a saved world.
Properties
| Member | Signature | Description |
|---|---|---|
CellCount |
int CellCount { get:public; } |
Checked product of Width and Height; integer overflow throws OverflowException. |
CellWorldSize |
UnityEngine.Vector2 CellWorldSize { get:public; } |
Positive Unity world-space width and height of one cell. |
ChunkSize |
int ChunkSize { get:public; } |
Side length of a simulation chunk in cells. |
Height |
int Height { get:public; } |
Number of cell rows in the saved grid. |
MaxEditsPerTick |
int MaxEditsPerTick { get:public; } |
Maximum edit commands accepted for one simulation tick. |
MaxTicksPerFrame |
int MaxTicksPerFrame { get:public; } |
Automatic catch-up tick limit per rendered frame. |
PressureIterations |
int PressureIterations { get:public; } |
Pressure-solver iteration budget per simulation tick. |
SimulationHz |
float SimulationHz { get:public; } |
Requested automatic simulation ticks per second. |
SubstanceCount |
int SubstanceCount { get:public; } |
Number of ordered material slots in the captured database schema. |
SubstanceSchemaHash |
ulong SubstanceSchemaHash { get:public; } |
Compatibility fingerprint of the ordered substance schema; checked on load when schema validation is enabled. |
TemperatureDiffusion |
float TemperatureDiffusion { get:public; } |
Dimensionless thermal-diffusion coefficient used by the simulation. |
TickIndex |
uint TickIndex { get:public; } |
Completed simulation tick counter captured with this world. |
Width |
int Width { get:public; } |
Number of cell columns in the saved grid. |
WorldOrigin |
UnityEngine.Vector2 WorldOrigin { get:public; } |
Unity world-space origin of the grid mapping. |
Constructors
MatterWorldSettings
Creates and validates the saved solver configuration, finite world mapping, and substance-schema identity; invalid values throw ArgumentOutOfRangeException or configuration validation errors.
Signature
public void .ctor(int width, int height, int chunkSize, uint tickIndex, float simulationHz, int pressureIterations, float temperatureDiffusion, int maxEditsPerTick, int maxTicksPerFrame, UnityEngine.Vector2 worldOrigin, UnityEngine.Vector2 cellWorldSize, int substanceCount, ulong substanceSchemaHash)
Parameters
| Name | Type | Description |
|---|---|---|
width |
int |
Even grid width of at least two cells. |
height |
int |
Even grid height of at least two cells. |
chunkSize |
int |
Positive chunk side length in cells. |
tickIndex |
uint |
Completed simulation tick counter to preserve in the snapshot. |
simulationHz |
float |
Finite positive tick frequency in ticks per second. |
pressureIterations |
int |
Nonnegative number of pressure passes per tick. |
temperatureDiffusion |
float |
Thermal-diffusion coefficient in the validated simulation range. |
maxEditsPerTick |
int |
Positive capacity of the bounded edit queue. |
maxTicksPerFrame |
int |
Positive limit on automatic catch-up ticks in a rendered frame. |
worldOrigin |
UnityEngine.Vector2 |
Finite Unity world-space position of the grid origin. |
cellWorldSize |
UnityEngine.Vector2 |
Positive finite width and height of one cell in Unity world units. |
substanceCount |
int |
Number of ordered schema slots, between zero and 65,536 inclusive. |
substanceSchemaHash |
ulong |
Compatibility fingerprint for the captured substance ordering and schema. |
MasterTech.Matter.Serialization.MatterWorldSubstanceSchema
Advanced reference. Descriptions may be generated from compiled signatures.
public static class MasterTech.Matter.Serialization.MatterWorldSubstanceSchema
Stable identity for the ordered material-ID mapping stored in cells. The hash deliberately describes identity/order rather than every tuning value, allowing compatible simulation balancing changes to load saves.
Methods
Compute
Compute the supplied values.
Signature
public static ulong Compute(MasterTech.Matter.Data.SubstanceDatabase database)
Parameters
| Name | Type | Description |
|---|---|---|
database |
MasterTech.Matter.Data.SubstanceDatabase |
The database value. |
Returns
ulong: The calculated value.
MasterTech.Matter.Simulation.Cell
Supported integration API. All declared source members have authored documentation.
public struct MasterTech.Matter.Simulation.Cell
Compact GPU cell. Keep this layout synchronized with MatterCommon.hlsl.
Properties
| Member | Signature | Description |
|---|---|---|
Fill |
byte Fill { get:public; set:public; } |
Encoded occupancy from zero (empty) to 255 (full); not a volume in world units. |
FlowDirection |
byte FlowDirection { get:public; set:public; } |
Encoded horizontal direction and magnitude used by the solver and surface animation. |
HorizontalMomentum |
int HorizontalMomentum { get:public; set:public; } |
Signed horizontal liquid momentum encoded in the four flow bits. Negative values move left, positive values move right, and zero is still. |
IsBurning |
bool IsBurning { get:public; set:public; } |
Reads or updates only the burning flag, preserving all other state bits. |
IsEmpty |
bool IsEmpty { get:public; } |
True when fill is zero, regardless of the retained material ID. |
IsFalling |
bool IsFalling { get:public; set:public; } |
Transient movement state recomputed by the vertical gravity pass. The diagonal pass uses it to distinguish an airborne stack from a supported pool that is ready to spread sideways. |
IsSettled |
bool IsSettled { get:public; set:public; } |
Reads or updates only the settled flag, preserving all other state bits. |
MaterialId |
ushort MaterialId { get:public; set:public; } |
Ordered index into the world's substance database; it is not an asset instance ID. |
Temperature |
byte Temperature { get:public; set:public; } |
Whole degrees Celsius in the representable 0–255 range. |
Fields
| Member | Signature | Description |
|---|---|---|
AmbientTemperatureCelsius |
public static byte AmbientTemperatureCelsius |
Default ambient temperature: 20 degrees Celsius. |
BurningFlag |
public static uint BurningFlag |
Flag marking a burning cell for simulation and presentation consumers. |
FallingFlag |
public static uint FallingFlag |
Transient flag marking airborne movement in the current gravity step. |
FillMask |
public static uint FillMask |
Mask selecting the eight fill bits at offset sixteen. |
FillShift |
public static int FillShift |
Bit offset of the eight-bit fill field in packed cell data. |
flags |
public uint flags |
Packed state and flow flags; preserve unrelated bits when changing a single flag. |
FlowDirectionMask |
public static uint FlowDirectionMask |
Mask selecting horizontal direction and strength from flags. |
FlowDirectionRightBit |
public static byte FlowDirectionRightBit |
Direction bit within the extracted flow signal; set means rightward flow. |
FlowDirectionShift |
public static int FlowDirectionShift |
Bit offset of the encoded horizontal flow signal within flags. |
FlowStrengthMask |
public static byte FlowStrengthMask |
Mask selecting the magnitude bits from an extracted flow signal. |
MaterialMask |
public static uint MaterialMask |
Mask selecting the low sixteen material-ID bits. |
MaximumFlowStrength |
public static int MaximumFlowStrength |
Largest magnitude representable by the horizontal flow signal. |
MaximumTemperatureCelsius |
public static byte MaximumTemperatureCelsius |
Highest representable temperature: 255 degrees Celsius. |
MinimumTemperatureCelsius |
public static byte MinimumTemperatureCelsius |
Lowest representable temperature: 0 degrees Celsius. |
packed |
public uint packed |
Packed material ID, fill and Celsius temperature; prefer the typed properties when editing. |
SettledFlag |
public static uint SettledFlag |
Flag indicating that the solver considers this cell settled. |
SizeInBytes |
public static int SizeInBytes |
Eight-byte cell stride shared by the CPU records and shader layout. |
TemperatureMask |
public static uint TemperatureMask |
Mask selecting the eight temperature bits at offset twenty-four. |
TemperatureShift |
public static int TemperatureShift |
Bit offset of the eight-bit temperature field in packed cell data. |
Methods
Create
Constructs a cell from encoded material, occupancy, temperature and flags without looking up a database.
Signature
public static MasterTech.Matter.Simulation.Cell Create(ushort materialId, byte fill, byte temperature, uint flags)
Parameters
| Name | Type | Description |
|---|---|---|
materialId |
ushort |
Stable positional ID in the target substance database. |
fill |
byte |
Encoded cell occupancy from 0 to 255. |
temperature |
byte |
Whole degrees Celsius encoded in the inclusive 0–255 range. |
flags |
uint |
Packed operation/cell state flags; use the documented flags for this operation. |
Returns
MasterTech.Matter.Simulation.Cell: A value-type cell containing the requested encoded data and flags.
Equals
Overload 1
Compares both packed data and flags; cells with different transient state are unequal.
Signature
public bool Equals(MasterTech.Matter.Simulation.Cell other)
Parameters
| Name | Type | Description |
|---|---|---|
other |
MasterTech.Matter.Simulation.Cell |
Cell to compare, including transient flags. |
Returns
bool: True only when both packed words match.
Overload 2
Compares both packed data and flags; cells with different transient state are unequal.
Signature
public virtual bool Equals(object obj)
Parameters
| Name | Type | Description |
|---|---|---|
obj |
object |
Object to compare; a non-cell object is unequal. |
Returns
bool: True only when both packed words match.
GetHashCode
Combines packed data and flags into a hash consistent with cell equality.
Signature
public virtual int GetHashCode()
Returns
int: A hash derived from both stored words.
op_Equality
Compares two values using their field equality contract.
Signature
public static bool op_Equality(MasterTech.Matter.Simulation.Cell left, MasterTech.Matter.Simulation.Cell right)
Parameters
| Name | Type | Description |
|---|---|---|
left |
MasterTech.Matter.Simulation.Cell |
First value to compare. |
right |
MasterTech.Matter.Simulation.Cell |
Second value to compare. |
Returns
bool: True when the values are equal; otherwise false.
op_Inequality
Compares two values using their field equality contract.
Signature
public static bool op_Inequality(MasterTech.Matter.Simulation.Cell left, MasterTech.Matter.Simulation.Cell right)
Parameters
| Name | Type | Description |
|---|---|---|
left |
MasterTech.Matter.Simulation.Cell |
First value to compare. |
right |
MasterTech.Matter.Simulation.Cell |
Second value to compare. |
Returns
bool: True when the values are different; otherwise false.
Pack
Combines a sixteen-bit material ID and two byte-valued fields into one packed word.
Signature
public static uint Pack(ushort materialId, byte fill, byte temperature)
Parameters
| Name | Type | Description |
|---|---|---|
materialId |
ushort |
Stable positional ID in the target substance database. |
fill |
byte |
Encoded cell occupancy from 0 to 255. |
temperature |
byte |
Whole degrees Celsius encoded in the inclusive 0–255 range. |
Returns
uint: The packed material/fill/temperature word.
Unpack
Extracts material, occupancy and Celsius temperature from a packed word.
Signature
public static void Unpack(uint value, ushort& materialId, byte& fill, byte& temperature)
Parameters
| Name | Type | Description |
|---|---|---|
value |
uint |
Value to encode, decode or validate as described by the operation. |
materialId |
ushort& |
Stable positional ID in the target substance database. |
fill |
byte& |
Encoded cell occupancy from 0 to 255. |
temperature |
byte& |
Whole degrees Celsius encoded in the inclusive 0–255 range. |
MasterTech.Matter.Simulation.CellExchangeResult
Supported integration API. All declared source members have authored documentation.
public struct MasterTech.Matter.Simulation.CellExchangeResult
Result returned by the single-cell GPU exchange kernel. Keep this layout synchronized with the uint4 written by KExchangeCell.
Properties
| Member | Signature | Description |
|---|---|---|
Amount |
byte Amount { get:public; } |
Actually transferred fill from zero to 255; may be less than requested. |
MaterialId |
ushort MaterialId { get:public; } |
Typed material ID for the transferred fill. |
Succeeded |
bool Succeeded { get:public; } |
True when at least one unit of encoded fill was transferred. |
Temperature |
byte Temperature { get:public; } |
Temperature of the transferred material in the 0–255 Celsius range. |
Fields
| Member | Signature | Description |
|---|---|---|
amount |
public uint amount |
Actually transferred fill, encoded as a byte value in a uint-sized GPU field. |
flags |
public uint flags |
State flags associated with the transferred material. |
materialId |
public uint materialId |
Material ID reported by the bounded extraction or injection operation. |
SizeInBytes |
public static int SizeInBytes |
Sixteen-byte exchange-result stride shared by the compute readback and CPU path. |
temperature |
public uint temperature |
Transferred material temperature in whole degrees Celsius, stored in a uint-sized GPU field. |
MasterTech.Matter.Simulation.EditCommand
Supported integration API. All declared source members have authored documentation.
public struct MasterTech.Matter.Simulation.EditCommand
One GPU brush command. The explicit 8 x 32-bit layout is mirrored in MatterCommon.hlsl and remains safe to send through network transports.
Properties
| Member | Signature | Description |
|---|---|---|
Operation |
MasterTech.Matter.Simulation.SimEditOperation Operation { get:public; set:public; } |
Typed view of the command's operation discriminator. |
Position |
UnityEngine.Vector2Int Position { get:public; set:public; } |
Brush center in integer grid coordinates; setting it updates x and y. |
Fields
| Member | Signature | Description |
|---|---|---|
amount |
public uint amount |
Operation-specific encoded fill or strength; use the factory matching the intended operation. |
DefaultTemperature |
public static byte DefaultTemperature |
Temperature used by paint helpers when omitted: ambient 20 degrees Celsius. |
flags |
public uint flags |
Operation-specific flags supplied to the solver; paint uses these as cell state flags. |
materialId |
public uint materialId |
Ordered database ID used by material-writing operations. |
operation |
public uint operation |
Encoded SimEditOperation discriminator; prefer the typed Operation property. |
radius |
public uint radius |
Brush radius in cells; zero targets the center cell. |
SizeInBytes |
public static int SizeInBytes |
Thirty-two-byte command stride; keep the corresponding shader and network layouts unchanged. |
temperature |
public uint temperature |
Target or injected temperature in whole degrees Celsius from zero to 255. |
x |
public int x |
Horizontal center of the brush in grid-cell coordinates. |
y |
public int y |
Vertical center of the brush in grid-cell coordinates. |
Methods
AddFill
Creates a command that adds bounded fill of a selected material without exceeding cell capacity.
Signature
public static MasterTech.Matter.Simulation.EditCommand AddFill(int x, int y, uint radius, ushort materialId, byte amount, byte temperature)
Parameters
| Name | Type | Description |
|---|---|---|
x |
int |
Brush or cell horizontal coordinate in the simulation grid. |
y |
int |
Brush or cell vertical coordinate in the simulation grid. |
radius |
uint |
Brush radius in cells; zero targets one center cell. |
materialId |
ushort |
Stable positional ID in the target substance database. |
amount |
byte |
Requested encoded fill transfer, bounded by available material or capacity. |
temperature |
byte |
Whole degrees Celsius encoded in the inclusive 0–255 range. |
Returns
MasterTech.Matter.Simulation.EditCommand: A bounded fill-addition command to submit through TryQueueEdit.
Erase
Creates a circular command that removes occupancy inside the brush.
Signature
public static MasterTech.Matter.Simulation.EditCommand Erase(int x, int y, uint radius)
Parameters
| Name | Type | Description |
|---|---|---|
x |
int |
Brush or cell horizontal coordinate in the simulation grid. |
y |
int |
Brush or cell vertical coordinate in the simulation grid. |
radius |
uint |
Brush radius in cells; zero targets one center cell. |
Returns
MasterTech.Matter.Simulation.EditCommand: An erase command to submit through TryQueueEdit.
Excavate
Removes only solid, powder, and static cells without igniting nearby material. This uses the simulation's solid-aware explosion operation while making the non-destructive mining intent explicit to callers.
Signature
public static MasterTech.Matter.Simulation.EditCommand Excavate(int x, int y, uint radius)
Parameters
| Name | Type | Description |
|---|---|---|
x |
int |
Brush or cell horizontal coordinate in the simulation grid. |
y |
int |
Brush or cell vertical coordinate in the simulation grid. |
radius |
uint |
Brush radius in cells; zero targets one center cell. |
Returns
MasterTech.Matter.Simulation.EditCommand: An erase/excavation command ready for validated submission.
Explode
Destroys solid terrain while preserving exposed fluids. Flammable cells inside the brush are ignited when is non-zero, allowing the GPU simulation to continue the chain reaction.
Signature
public static MasterTech.Matter.Simulation.EditCommand Explode(int x, int y, uint radius, byte ignitionTemperature)
Parameters
| Name | Type | Description |
|---|---|---|
x |
int |
Brush or cell horizontal coordinate in the simulation grid. |
y |
int |
Brush or cell vertical coordinate in the simulation grid. |
radius |
uint |
Brush radius in cells; zero targets one center cell. |
ignitionTemperature |
byte |
Encoded Celsius temperature applied by the explosion command. |
Returns
MasterTech.Matter.Simulation.EditCommand: A bounded explosion command ready for validated submission.
Paint
Creates a circular material replacement command; submission and application are separate operations.
Signature
public static MasterTech.Matter.Simulation.EditCommand Paint(int x, int y, uint radius, ushort materialId, byte fill, byte temperature, uint flags)
Parameters
| Name | Type | Description |
|---|---|---|
x |
int |
Brush or cell horizontal coordinate in the simulation grid. |
y |
int |
Brush or cell vertical coordinate in the simulation grid. |
radius |
uint |
Brush radius in cells; zero targets one center cell. |
materialId |
ushort |
Stable positional ID in the target substance database. |
fill |
byte |
Encoded cell occupancy from 0 to 255. |
temperature |
byte |
Whole degrees Celsius encoded in the inclusive 0–255 range. |
flags |
uint |
Packed operation/cell state flags; use the documented flags for this operation. |
Returns
MasterTech.Matter.Simulation.EditCommand: A command to submit through TryQueueEdit.
SetHorizontalMomentum
Sets the signed horizontal momentum of liquid cells inside the brush without replacing their material, fill, temperature, or non-flow flags. This is useful for deterministic gameplay impulses such as a rigid body's water-entry wave.
Signature
public static MasterTech.Matter.Simulation.EditCommand SetHorizontalMomentum(int x, int y, uint radius, int momentum)
Parameters
| Name | Type | Description |
|---|---|---|
x |
int |
Brush or cell horizontal coordinate in the simulation grid. |
y |
int |
Brush or cell vertical coordinate in the simulation grid. |
radius |
uint |
Brush radius in cells; zero targets one center cell. |
momentum |
int |
Signed horizontal momentum signal; the factory clamps it to the supported encoding. |
Returns
MasterTech.Matter.Simulation.EditCommand: A command encoding the requested bounded horizontal signal.
SetTemperature
Creates a circular temperature edit using Matter's encoded Celsius range.
Signature
public static MasterTech.Matter.Simulation.EditCommand SetTemperature(int x, int y, uint radius, byte temperature)
Parameters
| Name | Type | Description |
|---|---|---|
x |
int |
Brush or cell horizontal coordinate in the simulation grid. |
y |
int |
Brush or cell vertical coordinate in the simulation grid. |
radius |
uint |
Brush radius in cells; zero targets one center cell. |
temperature |
byte |
Whole degrees Celsius encoded in the inclusive 0–255 range. |
Returns
MasterTech.Matter.Simulation.EditCommand: A temperature command to submit through TryQueueEdit.
MasterTech.Matter.Simulation.MatterPresentationResources
Supported integration API. All declared source members have authored documentation.
public struct MasterTech.Matter.Simulation.MatterPresentationResources
Borrowed, read-only presentation resources for the active backend. Consumers must reacquire this view after MasterTech.Matter.Simulation.MatterSimManager.PresentationResourcesChanged and must never dispose any buffer exposed by it.
Properties
| Member | Signature | Description |
|---|---|---|
Cells |
UnityEngine.ComputeBuffer Cells { get:public; } |
Borrowed cell buffer for presentation. Reacquire after invalidation and never release it yourself. |
Generation |
uint Generation { get:public; } |
Generation token used to detect stale resources after buffer replacement or shutdown. |
GridSize |
UnityEngine.Vector2Int GridSize { get:public; } |
Width and height, in cells, associated with this resource generation. |
IsValid |
bool IsValid { get:public; } |
True only while all three borrowed buffers are allocated and valid; does not extend their lifetime. |
Reactions |
UnityEngine.ComputeBuffer Reactions { get:public; } |
Borrowed baked reaction buffer; consumers must not dispose or replace it. |
SubstanceCount |
int SubstanceCount { get:public; } |
Number of substance records valid in the borrowed substance buffer. |
Substances |
UnityEngine.ComputeBuffer Substances { get:public; } |
Borrowed baked substance buffer belonging to the simulation/database lifetime. |
MasterTech.Matter.Simulation.MatterSimManager
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Simulation.MatterSimManager
Backend-neutral fixed-rate simulation facade. Compute remains the default on supported hardware; Burst provides the no-compute fallback.
Properties
| Member | Signature | Description |
|---|---|---|
ActiveBackend |
MasterTech.Matter.Simulation.SimulationBackendKind ActiveBackend { get:public; } |
The active or currently preferred concrete backend. |
AvailableCpuWorkerThreadCount |
int AvailableCpuWorkerThreadCount { get:public; } |
The Unity Job System workers currently available to Matter. |
CellWorldSize |
UnityEngine.Vector2 CellWorldSize { get:public; } |
The positive world-space width and height of one cell. |
CpuWorkerThreadCount |
int CpuWorkerThreadCount { get:public; set:public; } |
Requested CPU worker count: zero uses every available worker, one uses the serial reference path, and larger values cap Matter's worker lanes. |
CreateCpuPresentationBuffer |
bool CreateCpuPresentationBuffer { get:public; set:public; } |
Whether the CPU backend uploads a GPU presentation buffer for renderers. Change this setting before initialization. |
EffectiveCpuWorkerThreadCount |
int EffectiveCpuWorkerThreadCount { get:public; } |
The worker count resolved from the request and availability. |
GridSize |
UnityEngine.Vector2Int GridSize { get:public; } |
The current grid width and height in cells. |
IsBackendSwitching |
bool IsBackendSwitching { get:public; } |
Whether an asynchronous or synchronous replacement is active. |
IsInitialized |
bool IsInitialized { get:public; } |
Whether a backend is allocated and ready to simulate. |
LastPresentationUploadBytes |
long LastPresentationUploadBytes { get:public; } |
Bytes uploaded by the most recent CPU presentation refresh. |
LastPresentationUploadMilliseconds |
double LastPresentationUploadMilliseconds { get:public; } |
Duration of the most recent CPU presentation upload. |
MemoryStats |
MasterTech.Matter.Simulation.SimulationMemoryStats MemoryStats { get:public; } |
Current backend allocation and upload-memory diagnostics. |
RequestedBackend |
MasterTech.Matter.Simulation.SimulationBackendPreference RequestedBackend { get:public; set:public; } |
The backend policy used during initialization or switching. |
Settings |
MasterTech.Matter.Simulation.MatterSimulationSettings Settings { get:public; } |
The allocated grid and solver configuration. |
SimulateAutomatically |
bool SimulateAutomatically { get:public; set:public; } |
Whether Unity Update advances the fixed-rate simulation automatically. Disable this when another system calls MasterTech.Matter.Simulation.MatterSimManager.SimulateTick. |
SimulationShader |
UnityEngine.ComputeShader SimulationShader { get:public; set:public; } |
The compute shader used by the GPU simulation backend. |
SubstanceCount |
int SubstanceCount { get:public; } |
The number of substances bound to the active backend. |
SubstanceDatabase |
MasterTech.Matter.Data.SubstanceDatabase SubstanceDatabase { get:public; set:public; } |
The authored substance database baked and bound during initialization. Assigning a new database while initialized refreshes owned buffers. |
ThermalSourcesEnabled |
bool ThermalSourcesEnabled { get:public; set:public; } |
Enables registered scene sources. Substance thermal behavior remains active. |
TickIndex |
uint TickIndex { get:public; } |
The number of public ticks completed or restored. |
UseFusedDirtyMarking |
bool UseFusedDirtyMarking { get:public; set:public; } |
Whether supported GPU passes mark dirty chunks without a separate full-grid comparison dispatch. |
WorldOrigin |
UnityEngine.Vector2 WorldOrigin { get:public; } |
The world position of the grid's lower-left edge. |
Fields
| Member | Signature | Description |
|---|---|---|
ReactionGpuStride |
public static int ReactionGpuStride |
Byte stride of one baked reaction GPU record. |
SingleThreadedCpuWorkerThreads |
public static int SingleThreadedCpuWorkerThreads |
Uses the deterministic single-threaded CPU reference path. |
SubstanceGpuStride |
public static int SubstanceGpuStride |
Byte stride of one baked substance GPU record. |
UnlimitedCpuWorkerThreads |
public static int UnlimitedCpuWorkerThreads |
Uses every Unity Job System worker available to Matter. |
Events
| Member | Signature | Description |
|---|---|---|
BackendChanged |
public event System.Action<MasterTech.Matter.Simulation.SimulationBackendKind> BackendChanged |
Raised after the active simulation backend changes. |
PresentationResourcesChanged |
public event System.Action<uint> PresentationResourcesChanged |
Raised whenever borrowed presentation buffers are rebound or become invalid. Subscribers must reacquire them with MasterTech.Matter.Simulation.MatterSimManager.TryGetPresentationResources(MasterTech.Matter.Simulation.MatterPresentationResources@). |
TickCompleted |
public event System.Action<uint> TickCompleted |
Raised after a public simulation tick completes. |
TopologyChanged |
public event System.Action TopologyChanged |
Raised when edits, loading, chunk writes, or backend replacement can invalidate renderer or integration-system topology caches. |
WorldLoaded |
public event System.Action<uint> WorldLoaded |
Raised after a saved world is applied to the manager. |
Constructors
MatterSimManager
Creates a new MatterSimManager instance.
Signature
public void .ctor()
Methods
CanUseBackend
Checks whether a simulation backend can run with the current graphics capabilities and assigned shaders.
Signature
public bool CanUseBackend(MasterTech.Matter.Simulation.SimulationBackendKind kind, string& reason)
Parameters
| Name | Type | Description |
|---|---|---|
kind |
MasterTech.Matter.Simulation.SimulationBackendKind |
The concrete backend to test. |
reason |
string& |
Empty when the backend is available; otherwise, an actionable explanation of the missing capability or assignment. |
Returns
bool: true when the backend is available.
CellToWorldCenter
Returns the world-space center of one valid cell.
Signature
public UnityEngine.Vector2 CellToWorldCenter(int x, int y)
Parameters
| Name | Type | Description |
|---|---|---|
x |
int |
The zero-based horizontal cell coordinate. |
y |
int |
The zero-based vertical cell coordinate. |
Returns
UnityEngine.Vector2: The cell center in world space.
ClearDirtyFlags
Clears all backend dirty-chunk flags.
Signature
public void ClearDirtyFlags()
ConfigureWorldMapping
Defines the world-space origin and size of simulation cells used by the coordinate-conversion helpers and renderers.
Signature
public void ConfigureWorldMapping(UnityEngine.Vector2 origin, UnityEngine.Vector2 sizePerCell)
Parameters
| Name | Type | Description |
|---|---|---|
origin |
UnityEngine.Vector2 |
The world position of the grid's lower-left edge. |
sizePerCell |
UnityEngine.Vector2 |
Positive world-space width and height per cell. |
ConsumeDirtyFlags
Copies current dirty-chunk flags to a caller-owned GPU buffer and clears the backend's flags in the same operation.
Signature
public void ConsumeDirtyFlags(UnityEngine.ComputeBuffer destination)
Parameters
| Name | Type | Description |
|---|---|---|
destination |
UnityEngine.ComputeBuffer |
The buffer that receives one flag per chunk. |
CopyChunkTo
Copies one compact chunk directly into a GPU buffer.
Signature
public void CopyChunkTo(UnityEngine.ComputeBuffer destination, int chunkIndex)
Parameters
| Name | Type | Description |
|---|---|---|
destination |
UnityEngine.ComputeBuffer |
The target GPU buffer. |
chunkIndex |
int |
The row-major chunk index. |
ExtractCellAsync
Removes up to the requested fill from one cell using asynchronous GPU readback when required by the active backend.
Signature
public System.Threading.Tasks.Task<MasterTech.Matter.Simulation.CellExchangeResult> ExtractCellAsync(UnityEngine.Vector2Int cell, byte requestedAmount)
Parameters
| Name | Type | Description |
|---|---|---|
cell |
UnityEngine.Vector2Int |
The cell coordinate to extract from. |
requestedAmount |
byte |
The maximum fill amount to remove. |
Returns
System.Threading.Tasks.Task<MasterTech.Matter.Simulation.CellExchangeResult>: A task whose result describes the extracted material.
Initialize
Validates the configuration, creates the requested simulation backend, binds substance data, and locks the allocated grid layout. Calling this method on an initialized manager has no effect.
Signature
public void Initialize()
InjectCellAsync
Adds up to the requested fill to one compatible cell using asynchronous GPU readback when required by the active backend.
Signature
public System.Threading.Tasks.Task<MasterTech.Matter.Simulation.CellExchangeResult> InjectCellAsync(UnityEngine.Vector2Int cell, ushort materialId, byte requestedAmount, byte temperature)
Parameters
| Name | Type | Description |
|---|---|---|
cell |
UnityEngine.Vector2Int |
The cell coordinate to inject into. |
materialId |
ushort |
The stable substance identifier to add. |
requestedAmount |
byte |
The maximum fill amount to add. |
temperature |
byte |
The temperature of the injected fill. |
Returns
System.Threading.Tasks.Task<MasterTech.Matter.Simulation.CellExchangeResult>: A task whose result describes the injected amount.
LoadInitialCells
Replaces the complete grid and resets the public tick index to zero.
Signature
public void LoadInitialCells(MasterTech.Matter.Simulation.Cell[] cells)
Parameters
| Name | Type | Description |
|---|---|---|
cells |
MasterTech.Matter.Simulation.Cell[] |
Exactly MasterTech.Matter.Simulation.MatterSimulationSettings.CellCount cells in row-major order. |
LoadWorldCells
Replaces the complete backend-neutral grid and restores the saved simulation tick. Both GPU ping-pong buffers or the CPU native state are updated by the active backend.
Signature
public void LoadWorldCells(MasterTech.Matter.Simulation.Cell[] cells, uint tickIndex)
Parameters
| Name | Type | Description |
|---|---|---|
cells |
MasterTech.Matter.Simulation.Cell[] |
Exactly MasterTech.Matter.Simulation.MatterSimulationSettings.CellCount cells in row-major order. |
tickIndex |
uint |
The saved public tick index to restore. |
ReadAllCells
Copies the complete grid into caller-owned memory. This operation is synchronous and can block while using the GPU backend.
Signature
public void ReadAllCells(MasterTech.Matter.Simulation.Cell[] destination)
Parameters
| Name | Type | Description |
|---|---|---|
destination |
MasterTech.Matter.Simulation.Cell[] |
An array with room for at least MasterTech.Matter.Simulation.MatterSimulationSettings.CellCount cells. |
ReadAllCellsAsync
Reads the complete grid without blocking WebGPU's graphics queue. CPU backends complete synchronously.
Signature
public System.Threading.Tasks.Task ReadAllCellsAsync(MasterTech.Matter.Simulation.Cell[] destination)
Parameters
| Name | Type | Description |
|---|---|---|
destination |
MasterTech.Matter.Simulation.Cell[] |
An array with room for at least MasterTech.Matter.Simulation.MatterSimulationSettings.CellCount cells. |
Returns
System.Threading.Tasks.Task: A task that completes after the destination is populated.
ReadChunk
Copies the valid cells of one chunk into caller-owned memory. Edge chunks contain fewer cells when the grid is not evenly divisible.
Signature
public int ReadChunk(int chunkIndex, MasterTech.Matter.Simulation.Cell[] destination, int destinationOffset)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The row-major chunk index. |
destination |
MasterTech.Matter.Simulation.Cell[] |
The array that receives compact cells. |
destinationOffset |
int |
The first destination element to overwrite. |
Returns
int: The number of cells copied.
ReadChunkAsync
Reads a compact valid chunk through AsyncGPUReadback when the GPU backend is active.
Signature
public System.Threading.Tasks.Task<int> ReadChunkAsync(int chunkIndex, MasterTech.Matter.Simulation.Cell[] destination, int destinationOffset)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The row-major chunk index. |
destination |
MasterTech.Matter.Simulation.Cell[] |
The array that receives compact cells. |
destinationOffset |
int |
The first destination element to overwrite. |
Returns
System.Threading.Tasks.Task<int>: A task whose result is the number of cells copied.
SetBackendAsync
Switches backends while using asynchronous cell readback when the current graphics API requires it. If cells change during readback, the switch fails without replacing the newer state; callers may retry.
Signature
public System.Threading.Tasks.Task<MasterTech.Matter.Simulation.SimulationBackendSwitchResult> SetBackendAsync(MasterTech.Matter.Simulation.SimulationBackendPreference preference, bool preserveState, System.Threading.CancellationToken cancellationToken)
Parameters
| Name | Type | Description |
|---|---|---|
preference |
MasterTech.Matter.Simulation.SimulationBackendPreference |
The preferred backend selection policy. |
preserveState |
bool |
Whether to copy the current cells into the replacement backend. |
cancellationToken |
System.Threading.CancellationToken |
A token that can cancel readback before the replacement is committed. |
Returns
System.Threading.Tasks.Task<MasterTech.Matter.Simulation.SimulationBackendSwitchResult>: A task whose result describes the completed switch.
Shutdown
Disposes the active backend, releases its runtime state, clears queued edits, and unlocks the grid layout for reconfiguration.
Signature
public void Shutdown()
SimulateTick
Applies queued edits, advances the active backend by one public tick, updates the tick index, and raises completion notifications.
Signature
public void SimulateTick()
TryExtractCell
Synchronously removes up to the requested fill from one cell.
Signature
public bool TryExtractCell(UnityEngine.Vector2Int cell, byte requestedAmount, MasterTech.Matter.Simulation.CellExchangeResult& result)
Parameters
| Name | Type | Description |
|---|---|---|
cell |
UnityEngine.Vector2Int |
The cell coordinate to extract from. |
requestedAmount |
byte |
The maximum fill amount to remove. |
result |
MasterTech.Matter.Simulation.CellExchangeResult& |
The material and amount actually extracted. |
Returns
bool: true when the exchange was executed; otherwise, false. WebGPU callers should use MasterTech.Matter.Simulation.MatterSimManager.ExtractCellAsync(UnityEngine.Vector2Int,System.Byte).
TryGetPresentationResources
Tries to borrow the active backend's read-only presentation view. The manager owns every buffer in the view. Callers must reacquire it after MasterTech.Matter.Simulation.MatterSimManager.PresentationResourcesChanged is raised.
Signature
public bool TryGetPresentationResources(MasterTech.Matter.Simulation.MatterPresentationResources& resources)
Parameters
| Name | Type | Description |
|---|---|---|
resources |
MasterTech.Matter.Simulation.MatterPresentationResources& |
Borrowed resource snapshot on success; reacquire after invalidation and never dispose its buffers. |
Returns
bool: True when the required borrowed presentation buffers are available.
TryInjectCell
Synchronously adds up to the requested fill to one compatible cell.
Signature
public bool TryInjectCell(UnityEngine.Vector2Int cell, ushort materialId, byte requestedAmount, byte temperature, MasterTech.Matter.Simulation.CellExchangeResult& result)
Parameters
| Name | Type | Description |
|---|---|---|
cell |
UnityEngine.Vector2Int |
The cell coordinate to inject into. |
materialId |
ushort |
The stable substance identifier to add. |
requestedAmount |
byte |
The maximum fill amount to add. |
temperature |
byte |
The temperature of the injected fill. |
result |
MasterTech.Matter.Simulation.CellExchangeResult& |
The amount actually injected. |
Returns
bool: true when the exchange was executed; otherwise, false. WebGPU callers should use MasterTech.Matter.Simulation.MatterSimManager.InjectCellAsync(UnityEngine.Vector2Int,System.UInt16,System.Byte,System.Byte).
TryQueueEdit
Queues one edit for the next simulation tick without allocating.
Signature
public bool TryQueueEdit(MasterTech.Matter.Simulation.EditCommand command)
Parameters
| Name | Type | Description |
|---|---|---|
command |
MasterTech.Matter.Simulation.EditCommand |
The validated edit command to enqueue. |
Returns
bool: false when the manager is not initialized or the per-tick edit queue is full; otherwise, true.
TrySetBackend
Overload 1
Attempts a synchronous backend switch and returns the selected backend together with success or failure information.
Signature
public MasterTech.Matter.Simulation.SimulationBackendSwitchResult TrySetBackend(MasterTech.Matter.Simulation.SimulationBackendPreference preference, bool preserveState)
Parameters
| Name | Type | Description |
|---|---|---|
preference |
MasterTech.Matter.Simulation.SimulationBackendPreference |
The preferred backend selection policy. |
preserveState |
bool |
Whether to copy the current cells into the replacement backend. |
Returns
MasterTech.Matter.Simulation.SimulationBackendSwitchResult: The complete backend-switch result.
Overload 2
Attempts a synchronous backend switch and reports a concise failure reason. Use MasterTech.Matter.Simulation.MatterSimManager.SetBackendAsync(MasterTech.Matter.Simulation.SimulationBackendPreference,System.Boolean,System.Threading.CancellationToken) when WebGPU readback may be required to preserve state.
Signature
public bool TrySetBackend(MasterTech.Matter.Simulation.SimulationBackendPreference preference, bool preserveState, string& failureReason)
Parameters
| Name | Type | Description |
|---|---|---|
preference |
MasterTech.Matter.Simulation.SimulationBackendPreference |
The preferred backend selection policy. |
preserveState |
bool |
Whether to copy the current cells into the replacement backend. |
failureReason |
string& |
Empty on success; otherwise, the reason the switch was rejected. |
Returns
bool: true when the switch succeeds.
TryWorldToCell
Converts a world position to a row-major grid coordinate.
Signature
public bool TryWorldToCell(UnityEngine.Vector2 worldPosition, UnityEngine.Vector2Int& cell)
Parameters
| Name | Type | Description |
|---|---|---|
worldPosition |
UnityEngine.Vector2 |
The world position to convert. |
cell |
UnityEngine.Vector2Int& |
The computed cell coordinate. |
Returns
bool: true when the coordinate lies inside the allocated grid; otherwise, false.
WriteChunk
Replaces the valid cells of one chunk and raises the topology-change notification used by rendering and integration systems.
Signature
public int WriteChunk(int chunkIndex, MasterTech.Matter.Simulation.Cell[] source, int sourceOffset)
Parameters
| Name | Type | Description |
|---|---|---|
chunkIndex |
int |
The row-major chunk index. |
source |
MasterTech.Matter.Simulation.Cell[] |
The array containing compact chunk cells. |
sourceOffset |
int |
The first source element to read. |
Returns
int: The number of cells written.
MasterTech.Matter.Simulation.MatterSimulationSettings
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Simulation.MatterSimulationSettings
Serializable simulation sizing and cadence settings. Defaults match the approved 2048 x 1024 world and 64 x 64 network chunks.
Properties
| Member | Signature | Description |
|---|---|---|
CellCount |
int CellCount { get:public; } |
Checked product of width and height, used to size complete-world cell arrays. |
ChunkCount |
int ChunkCount { get:public; } |
Checked total number of chunks covering the configured grid. |
ChunkCountX |
int ChunkCountX { get:public; } |
Number of horizontal chunks, including a partial final chunk. |
ChunkCountY |
int ChunkCountY { get:public; } |
Number of vertical chunks, including a partial final chunk. |
ChunkSize |
int ChunkSize { get:public; set:public; } |
Positive chunk side length in cells; cannot change while the allocation is locked. |
Height |
int Height { get:public; set:public; } |
Even grid height of at least two cells. Allocation locks prevent changing it while initialized. |
MargolusBlockCountX |
int MargolusBlockCountX { get:public; } |
Number of two-cell-wide movement blocks across the grid. |
MargolusBlockCountY |
int MargolusBlockCountY { get:public; } |
Number of two-cell-high movement blocks up the grid. |
MaxEditsPerTick |
int MaxEditsPerTick { get:public; set:public; } |
Positive bounded edit-queue capacity fixed by the initialized allocation. |
MaxTicksPerFrame |
int MaxTicksPerFrame { get:public; set:public; } |
Catch-up limit of at least one automatic tick per rendered frame. |
PressureIterations |
int PressureIterations { get:public; set:public; } |
Nonnegative number of pressure passes per tick. Zero disables those passes. |
SimulationHz |
float SimulationHz { get:public; set:public; } |
Finite positive automatic tick frequency in ticks per second; runtime changes are allowed. |
TemperatureDiffusion |
float TemperatureDiffusion { get:public; set:public; } |
Finite heat-diffusion factor in [0, 1]; runtime changes do not resize the grid. |
TickInterval |
float TickInterval { get:public; } |
Seconds per public tick, equal to one divided by SimulationHz. |
Width |
int Width { get:public; set:public; } |
Even grid width of at least two cells. Allocation locks prevent changing it while initialized. |
Fields
| Member | Signature | Description |
|---|---|---|
DefaultChunkSize |
public static int DefaultChunkSize |
Default chunk side length of 64 cells. |
DefaultHeight |
public static int DefaultHeight |
Default allocation height of 1024 cells; samples may author a smaller grid. |
DefaultPressureIterations |
public static int DefaultPressureIterations |
Default count of twelve pressure iterations per public tick. |
DefaultSimulationHz |
public static float DefaultSimulationHz |
Default automatic tick frequency of 120 ticks per second. |
DefaultWidth |
public static int DefaultWidth |
Default allocation width of 2048 cells; samples may author a smaller grid. |
Constructors
MatterSimulationSettings
Overload 1
Creates simulation settings; the parameterized constructor validates its supplied allocation and cadence.
Signature
public void .ctor()
Overload 2
Creates simulation settings; the parameterized constructor validates its supplied allocation and cadence.
Signature
public void .ctor(int width, int height, int chunkSize, float simulationHz, int pressureIterations, int maxEditsPerTick)
Parameters
| Name | Type | Description |
|---|---|---|
width |
int |
Even grid width of at least two cells. |
height |
int |
Even grid height of at least two cells. |
chunkSize |
int |
Positive chunk side length in cells. |
simulationHz |
float |
Finite positive tick frequency in ticks per second. |
pressureIterations |
int |
Nonnegative number of pressure passes per tick. |
maxEditsPerTick |
int |
Positive capacity of the bounded edit queue. |
Methods
DivideRoundUp
Computes the number of divisor-sized groups needed to contain value entries using integer arithmetic.
Signature
public static int DivideRoundUp(int value, int divisor)
Parameters
| Name | Type | Description |
|---|---|---|
value |
int |
Value to encode, decode or validate as described by the operation. |
divisor |
int |
Positive size of each group. |
Returns
int: The integer ceiling of value divided by divisor.
Validate
Rejects invalid dimensions, cadence, pressure, diffusion and capacity with argument exceptions.
Signature
public void Validate()
MasterTech.Matter.Simulation.MatterThermalSource
Supported integration API. All declared source members have authored documentation.
public class MasterTech.Matter.Simulation.MatterThermalSource
Applies temperature control to occupied cells in a circular grid region. Evaluated by its simulation once per tick, including editor preview. Scene/prefab serialization owns this object; world saves contain cells.
Properties
| Member | Signature | Description |
|---|---|---|
EdgeFalloff |
float EdgeFalloff { get:public; } |
Zero is uniform; one decreases linearly to zero at the boundary. |
Mode |
MasterTech.Matter.Simulation.ThermalSourceMode Mode { get:public; } |
Whether the source heats, cools, or does either to maintain its target. |
Radius |
float Radius { get:public; } |
Circular radius measured in grid cells. |
Simulation |
MasterTech.Matter.Simulation.MatterSimManager Simulation { get:public; set:public; } |
Simulation receiving this source; reassignment updates registration. |
Strength |
float Strength { get:public; } |
Maximum central temperature change per simulated second. |
TargetTemperature |
int TargetTemperature { get:public; } |
Target in whole Celsius degrees, from 0 through 255. |
Constructors
MatterThermalSource
Creates a new MatterThermalSource instance.
Signature
public void .ctor()
Methods
Configure
Configures a source. Invalid finite ranges throw; no cells change until a tick runs.
Signature
public void Configure(MasterTech.Matter.Simulation.MatterSimManager owner, int targetCelsius, float degreesPerSecond, float radiusCells, MasterTech.Matter.Simulation.ThermalSourceMode sourceMode, float falloff)
Parameters
| Name | Type | Description |
|---|---|---|
owner |
MasterTech.Matter.Simulation.MatterSimManager |
Simulation that owns the affected grid. |
targetCelsius |
int |
Whole Celsius degrees, 0 through 255. |
degreesPerSecond |
float |
Maximum rate, 0 through 65535. Zero disables the effect. |
radiusCells |
float |
Positive radius, at least half a cell. |
sourceMode |
MasterTech.Matter.Simulation.ThermalSourceMode |
Allowed direction of temperature change. |
falloff |
float |
Linear edge falloff amount in [0, 1]. |
MasterTech.Matter.Simulation.SimEditOperation
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Simulation.SimEditOperation
Defines the available sim edit operation values.
Fields
| Member | Signature | Description |
|---|---|---|
AddFill |
public static MasterTech.Matter.Simulation.SimEditOperation AddFill |
Provides the add fill value. |
Erase |
public static MasterTech.Matter.Simulation.SimEditOperation Erase |
Provides the erase value. |
Explode |
public static MasterTech.Matter.Simulation.SimEditOperation Explode |
Provides the explode value. |
Paint |
public static MasterTech.Matter.Simulation.SimEditOperation Paint |
Provides the paint value. |
SetHorizontalMomentum |
public static MasterTech.Matter.Simulation.SimEditOperation SetHorizontalMomentum |
Provides the set horizontal momentum value. |
SetTemperature |
public static MasterTech.Matter.Simulation.SimEditOperation SetTemperature |
Provides the set temperature value. |
MasterTech.Matter.Simulation.SimulationBackendKind
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Simulation.SimulationBackendKind
Defines the available simulation backend kind values.
Fields
| Member | Signature | Description |
|---|---|---|
CpuBurst |
public static MasterTech.Matter.Simulation.SimulationBackendKind CpuBurst |
Provides the CPU burst value. |
GpuCompute |
public static MasterTech.Matter.Simulation.SimulationBackendKind GpuCompute |
Provides the GPU compute value. |
MasterTech.Matter.Simulation.SimulationBackendPreference
Advanced reference. Descriptions may be generated from compiled signatures.
public enum MasterTech.Matter.Simulation.SimulationBackendPreference
Selects the simulation implementation used by MasterTech.Matter.Simulation.MatterSimManager. Auto preserves the compute path on supported hardware and falls back to the Burst CPU implementation when compute shaders are unavailable.
Fields
| Member | Signature | Description |
|---|---|---|
Auto |
public static MasterTech.Matter.Simulation.SimulationBackendPreference Auto |
Provides the auto value. |
CpuBurst |
public static MasterTech.Matter.Simulation.SimulationBackendPreference CpuBurst |
Provides the CPU burst value. |
GpuCompute |
public static MasterTech.Matter.Simulation.SimulationBackendPreference GpuCompute |
Provides the GPU compute value. |
MasterTech.Matter.Simulation.SimulationBackendSwitchResult
Supported integration API. All declared source members have authored documentation.
public struct MasterTech.Matter.Simulation.SimulationBackendSwitchResult
Result of a backend request, including the backend actually active and a readable failure reason.
Properties
| Member | Signature | Description |
|---|---|---|
ActiveBackend |
MasterTech.Matter.Simulation.SimulationBackendKind ActiveBackend { get:public; } |
Backend left active after the attempted operation; do not infer it solely from the request. |
FailureReason |
string FailureReason { get:public; } |
Explanation of a rejected or failed switch; empty for a successful result. |
Succeeded |
bool Succeeded { get:public; } |
True when the requested switch completed successfully. |
Constructors
SimulationBackendSwitchResult
Builds a result without performing a backend switch.
Signature
public void .ctor(bool succeeded, MasterTech.Matter.Simulation.SimulationBackendKind activeBackend, string failureReason)
Parameters
| Name | Type | Description |
|---|---|---|
succeeded |
bool |
Whether the backend operation completed successfully. |
activeBackend |
MasterTech.Matter.Simulation.SimulationBackendKind |
Backend remaining active after the operation. |
failureReason |
string |
Readable failure explanation; empty on success. |
Methods
Failure
Creates a failure result while retaining the backend that remains active.
Signature
public static MasterTech.Matter.Simulation.SimulationBackendSwitchResult Failure(MasterTech.Matter.Simulation.SimulationBackendKind backend, string reason)
Parameters
| Name | Type | Description |
|---|---|---|
backend |
MasterTech.Matter.Simulation.SimulationBackendKind |
Backend represented by the result. |
reason |
string |
Readable explanation for the failure. |
Returns
MasterTech.Matter.Simulation.SimulationBackendSwitchResult: A failure result containing the supplied reason.
Success
Creates a successful result for the supplied active backend.
Signature
public static MasterTech.Matter.Simulation.SimulationBackendSwitchResult Success(MasterTech.Matter.Simulation.SimulationBackendKind backend)
Parameters
| Name | Type | Description |
|---|---|---|
backend |
MasterTech.Matter.Simulation.SimulationBackendKind |
Backend represented by the result. |
Returns
MasterTech.Matter.Simulation.SimulationBackendSwitchResult: A success result with no failure reason.
MasterTech.Matter.Simulation.SimulationMemoryStats
Advanced reference. Descriptions may be generated from compiled signatures.
public struct MasterTech.Matter.Simulation.SimulationMemoryStats
Represents simulation memory stats data.
Properties
| Member | Signature | Description |
|---|---|---|
CpuNativeBytes |
long CpuNativeBytes { get:public; } |
Gets the CPU native bytes. |
GpuPresentationBytes |
long GpuPresentationBytes { get:public; } |
Gets the GPU presentation bytes. |
GpuSimulationBytes |
long GpuSimulationBytes { get:public; } |
Gets the GPU simulation bytes. |
TotalTrackedBytes |
long TotalTrackedBytes { get:public; } |
Gets the total tracked bytes. |
Constructors
SimulationMemoryStats
Creates a new SimulationMemoryStats instance.
Signature
public void .ctor(long cpuNativeBytes, long gpuSimulationBytes, long gpuPresentationBytes)
Parameters
| Name | Type | Description |
|---|---|---|
cpuNativeBytes |
long |
The CPU native bytes value. |
gpuSimulationBytes |
long |
The GPU simulation bytes value. |
gpuPresentationBytes |
long |
The GPU presentation bytes value. |
MasterTech.Matter.Simulation.ThermalSourceMode
Supported integration API. All declared source members have authored documentation.
public enum MasterTech.Matter.Simulation.ThermalSourceMode
Direction allowed by a target-temperature source.
Fields
| Member | Signature | Description |
|---|---|---|
CoolOnly |
public static MasterTech.Matter.Simulation.ThermalSourceMode CoolOnly |
Cools cells above the target; never heats colder cells. |
HeatOnly |
public static MasterTech.Matter.Simulation.ThermalSourceMode HeatOnly |
Heats cells below the target; never cools hotter cells. |
MaintainTemperature |
public static MasterTech.Matter.Simulation.ThermalSourceMode MaintainTemperature |
Heats or cools occupied cells toward the target. |