class Material

in global :: Sandbox

A material. Uses several s and a with specific settings for more interesting visual effects.


public string Name { get; }

Name (or path) of the material.

public RenderAttributes Attributes { get; }

Access to all of the attributes of this material.

public static Material Create( string materialName, string shader )

Create a new empty material at runtime.

  • materialName Name of the new material.
  • shader Shader that the new material will use.
  • Returns The new material.

public static Material FromShader( Shader shader )

Get an empty material based on the specified shader. This will cache the material so that subsequent calls will return the same material.

public static Material FromShader( string path )

Get an empty material based on the specified shader. This will cache the material so that subsequent calls will return the same material.

public bool Set( string param, Vector4 value )

Overrides/Sets an Vector4 within the material

public bool Set( string param, Texture texture )

Override/Sets texture parameter (Color, Normal, etc)

public bool Set( string param, Color value )

Overrides/Sets an color within the material as a color value within the material

public bool Set( string param, Vector3 value )

Overrides/Sets an Vector3 within the material

public bool Set( string param, Vector2 value )

Overrides/Sets an Vector2 within the material

public bool Set( string param, float value )

Overrides/Sets an float within the material

public bool Set( string param, int value )

Overrides/Sets an int within the material

public bool Set( string param, bool value )

Overrides/Sets an bool within the material

public string ShaderName { get; }

Gets the underlying shader name for this material.

public Shader Shader { get; set; }

Gets the material's shader

public Material.FlagsAccessor Flags { get; }

Access flags on this material, which usually hint about the contents. These are generally added by the shader procedurally - but developers can add these in material editor too.

public static Material Load( string filename )

Load a material from disk. Has internal cache.

  • filename The filepath to load the material from.
  • Returns The loaded material, or null

public static Task<Material> LoadAsync( string filename )

Load a material from disk. Has internal cache.

  • filename The filepath to load the material from.
  • Returns The loaded material, or null

public bool Equals( object obj )

😔 No documentation found.

public Texture FirstTexture { get; }

😔 No documentation found.

public Texture GetTexture( string name )

😔 No documentation found.

public int ResourceId { get; }

😔 No documentation found.

public string ResourcePath { get; }

😔 No documentation found.

public string ResourceName { get; }

😔 No documentation found.

public bool IsValid { get; }

😔 No documentation found.

public bool HasUnsavedChanges { get; }

😔 No documentation found.

public string ToString( )

😔 No documentation found.

public void StateHasChanged( )

😔 No documentation found.

public Type GetType( )

😔 No documentation found.

public Material CreateCopy( )

😔 No documentation found.

public int GetHashCode( )

😔 No documentation found.