Class LightStorage
java.lang.Object
dev.engine_room.flywheel.backend.engine.LightStorage
- All Implemented Interfaces:
Effect
A managed arena of light sections for uploading to the GPU.
Each section represents an 18x18x18 block volume of light data. The "edges" are taken from the neighboring sections, so that each shader invocation only needs to access a single section of data. Even still, neighboring shader invocations may need to access other sections.
Sections are logically stored as a 9x9x9 array of longs,
where each long holds a 2x2x2 array of light data.
Both the greater array and the longs are packed in x, z, y order.
Thus, each section occupies 5832 bytes.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal CpuArenastatic final intstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcapacity()booleanvoidcollectSection(long section) <C> Plan<C> it.unimi.dsi.fastutil.ints.IntArrayListvoiddelete()net.minecraft.world.level.LevelAccessorlevel()voidonLightUpdate(long section) voidsections(it.unimi.dsi.fastutil.longs.LongSet sections) Set the set of requested sections.voidvoiduploadChangedSections(StagingBuffer staging, int dstVbo) EffectVisual<?> visualize(VisualizationContext ctx, float partialTick) Create a visual that will be keyed by this effect object.
-
Field Details
-
BLOCKS_PER_SECTION
public static final int BLOCKS_PER_SECTION- See Also:
-
LIGHT_SIZE_BYTES
public static final int LIGHT_SIZE_BYTES- See Also:
-
SOLID_SIZE_BYTES
public static final int SOLID_SIZE_BYTES -
SECTION_SIZE_BYTES
public static final int SECTION_SIZE_BYTES -
arena
-
-
Constructor Details
-
LightStorage
public LightStorage(net.minecraft.world.level.LevelAccessor level)
-
-
Method Details
-
level
public net.minecraft.world.level.LevelAccessor level() -
visualize
Description copied from interface:EffectCreate a visual that will be keyed by this effect object. -
sections
public void sections(it.unimi.dsi.fastutil.longs.LongSet sections) Set the set of requested sections.When set, this will be processed in the next frame plan. It may not be set every frame.
- Parameters:
sections- The set of sections requested by the impl.
-
onLightUpdate
public void onLightUpdate(long section) -
createFramePlan
-
capacity
public int capacity() -
collectSection
public void collectSection(long section) -
delete
public void delete() -
checkNeedsLutRebuildAndClear
public boolean checkNeedsLutRebuildAndClear() -
uploadChangedSections
-
upload
-
createLut
public it.unimi.dsi.fastutil.ints.IntArrayList createLut()
-