Class LightModel

java.lang.Object
codechicken.lib.render.lighting.LightModel
All Implemented Interfaces:
IVertexOperation

public class LightModel extends Object implements IVertexOperation
  • Field Details

    • operationIndex

      public static final int operationIndex
    • standardLightModel

      public static LightModel standardLightModel
  • Constructor Details

    • LightModel

      public LightModel()
  • Method Details

    • addLight

      public LightModel addLight(LightModel.Light light)
    • setAmbient

      public LightModel setAmbient(Vector3 vec)
    • apply

      public int apply(int colour, Vector3 normal)
      Parameters:
      colour - The pre-lighting vertex colour. RGBA format
      normal - The normal at the vertex
      Returns:
      The lighting applied colour
    • load

      public boolean load(CCRenderState ccrs)
      Description copied from interface: IVertexOperation
      Load any required references and add dependencies to the pipeline based on the current model (may be null) Return false if this operation is redundant in the pipeline with the given model
      Specified by:
      load in interface IVertexOperation
    • operate

      public void operate(CCRenderState ccrs)
      Description copied from interface: IVertexOperation
      Perform the operation on the current render state
      Specified by:
      operate in interface IVertexOperation
    • operationID

      public int operationID()
      Description copied from interface: IVertexOperation
      Get the unique id representing this type of operation. Duplicate operation IDs within the pipeline may have unexpected results. ID should be obtained from CCRenderState.registerOperation() and stored in a static variable
      Specified by:
      operationID in interface IVertexOperation
    • reducePlanar

      public PlanarLightModel reducePlanar()