Package gaiasky.render.system
Class AbstractRenderSystem
java.lang.Object
gaiasky.render.system.AbstractRenderSystem
- All Implemented Interfaces:
IRenderSystem
- Direct Known Subclasses:
BillboardSpriteRenderSystem
,BillboardStarRenderSystem
,FontRenderSystem
,ImmediateRenderSystem
,ModelBatchRenderSystem
,ModelBatchTessellationRenderSystem
,ShapeRenderSystem
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected float[]
protected com.badlogic.gdx.math.Vector3
protected Vector3d
protected Comparator<IRenderable>
Comparator of renderables, in case of needstatic boolean
When this is true, new point information is available, so new data is streamed to the GPUprotected com.badlogic.gdx.utils.Array<AbstractRenderSystem.RenderSystemRunnable>
protected com.badlogic.gdx.utils.Array<AbstractRenderSystem.RenderSystemRunnable>
protected ExtShaderProgram[]
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractRenderSystem(SceneGraphRenderer.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)
float
getAlpha(ComponentTypes ct)
float
getAlpha(IRenderable renderable)
Computes the alpha opacity value of a given renderable using its component typesprotected ExtShaderProgram
void
render(com.badlogic.gdx.utils.Array<IRenderable> renderables, ICamera camera, double t, RenderingContext rc)
abstract void
renderStud(com.badlogic.gdx.utils.Array<IRenderable> renderables, ICamera camera, double t)
void
resize(int w, int h)
protected void
run(com.badlogic.gdx.utils.Array<AbstractRenderSystem.RenderSystemRunnable> runnables, com.badlogic.gdx.utils.Array<IRenderable> renderables, ICamera camera)
void
updateBatchSize(int w, int h)
-
Field Details
-
POINT_UPDATE_FLAG
public static boolean POINT_UPDATE_FLAGWhen this is true, new point information is available, so new data is streamed to the GPU -
programs
-
alphas
protected float[] alphas -
comp
Comparator of renderables, in case of need -
rc
-
aux
protected com.badlogic.gdx.math.Vector3 aux -
auxd
-
preRunnables
-
postRunnables
-
-
Constructor Details
-
AbstractRenderSystem
protected AbstractRenderSystem(SceneGraphRenderer.RenderGroup rg, float[] alphas, ExtShaderProgram[] programs)
-
-
Method Details
-
getRenderGroup
- Specified by:
getRenderGroup
in interfaceIRenderSystem
-
render
public void render(com.badlogic.gdx.utils.Array<IRenderable> renderables, ICamera camera, double t, RenderingContext rc)- Specified by:
render
in interfaceIRenderSystem
-
renderStud
public abstract void renderStud(com.badlogic.gdx.utils.Array<IRenderable> renderables, ICamera camera, double t) -
addPreRunnables
-
addPostRunnables
-
run
protected void run(com.badlogic.gdx.utils.Array<AbstractRenderSystem.RenderSystemRunnable> runnables, com.badlogic.gdx.utils.Array<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
-
resize
public void resize(int w, int h)- Specified by:
resize
in interfaceIRenderSystem
-
updateBatchSize
public void updateBatchSize(int w, int h)- Specified by:
updateBatchSize
in interfaceIRenderSystem
-
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 programcamera
- The camera
-
addPreviousFrameUniforms
Uniforms needed for the velocity buffer- Parameters:
shaderProgram
- The programcamera
- The camera
-
getShaderProgram
-