Protected
bridgeInternal bridge access
Gets the COGS resource ID of the Resource
resource ID
Returns flag marking if resource is released
Gets the optional name
name of the resource
Protected
runtimeInternal runtime access
Compare two Cogs Resource types for equality.
Other resource.
True if same Resource class type & ID and belongs to same Cogs instance.
Protected
equalsCompare two Cogs Resource types for equality.
Other resource.
True if same Resource class type & ID and belongs to same Cogs instance.
Release usage of this MaterialInstance.
Protected
logLog error message
Release to free resources after use. Also release local handle after creating resource and passing to Cogs.
const model = runtime.ModelEntity.create("Model");
const modelResource: runtime.resources.loadModel(modelPath);
model.modelComponent.model = modelResource;
modelResource.release(); // ModelComponent now sole owner
internalRelease for actual release.
Set an option parameter for the given name.
Generic lookup matching name of key to legal option value(s).
Name to set.
Option value
Set an option parameter for the given name.
Name to set.
Option value
Select MaterialInstance permutation
permutation name
Set property for Material instance
Property key to set
Property value. Numbers are interpreted as float. Note that vec3 etc can be used, but vec3.fromValues required. number[] array not allowed.
Set a texture property
Key in material instance.
Resource
Set addressing mode for a texture property
Name of texture property
Texture address mode
Select Material Instance variant.
Name of variant
Variant value. Value passed to Cogs is always string.
Static
createInternal: Create a MaterialInstance from given material.
Optional
name: stringStatic
createInternal: Create a MaterialInstance from existing resource Called from field getter for MaterialInstance
Resource wrapper for Cogs Material Instance. New resource is created using resources.loadMaterialInstance(..) Release using: MaterialInstance.release()
Material instances represent a specialized Material combined with state for all its buffers and properties. All material instances created from the same material share the effect resource and properties of the material. Only the values contained in the buffers and properties may differ between MaterialInstances created from the same Material.