java.lang.Object
foundry.veil.api.client.render.deferred.light.Light
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
AreaLight, DirectionalLight, PointLight

public abstract class Light extends Object implements Cloneable
A source of luminance in a scene. Drawn using LightRenderer.
  • Field Details

    • color

      protected final org.joml.Vector3f color
    • brightness

      protected float brightness
  • Constructor Details

    • Light

      public Light()
  • Method Details

    • markDirty

      public void markDirty()
      Marks the data in this light as dirty and needing re-uploading.
    • clean

      public void clean()
      Removes the dirty flag after this light has been uploaded.
    • getColor

      public org.joml.Vector3fc getColor()
      Returns:
      The color of this light
    • getColorInt

      public int getColorInt()
      Returns:
      An integer representing the RGB of this light
    • setColor

      public Light setColor(org.joml.Vector3fc color)
      Sets the RGB color of this light.
      Parameters:
      color - The new color values
    • setColor

      public Light setColor(float red, float green, float blue)
      Sets the RGB color of this light.
      Parameters:
      red - The new red
      green - The new green
      blue - The new blue
    • setColor

      public Light setColor(int color)
      Sets the RGB color of this light.
      Parameters:
      color - THe new RGB of this light
    • setBrightness

      public Light setBrightness(float brightness)
      Sets the brightness of the light. This acts as a multiplier on the light's color.
      Parameters:
      brightness - The new brightness of the light.
    • setTo

      public Light setTo(net.minecraft.client.Camera camera)
      Sets the light position/rotation to be the same as the specified camera.
      Parameters:
      camera - The camera to set relative to
    • getBrightness

      public float getBrightness()
      Returns:
      The brightness multiplier of the light.
    • isDirty

      public boolean isDirty()
      Returns:
      If this light needs to be re-uploaded to the renderer
    • getType

      public abstract LightTypeRegistry.LightType<?> getType()
      Returns:
      The type of light this is
    • clone

      public abstract Light clone()
      Overrides:
      clone in class Object