ShadowMap looks choppy when changing TimeOfDay

My game increases the in-game time by 0.0625 minutes every 0.125 seconds.
This is how it appears in game:

Does anyone know how to stop it looking choppy?

Thanks in advance.

1 Like

Smooth dynamic change of lighting is impossible at the moment. I have tested it and the results are choppy shadows. Therefore, I advice chunky change in lighting instead of smooth transitions.

2 Likes

Doing that still ends up with a choppy change, just infrequently. I’m not sure how I’m meant to smooth this.

As aforementioned, you can’t have it smooth. I believe I found some previous post in the ShadowMap announcements. The choppiness was first experienced when I was testing it using my day/night cycle script.

Try a fast loop that changes the TimeOfDay subtly and fast.

Can’t you just tween the ClockTime?

local Lighting = game:GetService"Lighting"
local TweenService = game:GetService"TweenService"
TweenService:Create(Lighting,TweenInfo.new(24--[[adjust the time]],Enum.EasingStyle.Linear,Enum.EasingDirection.Out,math.huge,true,0),{
    ClockTime = 24
})

If you do want to use a loop,

local Lighting = game:GetService"Lighting"
local RunService = game:GetService"RunService"
while true do
    Lighting.ClockTime = Lighting.ClockTime + RunService.Heartbeat:Wait()/25
end

Doesn’t work as well with ShadowMap, there will be choppiness in shadows.

Yes, this is an alternative.

1 Like

Maybe try doing something like this:

3 Likes

Unsure on how you would do that.

If you’re still in need of a way to do this, I made a decent way of doing this.

while true do
    wait(10) -- Or whatever time, I used this for testing purposes.
	for i = 1,100 do
		local Time = game.Lighting
		Time.ClockTime = Time.ClockTime + .01
		wait(.01)
	end
end

My solution was to just use TweenService and tween ClockTime. Works amazingly smooth.

You could use tweening for this. I did it in my new story game: https://www.roblox.com/games/3877692711/resort-gametest1