Package gaiasky.render
Class SceneGraphRenderer
- java.lang.Object
-
- gaiasky.render.AbstractRenderer
-
- gaiasky.render.SceneGraphRenderer
-
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable,IObserver,IProcessRenderer
public class SceneGraphRenderer extends AbstractRenderer implements IProcessRenderer, IObserver
Renders a scenegraph.
-
-
Field Summary
Fields Modifier and Type Field Description static float[]alphasAlpha values for each typestatic SceneGraphRendererinstancestatic com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Array<IRenderable>>render_listsRender lists for all render groupscom.badlogic.gdx.graphics.glutils.FrameBuffer[]shadowMapFbjava.util.Map<ModelBody,com.badlogic.gdx.math.Matrix4>smCombinedMapjava.util.Map<ModelBody,com.badlogic.gdx.graphics.Texture>smTexMapstatic long[]timesContains the last update time of each of the flagsstatic ComponentTypesvisibleContains the flags representing each type's visibility-
Fields inherited from class gaiasky.render.AbstractRenderer
sg
-
-
Constructor Summary
Constructors Constructor Description SceneGraphRenderer(VRContext vrContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearLists()This must be called when all the rendering for the current frame has finished.voiddispose()voiddoneLoading(com.badlogic.gdx.assets.AssetManager manager)Actually initializes all the clockwork of this renderer using the assets in the given managerISGRgetCurrentSGR()com.badlogic.gdx.graphics.glutils.FrameBuffergetGlowFb()static voidinitialise(com.badlogic.gdx.assets.AssetManager manager, VRContext vrContext)voidinitialize(com.badlogic.gdx.assets.AssetManager manager)Initializes the renderer, sending all the necessary assets to the manager for loadingbooleanisOn(int ordinal)booleanisOn(ComponentTypes comp)Checks if the component types are all onbooleanisOn(ComponentTypes.ComponentType comp)Checks if a given component type is onvoidnotify(Events event, java.lang.Object... data)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 scene.voidrenderGlowPass(ICamera camera, com.badlogic.gdx.graphics.glutils.FrameBuffer fb, int eye)voidrenderScene(ICamera camera, double t, RenderingContext rc)Renders the scenevoidrenderSystem(ICamera camera, double t, RenderingContext rc, java.lang.Class<? extends IRenderSystem> clazz)Renders all the systems which are the same type of the given classvoidresize(int w, int h)voidresize(int w, int h, boolean resizeRenderSys)voidresizeRenderSystems(int w, int h)voidupdateLineRenderSystem()-
Methods inherited from class gaiasky.render.AbstractRenderer
initialize
-
-
-
-
Field Detail
-
instance
public static SceneGraphRenderer instance
-
visible
public static ComponentTypes visible
Contains the flags representing each type's visibility
-
times
public static long[] times
Contains the last update time of each of the flags
-
alphas
public static float[] alphas
Alpha values for each type
-
render_lists
public static com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Array<IRenderable>> render_lists
Render lists for all render groups
-
shadowMapFb
public com.badlogic.gdx.graphics.glutils.FrameBuffer[] shadowMapFb
-
smTexMap
public java.util.Map<ModelBody,com.badlogic.gdx.graphics.Texture> smTexMap
-
smCombinedMap
public java.util.Map<ModelBody,com.badlogic.gdx.math.Matrix4> smCombinedMap
-
-
Constructor Detail
-
SceneGraphRenderer
public SceneGraphRenderer(VRContext vrContext)
-
-
Method Detail
-
initialise
public static void initialise(com.badlogic.gdx.assets.AssetManager manager, VRContext vrContext)
-
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
-
renderGlowPass
public void renderGlowPass(ICamera camera, com.badlogic.gdx.graphics.glutils.FrameBuffer fb, int eye)
-
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
public ISGR getCurrentSGR()
-
getGlowFb
public com.badlogic.gdx.graphics.glutils.FrameBuffer getGlowFb()
-
renderScene
public void renderScene(ICamera camera, double t, RenderingContext rc)
Renders the scene- Parameters:
camera- The camera to uset- The time in seconds since the startrc- The render context
-
renderSystem
public void renderSystem(ICamera camera, double t, RenderingContext rc, java.lang.Class<? extends IRenderSystem> clazz)
Renders all the systems which are the same type of the given class- Parameters:
camera- The camera to uset- The time in seconds since the startrc- The render contexclazz- The class
-
clearLists
public void clearLists()
This must be called when all the rendering for the current frame has finished.
-
isOn
public boolean isOn(ComponentTypes.ComponentType comp)
Checks if a given component type is on- Parameters:
comp- The component- Returns:
- Whether the component is on
-
isOn
public boolean isOn(ComponentTypes comp)
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
public void notify(Events event, java.lang.Object... data)
-
resize
public void resize(int w, int h)
-
resize
public void resize(int w, int h, boolean resizeRenderSys)
-
resizeRenderSystems
public void resizeRenderSystems(int w, int h)
-
dispose
public void dispose()
- Specified by:
disposein interfacecom.badlogic.gdx.utils.Disposable
-
updateLineRenderSystem
public void updateLineRenderSystem()
-
-