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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected float[]protected Vector3dprotected com.badlogic.gdx.math.Vector3protected 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
ConstructorsModifierConstructorDescriptionprotectedAbstractRenderSystem(SceneRenderer sceneRenderer, RenderGroup rg, float[] alphas, ExtShaderProgram[] programs) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddDepthBufferUniforms(ExtShaderProgram shaderProgram, ICamera camera) Uniforms needed to compute the logarithmic depth buffer.protected voidaddEffectsUniforms(ExtShaderProgram shaderProgram, ICamera camera) protected voidaddGravWaveUniforms(ExtShaderProgram shaderProgram) voidvoidprotected voidaddPreviousFrameUniforms(ExtShaderProgram shaderProgram, ICamera camera) Uniforms needed for the velocity bufferprotected voidaddRelativisticUniforms(ExtShaderProgram shaderProgram, ICamera camera) protected voidaddVRScale(ExtShaderProgram shaderProgram) voiddispose()floatgetAlpha(com.badlogic.ashley.core.Entity entity) floatgetAlpha(IRenderable renderable) Computes the alpha opacity value of a given renderable using its component typesfloatprotected ExtShaderProgramvoidrender(List<IRenderable> renderables, ICamera camera, double t, RenderingContext rc) Renders the given list of renderable objects.abstract voidrenderStud(List<IRenderable> renderables, ICamera camera, double t) voidvoidresize(int w, int h) Resize the current render target with the given width and height.protected voidrun(com.badlogic.gdx.utils.Array<AbstractRenderSystem.RenderSystemRunnable> runnables, List<IRenderable> renderables, ICamera camera) voidupdateBatchSize(int w, int h) Updates the size of object batches, if any.
-
Field Details
-
programs
-
alphas
protected float[] alphas -
comp
Comparator of renderables, in case of need -
rc
-
auxf
protected com.badlogic.gdx.math.Vector3 auxf -
auxd
-
preRunnables
-
postRunnables
-
sceneRenderer
-
-
Constructor Details
-
AbstractRenderSystem
protected AbstractRenderSystem(SceneRenderer sceneRenderer, RenderGroup rg, float[] alphas, ExtShaderProgram[] programs)
-
-
Method Details
-
getRenderGroup
- Specified by:
getRenderGroupin interfaceIRenderSystem
-
render
Description copied from interface:IRenderSystemRenders the given list of renderable objects.- Specified by:
renderin 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:IRenderSystemResize the current render target with the given width and height.- Specified by:
resizein interfaceIRenderSystem- Parameters:
w- The new width.h- The new height.
-
updateBatchSize
public void updateBatchSize(int w, int h) Description copied from interface:IRenderSystemUpdates the size of object batches, if any.- Specified by:
updateBatchSizein 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
-
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
resetFlags
public void resetFlags()
-