Package gaiasky.render
Class SceneGraphRenderer
java.lang.Object
gaiasky.render.AbstractRenderer
gaiasky.render.SceneGraphRenderer
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,IObserver,IProcessRenderer
Initializes the render infrastructure renders the scene using different render systems.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDescribes to which render group this node belongs at a particular time step -
Field Summary
FieldsModifier and TypeFieldDescriptionfloat[]Alpha values for each type.com.badlogic.gdx.graphics.glutils.FrameBuffer[][]long[]Contains the last update time of each of the flagsContains the flags representing each type's visibilityFields inherited from class gaiasky.render.AbstractRenderer
sg -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallOn(ComponentTypes comp) Checks if the component types are all onvoiddispose()voiddoneLoading(com.badlogic.gdx.assets.AssetManager manager) Actually initializes all the clockwork of this renderer using the assets in the given managercom.badlogic.gdx.graphics.glutils.FrameBuffervoidinitialize(com.badlogic.gdx.assets.AssetManager manager) Initializes the renderer, sending all the necessary assets to the manager for loadingbooleanisOn(int ordinal) booleanChecks if a given component type is onvoidEvent notification call.voidrender(ICamera camera, double t, int rw, int rh, int tw, int th, com.badlogic.gdx.graphics.glutils.FrameBuffer fb, IPostProcessor.PostProcessBean ppb) Renders the scenevoidrenderGlowPass(ICamera camera, com.badlogic.gdx.graphics.glutils.FrameBuffer frameBuffer) com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Array<IRenderable>>com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Array<IRenderable>>voidrenderScene(ICamera camera, double t, RenderingContext renderContext) Renders the scene.protected voidrenderSystem(ICamera camera, double t, RenderingContext renderContext, Class<? extends IRenderSystem> systemClass) Renders all the systems which are of the given class.protected voidrenderSystems(ICamera camera, double t, RenderingContext renderContext, Class<?>... systemClasses) Renders all the systems which are of one of the given classes.voidresize(int w, int h, int rw, int rh) voidresize(int w, int h, int rw, int rh, boolean resizeRenderSys) voidresizeRenderSystems(int w, int h, int rw, int rh) voidsetRendering(boolean rendering) voidThis must be called when all the rendering for the current frame has finished.voidMethods inherited from class gaiasky.render.AbstractRenderer
initialize
-
Field Details
-
visible
Contains the flags representing each type's visibility -
times
public long[] timesContains the last update time of each of the flags -
alphas
public float[] alphasAlpha values for each type. -
shadowMapFb
public com.badlogic.gdx.graphics.glutils.FrameBuffer[][] shadowMapFb -
smTexMap
-
smCombinedMap
-
-
Constructor Details
-
SceneGraphRenderer
-
-
Method Details
-
initialize
public void initialize(com.badlogic.gdx.assets.AssetManager manager) Description copied from interface:IProcessRendererInitializes the renderer, sending all the necessary assets to the manager for loading- Specified by:
initializein interfaceIProcessRenderer- Parameters:
manager- The asset manager
-
doneLoading
public void doneLoading(com.badlogic.gdx.assets.AssetManager manager) Description copied from interface:IProcessRendererActually initializes all the clockwork of this renderer using the assets in the given manager- Specified by:
doneLoadingin interfaceIProcessRenderer- Parameters:
manager- The asset manager
-
setRendering
public void setRendering(boolean rendering) -
renderListsFront
-
renderListsBack
-
renderGlowPass
public void renderGlowPass(ICamera camera, com.badlogic.gdx.graphics.glutils.FrameBuffer frameBuffer) -
render
public void render(ICamera camera, double t, int rw, int rh, int tw, int th, com.badlogic.gdx.graphics.glutils.FrameBuffer fb, IPostProcessor.PostProcessBean ppb) Description copied from interface:IProcessRendererRenders the scene- Specified by:
renderin interfaceIProcessRenderer- Parameters:
camera- The camera to uset- The delta time computed in the update method in secondsrw- The width of the render bufferrh- The height of the render buffertw- The final target widthth- The final target heightfb- The frame buffer to write to, if anyppb- The post process bean
-
getCurrentSGR
-
getGlowFb
public com.badlogic.gdx.graphics.glutils.FrameBuffer getGlowFb() -
renderScene
Renders the scene.- Parameters:
camera- The camera to use.t- The time in seconds since the start.renderContext- The render context.
-
renderSystem
protected void renderSystem(ICamera camera, double t, RenderingContext renderContext, Class<? extends IRenderSystem> systemClass) Renders all the systems which are of the given class.- Parameters:
camera- The camera to use.t- The time in seconds since the start.renderContext- The render context.systemClass- The class.
-
renderSystems
protected void renderSystems(ICamera camera, double t, RenderingContext renderContext, Class<?>... systemClasses) Renders all the systems which are of one of the given classes.- Parameters:
camera- The camera to use.t- The time in seconds since the start.renderContext- The render context.systemClasses- The classes.
-
swapRenderLists
public void swapRenderLists()This must be called when all the rendering for the current frame has finished. -
isOn
Checks if a given component type is on- Parameters:
comp- The component- Returns:
- Whether the component is on
-
allOn
Checks if the component types are all on- Parameters:
comp- The components- Returns:
- Whether the components are all on
-
isOn
public boolean isOn(int ordinal) -
notify
Description copied from interface:IObserverEvent notification call. -
resize
public void resize(int w, int h, int rw, int rh) -
resize
public void resize(int w, int h, int rw, int rh, boolean resizeRenderSys) -
resizeRenderSystems
public void resizeRenderSystems(int w, int h, int rw, int rh) -
dispose
public void dispose()- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
updateLineRenderSystem
public void updateLineRenderSystem()
-