Does anybody know how to create a brightness setting for a 3d game? I looked all over the place and only found an outdated 2D tutorial and other such videos. I might have missed something, though. I thought that having my world environments all in a group and then changing the brightness with code would work, but no luck.
WorldEnvironment does not have an “adjustment_brightness” property. It’s on the Environment resource. I think you will need to use call_group() instead, or a for loop.
for most cases, in WorldEnvironment:Environment, you change the tonemap. each tonemap has different settings.
the most common is exposure, which can make the scene brighter.
you also have exposure in a camera setting. you can add this to a camera or to the worldenvironment node, and it can be flat exposure or automatic, in which case it will adjust to the scene.
the way to change this from settings is to obtain a reference to the worldenvironment node and change it.
if you want to automate it, a way would be to use an autoload to store the value of exposure, then add a script to worldenvironment, and change the value based on whats on the autoload. you can also connect a signal from the autoload to change the values on the worldenvironment.
autoload options.gd
signal exposure_changed(value : float)
var exposure : float = 1.0