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

public abstract class RenderStyle extends Object implements org.lwjgl.system.NativeResource
Defines how a particle emitter renders a set of particles.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<RenderStyle> CODEC
    • vertexArray

      protected VertexArray 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 with render(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

      public void render(List<QuasarParticle> particles, net.minecraft.client.Camera camera)
      Draws a list of particles using a batched VertexArray.
      Parameters:
      particles - A list of currently active particles
      camera - 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:
      free in interface org.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

      protected abstract void setupBufferState(VertexArrayBuilder builder)
      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 loaded
      camera - The camera rendering the particles
      buffer - The buffer of the current VertexArray
      Since:
      4.4.0