Class InstancingEngine<P extends WorldProgram>
java.lang.Object
com.jozufozu.flywheel.backend.instancing.instancing.InstancingEngine<P>
- All Implemented Interfaces:
MaterialManager,Engine,RenderDispatcher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInstancingEngine.Builder<P extends WorldProgram>static interfaceInstancingEngine.GroupFactory<P extends WorldProgram>static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ProgramCompiler<P>protected final InstancingEngine.GroupFactory<P>protected final booleanprotected final Map<RenderLayer,Map<net.minecraft.client.renderer.RenderType, InstancedMaterialGroup<P>>> static intprotected net.minecraft.core.BlockPos -
Constructor Summary
ConstructorsConstructorDescriptionInstancingEngine(ProgramCompiler<P> context, InstancingEngine.GroupFactory<P> groupFactory, boolean ignoreOriginCoordinate) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDebugInfo(List<String> info) voidvoidbeginFrame(net.minecraft.client.Camera info) Maintain the integer origin coordinate to be within a certain distance from the camera in all directions.static <P extends WorldProgram>
InstancingEngine.Builder<P>builder(ProgramCompiler<P> context) voiddelete()net.minecraft.core.Vec3ivoidrender(TaskEngine taskEngine, RenderLayerEvent event) Render every model for every material.state(RenderLayer layer, net.minecraft.client.renderer.RenderType type) Get a material group that will render in the given layer with the given type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jozufozu.flywheel.api.MaterialManager
cutout, defaultCutout, defaultSolid, defaultTransparent, solid, transparent
-
Field Details
-
MAX_ORIGIN_DISTANCE
public static int MAX_ORIGIN_DISTANCE -
originCoordinate
protected net.minecraft.core.BlockPos originCoordinate -
context
-
groupFactory
-
ignoreOriginCoordinate
protected final boolean ignoreOriginCoordinate -
layers
protected final Map<RenderLayer,Map<net.minecraft.client.renderer.RenderType, layersInstancedMaterialGroup<P extends WorldProgram>>>
-
-
Constructor Details
-
InstancingEngine
public InstancingEngine(ProgramCompiler<P> context, InstancingEngine.GroupFactory<P> groupFactory, boolean ignoreOriginCoordinate)
-
-
Method Details
-
builder
public static <P extends WorldProgram> InstancingEngine.Builder<P> builder(ProgramCompiler<P> context) -
state
Get a material group that will render in the given layer with the given type.- Specified by:
statein interfaceMaterialManager- Parameters:
layer- TheRenderLayeryou want to draw in.type- TheRenderTypeyou need to draw with.- Returns:
- A material group whose children will
-
render
Render every model for every material.- Specified by:
renderin interfaceRenderDispatcherevent- Context for rendering.
-
delete
public void delete()- Specified by:
deletein interfaceRenderDispatcher
-
getOriginCoordinate
public net.minecraft.core.Vec3i getOriginCoordinate()- Specified by:
getOriginCoordinatein interfaceMaterialManager
-
addListener
-
beginFrame
public void beginFrame(net.minecraft.client.Camera info) Maintain the integer origin coordinate to be within a certain distance from the camera in all directions. This prevents floating point precision issues at high coordinates.- Specified by:
beginFramein interfaceRenderDispatcher
-
addDebugInfo
- Specified by:
addDebugInfoin interfaceEngine
-