Package gaiasky.scene.system.render.draw
Class ParticleSetInstancedRenderer
java.lang.Object
gaiasky.render.system.AbstractRenderSystem
gaiasky.render.system.ImmediateModeRenderSystem
gaiasky.render.system.InstancedRenderSystem
gaiasky.scene.system.render.draw.ParticleSetInstancedRenderer
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,IObserver
,IRenderSystem
Renders particle groups using instancing via billboards with geometry (quads as two triangles).
-
Nested Class Summary
Nested classes/interfaces inherited from class gaiasky.render.system.ImmediateModeRenderSystem
ImmediateModeRenderSystem.MeshData, ImmediateModeRenderSystem.OwnUsage
Nested classes/interfaces inherited from class gaiasky.render.system.AbstractRenderSystem
AbstractRenderSystem.RenderSystemRunnable
-
Field Summary
Fields inherited from class gaiasky.render.system.InstancedRenderSystem
tempInstanceAttribs
Fields inherited from class gaiasky.render.system.ImmediateModeRenderSystem
curr, inGpu, meshes, meshIdx, tempIndices, tempVerts
Fields inherited from class gaiasky.render.system.AbstractRenderSystem
alphas, auxd, auxf, comp, postRunnables, preRunnables, programs, rc, sceneRenderer
-
Constructor Summary
ConstructorDescriptionParticleSetInstancedRenderer
(SceneRenderer sceneRenderer, RenderGroup rg, float[] alphas, ExtShaderProgram[] shaders) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAttributesDivisor0
(com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.VertexAttribute> attributes) Adds the required vertex attributes for this renderer to the given list.protected void
addAttributesDivisor1
(com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.VertexAttribute> attributes) Adds the required vertex attributes for this renderer to the given list.protected void
Initializes metadata or essential uniforms in the shader program.void
Event notification call.protected void
Computes the offset for each vertex attribute.protected void
Computes the offset for each vertex attribute in the instanced array.protected void
preRenderObjects
(ExtShaderProgram shaderProgram, ICamera camera) protected void
renderObject
(ExtShaderProgram shaderProgram, IRenderable renderable) protected void
setInGpu
(IRenderable renderable, boolean state) Methods inherited from class gaiasky.render.system.InstancedRenderSystem
addMeshData, buildAttributesDivisor0, buildAttributesDivisor1, ensureInstanceAttribsSize, initializeModel, initVertices, postRenderObjects, renderStud
Methods inherited from class gaiasky.render.system.ImmediateModeRenderSystem
clearMeshData, clearMeshes, color, color, color, color, createMeshData, dispose, ensureTempIndicesSize, ensureTempVertsSize, getCount, getOffset, inGpu, setCount, setOffset, vertex
Methods inherited from class gaiasky.render.system.AbstractRenderSystem
addDepthBufferUniforms, addEffectsUniforms, addGravWaveUniforms, addPostRunnables, addPreRunnables, addPreviousFrameUniforms, addRelativisticUniforms, addVRScale, getAlpha, getAlpha, getAlpha, getRenderGroup, getShaderProgram, render, resetFlags, resize, run, updateBatchSize
-
Field Details
-
logger
-
-
Constructor Details
-
ParticleSetInstancedRenderer
public ParticleSetInstancedRenderer(SceneRenderer sceneRenderer, RenderGroup rg, float[] alphas, ExtShaderProgram[] shaders)
-
-
Method Details
-
addAttributesDivisor0
protected void addAttributesDivisor0(com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.VertexAttribute> attributes) Description copied from class:InstancedRenderSystem
Adds the required vertex attributes for this renderer to the given list. These attributes are added only once for all instances (divisor=0)- Specified by:
addAttributesDivisor0
in classInstancedRenderSystem
- Parameters:
attributes
- The list of attributes with divisor=0
-
addAttributesDivisor1
protected void addAttributesDivisor1(com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.VertexAttribute> attributes) Description copied from class:InstancedRenderSystem
Adds the required vertex attributes for this renderer to the given list. These attributes are added for every instance (divisor=1)- Specified by:
addAttributesDivisor1
in classInstancedRenderSystem
- Parameters:
attributes
- The list of attributes with divisor=1
-
offsets0
Description copied from class:InstancedRenderSystem
Computes the offset for each vertex attribute. The offsets will be used later in the render stage.- Specified by:
offsets0
in classInstancedRenderSystem
- Parameters:
curr
- The current mesh data
-
offsets1
Description copied from class:InstancedRenderSystem
Computes the offset for each vertex attribute in the instanced array. The offsets will be used later in the render stage.- Specified by:
offsets1
in classInstancedRenderSystem
- Parameters:
curr
- The current mesh data
-
initShaderProgram
protected void initShaderProgram()Description copied from class:AbstractRenderSystem
Initializes metadata or essential uniforms in the shader program.- Overrides:
initShaderProgram
in classAbstractRenderSystem
-
preRenderObjects
- Overrides:
preRenderObjects
in classInstancedRenderSystem
-
renderObject
- Overrides:
renderObject
in classInstancedRenderSystem
-
setInGpu
- Overrides:
setInGpu
in classImmediateModeRenderSystem
-
notify
Description copied from interface:IObserver
Event notification call.
-