Package foundry.veil.api.quasar.particle
Class RenderStyle
java.lang.Object
foundry.veil.api.quasar.particle.RenderStyle
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource
- Direct Known Subclasses:
RenderStyle.Billboard,RenderStyle.Cube
Defines how a particle emitter renders a set of particles.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intstatic final com.mojang.serialization.Codec<RenderStyle> protected intprotected intstatic final intprotected VertexArray -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Called after rendering all particles.protected abstract com.mojang.blaze3d.vertex.MeshDatavoidfree()net.minecraft.client.renderer.RenderTypegetRenderType(QuasarParticle particle, RenderData renderData) voidinit()Called after the Veil renderer is available, sets up anything necessary for rendering.protected abstract voidputBufferData(QuasarParticle particle, net.minecraft.client.Camera camera, ByteBuffer buffer) Put information about each particle into the vertex attribute array.voidrender(List<QuasarParticle> particles, net.minecraft.client.Camera camera) Draws a list of particles using a batched VertexArray.booleansetup(int particleCount) Called before rendering any particles.protected abstract voidsetupBufferState(VertexArrayBuilder builder) Set up the vertex attribute arrays to use for each particle.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lwjgl.system.NativeResource
close
-
Field Details
-
CODEC
-
vertexArray
-
instanceVBO
protected int instanceVBO -
bufferSize
protected final int bufferSize -
maxParticles
protected int maxParticles -
MIN_PARTICLES
public static final int MIN_PARTICLES- See Also:
-
-
Constructor Details
-
RenderStyle
public RenderStyle(int bufferSize)
-
-
Method Details
-
init
public void init()Called after the Veil renderer is available, sets up anything necessary for rendering.- Since:
- 4.4.0
-
setup
public boolean setup(int particleCount) Called before rendering any particles. This will not be fired if the emitter has no particles.- Parameters:
particleCount- The number of particles that will be rendered withrender(List, Camera)- Returns:
- Whether the particles are allowed to render
- Since:
- 1.3.0
-
clear
public void clear()Called after rendering all particles.- Since:
- 1.3.0
-
render
Draws a list of particles using a batched VertexArray.- Parameters:
particles- A list of currently active particlescamera- The camera to use to render the particles- Since:
- 4.4.0
-
getRenderType
public net.minecraft.client.renderer.RenderType getRenderType(QuasarParticle particle, RenderData renderData) - Returns:
- The render type to use for the specified particle.
- Since:
- 1.3.0
- See Also:
-
free
public void free()- Specified by:
freein interfaceorg.lwjgl.system.NativeResource
-
createMesh
protected abstract com.mojang.blaze3d.vertex.MeshData createMesh()- Returns:
- The MeshData to use for each particle.
- Since:
- 4.4.0
-
setupBufferState
Set up the vertex attribute arrays to use for each particle.- Parameters:
builder- The builder associated with the VertexArray- Since:
- 4.4.0
-
putBufferData
protected abstract void putBufferData(QuasarParticle particle, net.minecraft.client.Camera camera, ByteBuffer buffer) Put information about each particle into the vertex attribute array.- Parameters:
particle- The particle being loadedcamera- The camera rendering the particlesbuffer- The buffer of the current VertexArray- Since:
- 4.4.0
-