Class DirectionalLightRenderer
java.lang.Object
foundry.veil.impl.client.render.light.DirectionalLightRenderer
- All Implemented Interfaces:
LightTypeRenderer<DirectionalLightData>
,AutoCloseable
,org.lwjgl.system.NativeResource
@Internal
public class DirectionalLightRenderer
extends Object
implements LightTypeRenderer<DirectionalLightData>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLight
(DirectionalLightData light) Adds the specified light to the renderer.void
free()
Collection
<? extends LightRenderHandle<DirectionalLightData>> int
void
prepareLights
(LightRenderer lightRenderer, CullFrustum frustum) Prepares the light renderer.void
renderLights
(LightRenderer lightRenderer) Renders all prepared lights with this renderer.steal
(LightRenderHandle<DirectionalLightData> handle) Attempts to re-add the specified handle to this renderer if invalid.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
Constructor Details
-
DirectionalLightRenderer
public DirectionalLightRenderer()
-
-
Method Details
-
addLight
Description copied from interface:LightTypeRenderer
Adds the specified light to the renderer.- Specified by:
addLight
in interfaceLightTypeRenderer<DirectionalLightData>
- Parameters:
light
- The light to add- Returns:
- A handle to the light in the renderer
-
steal
public LightRenderHandle<DirectionalLightData> steal(LightRenderHandle<DirectionalLightData> handle) Description copied from interface:LightTypeRenderer
Attempts to re-add the specified handle to this renderer if invalid.- Specified by:
steal
in interfaceLightTypeRenderer<DirectionalLightData>
- Parameters:
handle
- The handle to add- Returns:
- A valid handle to this renderer
-
prepareLights
Description copied from interface:LightTypeRenderer
Prepares the light renderer.- Specified by:
prepareLights
in interfaceLightTypeRenderer<DirectionalLightData>
- Parameters:
lightRenderer
- The light renderer instancefrustum
- The culling view frustum
-
renderLights
Description copied from interface:LightTypeRenderer
Renders all prepared lights with this renderer.
Shaders, custom uniforms, and the way lights are rendered is up to the individual renderer.- Specified by:
renderLights
in interfaceLightTypeRenderer<DirectionalLightData>
- Parameters:
lightRenderer
- The light renderer instance
-
getLights
- Specified by:
getLights
in interfaceLightTypeRenderer<DirectionalLightData>
- Returns:
- A view of all lights in this renderer
-
getVisibleLights
public int getVisibleLights()- Specified by:
getVisibleLights
in interfaceLightTypeRenderer<DirectionalLightData>
- Returns:
- The number of lights visible last frame
-
free
public void free()- Specified by:
free
in interfaceorg.lwjgl.system.NativeResource
-