#Help Create a Formula for In-Game Brightness

15 messages · Page 1 of 1 (latest)

vivid shard
#

Hello, I am making a day & night cycle and I want to create dynamic brightness for the game. I want the brightness to be effected by: cloud density, cloud cover, & in-game clock-time. This is what I have so far but this was really just test code.

local Clouds = workspace.Terrain:FindFirstChild("Clouds")

while true do
    task.wait(.1)
    local CloudsReflectance = (math.sqrt(Clouds.Cover) * math.sqrt(Clouds.Density)) % 20
    
    local formula = CloudsReflectance
    game.Lighting.Brightness = formula * game.Lighting.ClockTime
end
spark spear
#

ok, it'll be affected by these

#

but how exactly?

#

do you want it darker or brighter based on each one?

#

and i wouldn't make a while true for that

#

maybe use Heartbeat

vivid shard
#

This was test code just to see the behavior live

#

Brightness of the game will be factored by cloud density, cover, etc.

spark spear
spark spear
#

ok it will be factored by these things

#

but how? which ones will make it darker and brighter? and in what intensity

vivid shard
#

I feel that was obvious, They all will change to make it darker or lighter depending on the number

#

So higher the density or cover, the lower the brightness