DirectionalLight3D

package
v0.0.0-...-0d6c339 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

A directional light is a type of graphics.gd/classdb/Light3D node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene to model sunlight or moonlight.

Light is emitted in the -Z direction of the node's global basis. For an unrotated light, this means that the light is emitted forwards, illuminating the front side of a 3D model (see [Vector3.Forward] and [Vector3.ModelFront]). The position of the node is ignored; only the basis is used to determine light direction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsDirectionalLight3D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsDirectionalLight3D

func (self *Extension[T]) AsDirectionalLight3D() Instance

func (*Extension[T]) AsLight3D

func (self *Extension[T]) AsLight3D() Light3D.Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode3D

func (self *Extension[T]) AsNode3D() Node3D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsVisualInstance3D

func (self *Extension[T]) AsVisualInstance3D() VisualInstance3D.Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.DirectionalLight3D

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsDirectionalLight3D

func (self Instance) AsDirectionalLight3D() Instance

func (Instance) AsLight3D

func (self Instance) AsLight3D() Light3D.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsVisualInstance3D

func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance

func (Instance) DirectionalShadowBlendSplits

func (self Instance) DirectionalShadowBlendSplits() bool

func (Instance) DirectionalShadowMode

func (self Instance) DirectionalShadowMode() ShadowMode

func (Instance) ID

func (self Instance) ID() ID

func (Instance) SetDirectionalShadowBlendSplits

func (self Instance) SetDirectionalShadowBlendSplits(value bool)

func (Instance) SetDirectionalShadowMode

func (self Instance) SetDirectionalShadowMode(value ShadowMode)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetSkyMode

func (self Instance) SetSkyMode(value SkyMode)

func (Instance) SkyMode

func (self Instance) SkyMode() SkyMode

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type ShadowMode

type ShadowMode int //gd:DirectionalLight3D.ShadowMode
const (
	// Renders the entire scene's shadow map from an orthogonal point of view. This is the fastest directional shadow mode. May result in blurrier shadows on close objects.
	ShadowOrthogonal ShadowMode = 0
	// Splits the view frustum in 2 areas, each with its own shadow map. This shadow mode is a compromise between [ShadowOrthogonal] and [ShadowParallel4Splits] in terms of performance.
	ShadowParallel2Splits ShadowMode = 1
	// Splits the view frustum in 4 areas, each with its own shadow map. This is the slowest directional shadow mode.
	ShadowParallel4Splits ShadowMode = 2
)

type SkyMode

type SkyMode int //gd:DirectionalLight3D.SkyMode
const (
	// Makes the light visible in both scene lighting and sky rendering.
	SkyModeLightAndSky SkyMode = 0
	// Makes the light visible in scene lighting only (including direct lighting and global illumination). When using this mode, the light will not be visible from sky shaders.
	SkyModeLightOnly SkyMode = 1
	// Makes the light visible to sky shaders only. When using this mode the light will not cast light into the scene (either through direct lighting or through global illumination), but can be accessed through sky shaders. This can be useful, for example, when you want to control sky effects without illuminating the scene (during a night cycle, for example).
	SkyModeSkyOnly SkyMode = 2
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL