Class SceneRenderer

java.lang.Object
gaiasky.scene.system.render.SceneRenderer
All Implemented Interfaces:
IObserver, ISceneRenderer

public class SceneRenderer extends Object implements ISceneRenderer, IObserver
Coordinates and manages all rendering operations in Gaia Sky.
  • Field Details Link icon

    • visible Link icon

      public ComponentTypes visible
      Contains the flags representing each type's visibility
    • times Link icon

      public long[] times
      Contains the last update time of each of the flags
    • alphas Link icon

      public float[] alphas
      Alpha values for each type.
  • Constructor Details Link icon

  • Method Details Link icon

    • initialize Link icon

      public void initialize(com.badlogic.gdx.assets.AssetManager manager)
      Description copied from interface: ISceneRenderer
      Initializes the renderer, sending all the necessary assets to the manager for loading.
      Specified by:
      initialize in interface ISceneRenderer
      Parameters:
      manager - The asset manager.
    • doneLoading Link icon

      public void doneLoading(com.badlogic.gdx.assets.AssetManager manager)
      Description copied from interface: ISceneRenderer
      Actually initializes all the clockwork of this renderer using the assets in the given manager.
      Specified by:
      doneLoading in interface ISceneRenderer
      Parameters:
      manager - The asset manager.
    • setRendering Link icon

      public void setRendering(boolean rendering)
    • getRenderLists Link icon

      public List<List<IRenderable>> getRenderLists()
      Description copied from interface: ISceneRenderer
      Returns he render lists of this renderer.
      Specified by:
      getRenderLists in interface ISceneRenderer
    • renderModel Link icon

      public void renderModel(IRenderable r, IntModelBatch batch)
    • clearScreen Link icon

      public void clearScreen()
    • render Link icon

      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)
      Main render function.
      Parameters:
      camera - The camera.
      t - The session time, in seconds.
      rw - The actual width of the frame buffer to render.
      rh - The actual height of the frame buffer to render.
      tw - The width of the target to render.
      th - The height of the target to render.
      fb - The frame buffer. Null to render to screen.
      ppb - The post process bean.
    • getRenderProcess Link icon

      public IRenderMode getRenderProcess()
      Description copied from interface: ISceneRenderer
      Gets the current render process.
      Specified by:
      getRenderProcess in interface ISceneRenderer
      Returns:
      The render mode.
    • getGlowFrameBuffer Link icon

      public com.badlogic.gdx.graphics.glutils.FrameBuffer getGlowFrameBuffer()
      Description copied from interface: ISceneRenderer
      Returns the post-processing glow frame buffer.
      Specified by:
      getGlowFrameBuffer in interface ISceneRenderer
      Returns:
      The glow frame buffer.
    • getOrInitializeRenderSystem Link icon

      public IRenderSystem getOrInitializeRenderSystem(RenderGroup rg)
    • renderScene Link icon

      public void renderScene(ICamera camera, double t, RenderingContext renderContext)
      Renders the scene given a camera, a session time in seconds and a render context.
      Specified by:
      renderScene in interface ISceneRenderer
      Parameters:
      camera - The camera to use.
      t - The time in seconds since the start.
      renderContext - The render context.
    • swapRenderLists Link icon

      public void swapRenderLists()
      This must be called when all the rendering for the current frame has finished.
    • isOn Link icon

      public boolean isOn(ComponentTypes.ComponentType comp)
      Checks if a given component type is on
      Specified by:
      isOn in interface ISceneRenderer
      Parameters:
      comp - The component
      Returns:
      Whether the component is on
    • allOn Link icon

      public boolean allOn(ComponentTypes comp)
      Checks if the component types are all on
      Specified by:
      allOn in interface ISceneRenderer
      Parameters:
      comp - The components
      Returns:
      Whether the components are all on
    • alpha Link icon

      public float alpha(ComponentTypes comp)
      Computes the alpha of this component types by multiplying the alphas of all components
      Parameters:
      comp - The components
      Returns:
      The alpha value
    • isOn Link icon

      public boolean isOn(int ordinal)
    • isVR Link icon

      public boolean isVR()
    • notify Link icon

      public void notify(Event event, Object source, Object... data)
      Description copied from interface: IObserver
      Event notification call.
      Specified by:
      notify in interface IObserver
      Parameters:
      event - The event type.
      source - The source object, if any.
      data - The data associated with this event.
    • resize Link icon

      public void resize(int tw, int th, int rw, int rh)
      Resizes the scene renderer and all its sub-renderers and assets, but not the render systems.
      Parameters:
      tw - New target (screen) width.
      th - New target (screen) height.
      rw - New render buffer width.
      rh - New render buffer height.
    • resize Link icon

      public void resize(int tw, int th, int rw, int rh, boolean resizeRenderSys)
      Resizes the scene renderer and all its sub-renderers and assets.
      Parameters:
      tw - New target (screen) width.
      th - New target (screen) height.
      rw - New render buffer width.
      rh - New render buffer height.
      resizeRenderSys - Also resize all render systems.
    • resizeRenderSystems Link icon

      public void resizeRenderSystems(int tw, int th)
      Resizes the render systems of this renderer.
      Parameters:
      tw - New target (screen) width.
      th - New target (screen) height.
    • dispose Link icon

      public void dispose()
    • updateLineRenderSystems Link icon

      public void updateLineRenderSystems()
    • getRenderAssets Link icon

      public RenderAssets getRenderAssets()
    • getLightGlowPass Link icon

      public LightGlowRenderPass getLightGlowPass()
      Description copied from interface: ISceneRenderer
      Gets the light glow pass object.
      Specified by:
      getLightGlowPass in interface ISceneRenderer
    • resetRenderSystemFlags Link icon

      public void resetRenderSystemFlags()
      Resets the render flags for all systems.
    • getRenderModeOpenXR Link icon

      public RenderModeOpenXR getRenderModeOpenXR()
    • getVrContext Link icon

      public XrDriver getVrContext()
    • getFrameBuffer Link icon

      public com.badlogic.gdx.graphics.glutils.FrameBuffer getFrameBuffer(int w, int h)
    • getModelRenderSystem Link icon

      public ModelEntityRenderSystem getModelRenderSystem()
    • getXRControllerToModel Link icon

      public Map<XrControllerDevice,com.badlogic.ashley.core.Entity> getXRControllerToModel()
    • isCubemapRenderMode Link icon

      public boolean isCubemapRenderMode()