Class LightMatrix

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

public class LightMatrix extends Object implements IVertexOperation
Note that when using the class as a vertex transformer, the vertices are assumed to be within the BB (x, y, z) -> (x+1, y+1, z+1)
  • Nested Class Summary

    Nested classes/interfaces inherited from interface codechicken.lib.render.pipeline.IVertexOperation

    IVertexOperation.VertexOperationRegistry
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    @Nullable net.minecraft.world.level.BlockAndTintGetter
     
    float[][]
     
    int[][]
     
    int
     
    static final int
     
    net.minecraft.core.BlockPos
     
    static final int[][]
     
    static final float[]
     
    static final int[][]
    The 9 positions in the sample array for each side, sides >= 6 are centered on sample 13 (the block itself)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    ao(int side)
     
    int[]
    brightness(int side)
     
    protected void
    interp(int s, int q, int a, int b, int c, int d)
     
    static float
    interpAO(float a, float b, float c, float d)
     
    static int
    interpBrightness(int a, int b, int c, int d)
     
    boolean
    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
    void
    locate(net.minecraft.world.level.BlockAndTintGetter a, net.minecraft.core.BlockPos bPos)
     
    void
    Perform the operation on the current render state
    int
    Get the unique id representing this type of operation.
    void
    sample(int i)
     
    void
    sideSample(int side)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • operationIndex

      public static final int operationIndex
    • computed

      public int computed
    • ao

      public float[][] ao
    • brightness

      public int[][] brightness
    • access

      @Nullable public @Nullable net.minecraft.world.level.BlockAndTintGetter access
    • pos

      public net.minecraft.core.BlockPos pos
    • ssamplem

      public static final int[][] ssamplem
      The 9 positions in the sample array for each side, sides >= 6 are centered on sample 13 (the block itself)
    • qsamplem

      public static final int[][] qsamplem
    • sideao

      public static final float[] sideao
  • Constructor Details

    • LightMatrix

      public LightMatrix()
  • Method Details

    • locate

      public void locate(net.minecraft.world.level.BlockAndTintGetter a, net.minecraft.core.BlockPos bPos)
    • sample

      public void sample(int i)
    • brightness

      public int[] brightness(int side)
    • ao

      public float[] ao(int side)
    • sideSample

      public void sideSample(int side)
    • interp

      protected void interp(int s, int q, int a, int b, int c, int d)
    • interpAO

      public static float interpAO(float a, float b, float c, float d)
    • interpBrightness

      public static int interpBrightness(int a, int b, int c, int d)
    • 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