Class MaterialPresets
Standardized material creation for common use cases. Provides consistent visual styling across S1MAPI-generated objects.
public static class MaterialPresets
- Inheritance
-
MaterialPresets
- Inherited Members
Properties
DefaultShader
Gets or sets the default shader used for material creation. Falls back to URP Lit, then Standard, then Internal-Colored.
public static Shader DefaultShader { get; set; }
Property Value
- Shader
Methods
ApplyStandardProperties(Material)
Apply standard S1MAPI properties to a material.
public static void ApplyStandardProperties(Material material)
Parameters
materialMaterialThe material to configure
ClearGlass(float, Color?)
Creates a clear, transparent glass material with minimal tint. Perfect for windows, display cases, and architectural glass elements.
public static Material ClearGlass(float alpha = 0.3, Color? tint = null)
Parameters
alphafloatThe alpha transparency (0-1, default 0.3 for visible but clear glass)
tintColor?Optional subtle color tint (defaults to very light blue)
Returns
- Material
A clear glass material optimized for transparency
CreateFromShader(Shader, Color)
Creates a material from a shader with a base color.
public static Material CreateFromShader(Shader shader, Color color)
Parameters
shaderShaderThe shader to use
colorColorThe base color
Returns
- Material
A new material with the specified shader and color
Emissive(Color, float)
Creates an emissive (glowing) material with the specified color.
public static Material Emissive(Color color, float intensity = 1)
Parameters
colorColorThe emission color
intensityfloatThe emission intensity (default 1.0)
Returns
- Material
A new emissive material
FindExistingMaterial(string)
Finds an existing material in Resources or memory by name.
public static Material? FindExistingMaterial(string materialName)
Parameters
materialNamestringName of the material to find (partial match supported)
Returns
- Material
The found material or null
FromTextureName(string, Color?)
Creates a material using a texture found by name (Resources or Memory).
public static Material FromTextureName(string textureName, Color? color = null)
Parameters
textureNamestringName or path of the texture
colorColor?Optional tint color
Returns
- Material
A textured material
Glass(Color, float)
Creates a glass-like material with the specified color and transparency.
public static Material Glass(Color color, float alpha = 0.3)
Parameters
colorColorThe base color tint of the glass
alphafloatThe alpha transparency (0-1)
Returns
- Material
A new glass material
Metal(Color, float, float)
Creates a metallic material with the specified color.
public static Material Metal(Color color, float metallic = 0.8, float smoothness = 0.9)
Parameters
colorColorThe base color of the metal
metallicfloatThe metallic value (0-1, default 0.8)
smoothnessfloatThe smoothness value (0-1, default 0.9)
Returns
- Material
A new metallic material
Opaque(Color, Shader?)
Creates an opaque material with the specified color.
public static Material Opaque(Color color, Shader? shader = null)
Parameters
colorColorThe base color of the material
shaderShaderOptional shader to use (defaults to Standard shader)
Returns
- Material
A new opaque material
Transparent(Color, float)
Creates a transparent material with the specified color and alpha.
public static Material Transparent(Color color, float alpha = 0.5)
Parameters
colorColorThe base color of the material
alphafloatThe alpha transparency (0-1)
Returns
- Material
A new transparent material