Class MaterialAsset

java.lang.Object
net.risingworld.api.assets.Asset
net.risingworld.api.assets.MaterialAsset

public class MaterialAsset extends Asset
Represents a material, which descibes the visual appearance of a game object.
  • Method Details

    • create

      public static MaterialAsset create(String name)
      Creates a new material instance. You can change individual properties and assign textures (represented by the TextureAsset class) to it.
      Parameters:
      name - a custom name for the material.
      Returns:
      a new material asset instance.
    • setTexture

      public void setTexture(TextureAsset texture)
    • setNormalMap

      public void setNormalMap(TextureAsset normalMap)
    • setNormalMapStrength

      public void setNormalMapStrength(float strength)
    • setTextureScale

      public void setTextureScale(float sx, float sy)
    • getTextureScale

      public Vector2f getTextureScale()
    • setColor

      public void setColor(float r, float g, float b, float a)
    • setColor

      public void setColor(int rgba)
    • setSmoothness

      public void setSmoothness(float smoothness)
    • setMetallic

      public void setMetallic(float metallic)
    • setAlphaThreshold

      public void setAlphaThreshold(float threshold)
    • setFlags

      public void setFlags(MaterialAsset.Flags... flags)
    • applyChanges

      public void applyChanges()
      Applies all changes done to the material, i.e syncs the material with all players. Note: When assigning the material to an object, this happens automatically.