Shadertoys screensaver: clock displays wrong time

Hi,

I love shadertoys as a visualization, and use a random screensaver. I noticed that on my (German) time settings, the analog clock screensaver displays the time one hour early (i.e. it is 5 pm here, and the shadertoys clock shows 4 pm).

Is that a known bug? Which time is used for the visualization? OSMC itself displays the right time of course.

Possibly daylight saving time related?

Yes, that was exactly my thought, but why does this happen? Why does shadertoy not use the time displayed by Kodi?

If you ssh in to OSMC and run “date” what time does it report?

osmc@osmc2:~$ date
Sun Apr 24 10:54:04 CEST 2016

Shadertoys displays 09:54

Hmmm. Shadertoy calls “localtime” which should get the correct timezone.
Can you try:

wget https://dl.dropboxusercontent.com/u/3669512/temp/localtime
chmod +x localtime
./localtime

and report what it returns?

I have noticed that the hour…ehm dial(?) is not really in the correct place it is almost as if it is one hour behind, if you know what I mean… :slight_smile:

localtime reportes the correct time. I will take a closer look, maybe it’s just a problem drawing the clock dial correctly, but it definitely looks to me as if it wants to display an hour earlier.

Edit: I just looked at it closely, and it seems that the hour-finger only moves at full hours, which is definitely not what a “real” analog clock does. It shouldn’t be too hard to move that little finger by 30/60 = 0.5 degree per minute, is it? :wink:

I just caught this. It was 6:55pm and the clock looked like five to six.
At 7:05pm the clock looked like 7:05pm.

So I don’t think it is time zone related - just how that particular shader rounds the hours.
I seem to recall there was an option (in the code) for the second hand to be discrete or continuous.
I suspect the continuous form wouldn’t have this issue. I’ll look into it.

Edit - yes, avoiding the truncation on hours improves the behaviour.
Will push an update soon.

Can you tell me if I can try and upgrade it? Or is it automatically updated?

If you know what you are doing, then:

float hors = mod( floor(iDate.w/3600.0), 24.0 );

Remove the “floor” word. Otherwise wait and it will auto update when I next push.

Is this okay now? I pushed an update a few days back.

1 Like

How can you get the Update? Same Problem, isnt it automatically updated with osmc updates?

Should update automatically. Latest version is 1.0.10.
You can also force a check for updates: http://kodi.wiki/view/add-on_manager#Update_options

So this is fixed now? - YouTube
The hour dial should gradually move towards next hour mark!

Yes, that issue is fixed on 1.0.10.

Awsome!