Install Asset
Install via Godot
To maintain one source of truth, Godot Asset Library is just a mirror of the old asset library so you can download directly on Godot via the integrated asset library browser

Quick Information

Do you need to find the total amount of light reaching a point in your Godot 4 3D project? Then this asset is for you.This asset uses a real viewport and camera to determine how much light is reaching a (tiny) plane contained in the sensor, which means we're using "real" light calculations to measure light and not, say, raycasting to all lights within a sphere. The main drawback is it's expensive, so it's not something you want to update every frame.See the README for lots more details.
# Godot Light Sensor 3D
Do you need to find the total amount of light reaching a point in your Godot 4 3D project? Then you've come to the right place.
This asset contains a "light sensor" -- a tiny camera pointing at a tiny white plane that can be queried to determine how much light is reaching that plane. You can check the color, too, if you care about that.
How to Use
- Create a new node of type LightSensor3D.
- Move it to the point you want to measure light.
- Configure the layer.
- Call the refresh() method on it periodically, e.g. every second.
- Query it using the available properties, functions, and signals.
Positioning and Orientation
The sensor is not a single point in space, capable of reading detecting light in a sphere. It's a plane, which means a couple things:
- You'll probably want to place the sensor low to the ground of your game.
- You'll probably want to orient the sensor so the sensor is pointing downwards (this is the default).
These suggestions are assuming you're measuring the amount of light some point on the ground is receiving.
Configuring the Layer
The internal sensor mesh uses the layer you configure on the light sensor itself. You'll want to choose layer(s) based on the following principles:
- The layer shouldn't be visible to your main camera, otherwise you'll see a small white plane near the center of the sensor.
- The layer should be visible to the lights you want to register on the light sensor, otherwise you won't get the desired readings.
Calling the refresh()
Method
Refreshing the sensor's state is pretty expensive, since it requires downloading data from the GPU back to the CPU (see Texture2D#get_image). In my tests, it takes on the order of 0.2ms, which is potentially a big chunk of the frame budget if you have multiple sensors updating every frame. Therefore, it's recommended to only update as often as you need -- once every 250ms or even less often.
Calling refresh()
is left up to you. The easiest way to do this is to add a child node of the LightSensor3D of type Timer that:
- has a wait time of 1 second, or whatever your update frequency need is.
- does not have one-shot enabled.
- does have autostart enabled.
- and lastly and most importantly, triggers the parent node's
refresh()
method in thetimeout
signal.
There's an included example scene that does this that you can also check out.
Outputs
name | type | description | |||
---|---|---|---|---|---|
property | color |
Color | This is the current color the sensor is seeing. | ||
property | light_level |
float | This is the luminance seen by the sensor. 0=dark, 1=bright. | ||
signal | color_updated | (color: Color) | Emitted when the current color changes. | ||
signal | light_level_updated | (luminance: float) | Emitted when the light level changes. | ||
Note that all of these require you to call refresh() before they'll be updated and triggered. |
Do you need to find the total amount of light reaching a point in your Godot 4 3D project? Then this asset is for you.
This asset uses a real viewport and camera to determine how much light is reaching a (tiny) plane contained in the sensor, which means we're using "real" light calculations to measure light and not, say, raycasting to all lights within a sphere. The main drawback is it's expensive, so it's not something you want to update every frame.
See the README for lots more details.
Reviews
Quick Information

Do you need to find the total amount of light reaching a point in your Godot 4 3D project? Then this asset is for you.This asset uses a real viewport and camera to determine how much light is reaching a (tiny) plane contained in the sensor, which means we're using "real" light calculations to measure light and not, say, raycasting to all lights within a sphere. The main drawback is it's expensive, so it's not something you want to update every frame.See the README for lots more details.