Class LightGlow
java.lang.Object
gaiasky.render.postprocess.PostProcessorEffect
gaiasky.render.postprocess.effects.LightGlow
- All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable
A post-processor effect that renders a glow around light sources like stars and planets.
It uses a GlowFilter to draw a halo around each light. The intensity of a halo comes from
the apparent magnitude of the light, its size from the angular size, and the depth buffer of the
scene drops the halos of the lights hidden behind other objects.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class PostProcessorEffect
disposables, disposed, enabled, enabledInCubemap, enabledInVRModifier and TypeFieldDescriptionprotected com.badlogic.gdx.utils.Array<com.badlogic.gdx.utils.Disposable> Array of disposables.protected booleanprotected booleanprotected booleanprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidenableBlending(int sFactor, int dFactor) intintcom.badlogic.gdx.graphics.Texturecom.badlogic.gdx.graphics.Texturebooleanvoidrebind()Concrete objects shall be responsible to recreate or rebind its own resources whenever its needed, usually when the OpenGL context is lost.voidrender(com.badlogic.gdx.graphics.glutils.FrameBuffer src, com.badlogic.gdx.graphics.glutils.FrameBuffer dest, GaiaSkyFrameBuffer full, GaiaSkyFrameBuffer half) Concrete objects shall implement its own rendering, given the source and destination buffers.voidsetBackBufferScale(float bbs) voidsetDepthTexture(com.badlogic.gdx.graphics.Texture tex) voidsetFovFactor(float fovFactor) Sets the field of view factor of the camera.voidsetLightColors(float[] vec) voidsetLightDepths(float[] vec) Sets the distance from the camera to each light.voidsetLightGlowTexture(com.badlogic.gdx.graphics.Texture tex) voidsetLightIntensities(float[] vec) Sets the glow intensity of each light, in [0,1], computed from its apparent magnitude.voidsetLightPositions(int nLights, float[] vec) voidsetLightSolidAngles(float[] vec) voidsetNLights(int nLights) voidsetSettings(LightGlow.Settings settings) voidsetTextureScale(float scl) Sets the maximum halo radius, in pixels at the reference height.voidsetViewportSize(int width, int height) Methods inherited from class PostProcessorEffect
dispose, isEnabled, isEnabledInCubemap, isEnabledInVR, restoreViewport, setEnabled, setEnabledInCubemap, setEnabledInVR, setEnabledOptions, updateShadersModifier and TypeMethodDescriptionvoiddispose()Default implementation uses the resources in the disposables list.booleanWhether this effect is enabled and should be processed.booleanbooleanprotected voidrestoreViewport(com.badlogic.gdx.graphics.glutils.FrameBuffer dest) Convenience method to forward the call to the PostProcessor object while still being a non-publicly accessible method.voidsetEnabled(boolean enabled) Sets this effect enabled or not.voidsetEnabledInCubemap(boolean enabled) voidsetEnabledInVR(boolean enabled) voidsetEnabledOptions(boolean enabledInCubemap, boolean enabledInVR) voidRe-compiles the shaders of all filters in this effect.
-
Constructor Details
-
LightGlow
public LightGlow(int width, int height)
-
-
Method Details
-
setBackBufferScale
public void setBackBufferScale(float bbs) -
setLightPositions
public void setLightPositions(int nLights, float[] vec) -
setNLights
public void setNLights(int nLights) -
setLightSolidAngles
public void setLightSolidAngles(float[] vec) -
setLightDepths
public void setLightDepths(float[] vec) Sets the distance from the camera to each light. -
setLightIntensities
public void setLightIntensities(float[] vec) Sets the glow intensity of each light, in [0,1], computed from its apparent magnitude. -
setLightColors
public void setLightColors(float[] vec) -
setFovFactor
public void setFovFactor(float fovFactor) Sets the field of view factor of the camera. -
setTextureScale
public void setTextureScale(float scl) Sets the maximum halo radius, in pixels at the reference height. -
enableBlending
public void enableBlending(int sFactor, int dFactor) -
disableBlending
public void disableBlending() -
getLightGlowTexture
public com.badlogic.gdx.graphics.Texture getLightGlowTexture() -
setLightGlowTexture
public void setLightGlowTexture(com.badlogic.gdx.graphics.Texture tex) -
getDepthTexture
public com.badlogic.gdx.graphics.Texture getDepthTexture() -
setDepthTexture
public void setDepthTexture(com.badlogic.gdx.graphics.Texture tex) -
isBlendingEnabled
public boolean isBlendingEnabled() -
getBlendingSourceFactor
public int getBlendingSourceFactor() -
getBlendingDestFactor
public int getBlendingDestFactor() -
getSettings
-
setSettings
-
render
public void render(com.badlogic.gdx.graphics.glutils.FrameBuffer src, com.badlogic.gdx.graphics.glutils.FrameBuffer dest, GaiaSkyFrameBuffer full, GaiaSkyFrameBuffer half) Description copied from class:PostProcessorEffectConcrete objects shall implement its own rendering, given the source and destination buffers.- Specified by:
renderin classPostProcessorEffect
-
setViewportSize
public void setViewportSize(int width, int height) -
rebind
public void rebind()Description copied from class:PostProcessorEffectConcrete objects shall be responsible to recreate or rebind its own resources whenever its needed, usually when the OpenGL context is lost. E.g., frame buffer textures should be updated and shader parameters should be re-uploaded/rebound.- Specified by:
rebindin classPostProcessorEffect
-