Hello everyone !
I am trying to implement a day/night cycle in my game : I already figured out how to make my directional light rotate depending on a float variable. But only rotating the directional light doesn’t sell the effect of night/day as much as i’d like (I want a very dark night).
I noticed that lowering the exposure setting (set to manual) in my post process volume in addition to rotating the directional light makes it really the way I want during the night; but then it is way too dark during the day.
So I came up with this node setup to link the exposure compensation to the Y value of my directional light, so that exposure compensation changes depending on the Y rotation value and better follows night and day feels.
but it only partly works : the exposure compensation in game is driven by my node setup from the level blueprint (if I try to change exposure compensation in my details panel it doesnt affect it) so I guess that works.
However the exposure isn’t updating depending on the y value : I checked in game the y value limits of my directional light and it goes from 90 (night) to -90 (night from the next day : so 45 to - 45 is day). so I mapped those values to 4 to 9 exposure compensation which are the values I need (4 for night and 9 for day). but the exposure still doesnt update.
One thing I noticed is that the exposure compensation in game is set to the last value I put in “map range unclamped”–> “out range A / B” before compiling : for example : I set “out range A” to 6 then I set “out range B” to 25 and I compile and play the game, the exposure will be set to 25. If I go back to the blueprint and I set “out range B” to 1, then compile and play the game, the exposure will be set to 1.
Any idea on why the exposure doesnt change relating to Y directional light rotation value?
thanks a lot for your help and have a great day !