Class SceneManager
java.lang.Object
gaiasky.util.gdx.model.gltf.scene3d.scene.SceneManager
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
-
Field Summary
Modifier and TypeFieldDescriptioncom.badlogic.gdx.graphics.Camera
protected final EnvironmentCache
Shouldn't be null. -
Constructor Summary
ConstructorDescriptionSceneManager
(int maxBones) SceneManager
(IntShaderProvider shaderProvider, DepthIntShaderProvider depthShaderProvider) SceneManager
(IntShaderProvider shaderProvider, DepthIntShaderProvider depthShaderProvider, IntRenderableSorter renderableSorter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
protected void
void
dispose()
int
getBatch()
com.badlogic.gdx.graphics.g3d.environment.DirectionalLight
com.badlogic.gdx.utils.Array
<IntRenderableProvider> int
void
void
removeScene
(Scene scene) void
render()
render all scenes.void
Render colors only.void
Render only depth (packed 32 bits), useful for post processing effects.void
renderDepth
(com.badlogic.gdx.graphics.Camera camera) Render only depth (packed 32 bits) with custom camera.void
void
Render shadows only to internal frame buffers.void
void
setAmbientLight
(float lum) void
setBatch
(IntModelBatch batch) void
setCamera
(com.badlogic.gdx.graphics.Camera camera) void
setCascadeShadowMap
(CascadeShadowMap cascadeShadowMap) Enable/disable pre-rendering for cascade shadow map.void
setDepthBatch
(IntModelBatch depthBatch) void
setDepthShaderProvider
(DepthIntShaderProvider depthShaderProvider) void
setEnvironmentRotation
(float azymuthAngleDegree) void
setMirrorSource
(MirrorSource mirrorSource) Enable/disable pre-rendering for mirror effect.void
setShaderProvider
(IntShaderProvider shaderProvider) void
setSkyBox
(SceneSkybox skyBox) void
setTransmissionSource
(TransmissionSource transmissionSource) Enable/disable opaque objects pre-rendering for transmission (refraction effect).void
update
(float delta) should be called in order to perform light culling, skybox update and animations.protected void
protected void
Automatically set skybox rotation matching this environment rotation.void
updateViewport
(float width, float height)
-
Field Details
-
environment
Shouldn't be null. -
computedEnvironement
-
camera
public com.badlogic.gdx.graphics.Camera camera
-
-
Constructor Details
-
SceneManager
public SceneManager() -
SceneManager
public SceneManager(int maxBones) -
SceneManager
-
SceneManager
public SceneManager(IntShaderProvider shaderProvider, DepthIntShaderProvider depthShaderProvider, IntRenderableSorter renderableSorter)
-
-
Method Details
-
setEnvironmentRotation
public void setEnvironmentRotation(float azymuthAngleDegree) -
removeEnvironmentRotation
public void removeEnvironmentRotation() -
getBatch
-
setBatch
-
setDepthBatch
-
getDepthBatch
-
setShaderProvider
-
setDepthShaderProvider
-
setTransmissionSource
Enable/disable opaque objects pre-rendering for transmission (refraction effect).- Parameters:
transmissionSource
- set null to disable pre-rendering.
-
setMirrorSource
Enable/disable pre-rendering for mirror effect.- Parameters:
mirrorSource
- set null to disable mirror.
-
setCascadeShadowMap
Enable/disable pre-rendering for cascade shadow map.- Parameters:
cascadeShadowMap
- set null to disable.
-
addScene
-
addScene
-
update
public void update(float delta) should be called in order to perform light culling, skybox update and animations. -
updateSkyboxRotation
protected void updateSkyboxRotation()Automatically set skybox rotation matching this environment rotation. Subclasses could override this method in order to change this behavior. -
updateEnvironment
protected void updateEnvironment() -
cullLights
protected void cullLights() -
render
public void render()render all scenes. because shadows use frame buffers, if you need to render scenes to a frame buffer, you should instead first callrenderShadows()
, bind your frame buffer and then callrenderColors()
-
renderMirror
public void renderMirror() -
renderTransmission
public void renderTransmission() -
renderShadows
public void renderShadows()Render shadows only to internal frame buffers. (useful when you're using your own frame buffer to render scenes) -
renderDepth
public void renderDepth()Render only depth (packed 32 bits), useful for post processing effects. You typically render it to a FBO with depth enabled. -
renderDepth
public void renderDepth(com.badlogic.gdx.graphics.Camera camera) Render only depth (packed 32 bits) with custom camera. Useful to render shadow maps. -
renderColors
public void renderColors()Render colors only. You should callrenderShadows()
before. (useful when you're using your own frame buffer to render scenes) -
getFirstDirectionalLight
public com.badlogic.gdx.graphics.g3d.environment.DirectionalLight getFirstDirectionalLight() -
getFirstDirectionalShadowLight
-
setSkyBox
-
getSkyBox
-
setAmbientLight
public void setAmbientLight(float lum) -
setCamera
public void setCamera(com.badlogic.gdx.graphics.Camera camera) -
removeScene
-
getRenderableProviders
-
updateViewport
public void updateViewport(float width, float height) -
getActiveLightsCount
public int getActiveLightsCount() -
getTotalLightsCount
public int getTotalLightsCount() -
dispose
public void dispose()- Specified by:
dispose
in interfacecom.badlogic.gdx.utils.Disposable
-