Package gaiasky.render.system
Class AbstractRenderSystem
java.lang.Object
gaiasky.render.system.AbstractRenderSystem
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
,IRenderSystem
- Direct Known Subclasses:
BillboardRenderer
,FontRenderSystem
,ImmediateModeRenderSystem
,ModelRenderer
,ParticleSystemRenderSystem
,ShapeRenderer
,TessellationRenderer
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected float[]
protected Vector3d
protected com.badlogic.gdx.math.Vector3
protected Comparator<IRenderable>
Comparator of renderables, in case of needprotected com.badlogic.gdx.utils.Array<AbstractRenderSystem.RenderSystemRunnable>
protected com.badlogic.gdx.utils.Array<AbstractRenderSystem.RenderSystemRunnable>
protected ExtShaderProgram[]
protected final SceneRenderer
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractRenderSystem
(SceneRenderer sceneRenderer, RenderGroup rg, float[] alphas, ExtShaderProgram[] programs) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addDepthBufferUniforms
(ExtShaderProgram shaderProgram, ICamera camera) Uniforms needed to compute the logarithmic depth buffer.protected void
addEffectsUniforms
(ExtShaderProgram shaderProgram, ICamera camera) protected void
addGravWaveUniforms
(ExtShaderProgram shaderProgram) void
void
protected void
addPreviousFrameUniforms
(ExtShaderProgram shaderProgram, ICamera camera) Uniforms needed for the velocity bufferprotected void
addRelativisticUniforms
(ExtShaderProgram shaderProgram, ICamera camera) protected void
addVRScale
(ExtShaderProgram shaderProgram) void
dispose()
float
getAlpha
(com.badlogic.ashley.core.Entity entity) float
getAlpha
(IRenderable renderable) Computes the alpha opacity value of a given renderable using its component typesfloat
protected ExtShaderProgram
protected void
Initializes metadata or essential uniforms in the shader program.void
render
(List<IRenderable> renderables, ICamera camera, double t, RenderingContext rc) Renders the given list of renderable objects.abstract void
renderStud
(List<IRenderable> renderables, ICamera camera, double t) void
void
resize
(int w, int h) Resize the current render target with the given width and height.protected void
run
(com.badlogic.gdx.utils.Array<AbstractRenderSystem.RenderSystemRunnable> runnables, List<IRenderable> renderables, ICamera camera) void
updateBatchSize
(int w, int h) Updates the size of object batches, if any.
-
Field Details
-
sceneRenderer
-
rc
-
programs
-
alphas
protected float[] alphas -
comp
Comparator of renderables, in case of need -
auxf
protected com.badlogic.gdx.math.Vector3 auxf -
auxd
-
preRunnables
-
postRunnables
-
-
Constructor Details
-
AbstractRenderSystem
protected AbstractRenderSystem(SceneRenderer sceneRenderer, RenderGroup rg, float[] alphas, ExtShaderProgram[] programs)
-
-
Method Details
-
getRenderGroup
- Specified by:
getRenderGroup
in interfaceIRenderSystem
-
render
Description copied from interface:IRenderSystem
Renders the given list of renderable objects.- Specified by:
render
in interfaceIRenderSystem
- Parameters:
renderables
- The list of objects to render.camera
- The camera object.t
- The time, in seconds, since the session start.rc
- The rendering context object.
-
renderStud
-
addPreRunnables
-
addPostRunnables
-
run
protected void run(com.badlogic.gdx.utils.Array<AbstractRenderSystem.RenderSystemRunnable> runnables, List<IRenderable> renderables, ICamera camera) -
getAlpha
Computes the alpha opacity value of a given renderable using its component types- Parameters:
renderable
- The renderable- Returns:
- The alpha value as the product of all the alphas of its component types.
-
getAlpha
public float getAlpha(com.badlogic.ashley.core.Entity entity) -
getAlpha
-
resize
public void resize(int w, int h) Description copied from interface:IRenderSystem
Resize the current render target with the given width and height.- Specified by:
resize
in interfaceIRenderSystem
- Parameters:
w
- The new width.h
- The new height.
-
updateBatchSize
public void updateBatchSize(int w, int h) Description copied from interface:IRenderSystem
Updates the size of object batches, if any.- Specified by:
updateBatchSize
in interfaceIRenderSystem
- Parameters:
w
- The new width.h
- The new height.
-
addEffectsUniforms
-
addVRScale
-
addRelativisticUniforms
-
addGravWaveUniforms
-
addDepthBufferUniforms
Uniforms needed to compute the logarithmic depth buffer. They never change, so only add if not present.- Parameters:
shaderProgram
- The program.camera
- The camera.
-
addPreviousFrameUniforms
Uniforms needed for the velocity buffer- Parameters:
shaderProgram
- The programcamera
- The camera
-
getShaderProgram
-
initShaderProgram
protected void initShaderProgram()Initializes metadata or essential uniforms in the shader program. -
dispose
public void dispose()- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
-
resetFlags
public void resetFlags()
-