Provide real world time data to shaders
tracked
Neitri
It would be nice if VRChat updated shader uniforms every frame with real world time data.
That way we could create real world time huds, clock or watches on both avatars and worlds.
VRChat could use this code to implement it: https://pastebin.com/raw/i0gyuCxc
One could then use this https://www.dropbox.com/s/edjaozd0x8q2msc/watch.zip and simply change _Time.y to _VRChat_Local_SecondsToday_DayOfYear_DayOfWeek.x
If this was implemented, community could then themselves complete the following feature requests:
Log In
Scout - VRChat Head of Quality Assurance
tracked
indominablerexx
Although it is still currently possible to pass in the time yourself through Material.SetFloat and so on. Every frame? You can do it in Update(). If they release Shader functions later too, you can implement that SetGlobalFloat code yourself as well (switch MonoBehavior to UdonBehavior). I'm not quite sure yet if they actually exposed any time code yet; if not, that's really the only thing they'd have to do at this point. Expose time data to scripts, and people can pass that data to their shaders themselves (as I said, passing that data to a shader is already possible, as long as we have that data to pass)
I believe a better title for this post would be:
Expose Shader methods, and expose date time data to scripts
digiponta
I need the api getting datetime of a local PC clock, for a shader, too.
StormiTheAvali
that would be sooo helpful
F
Fæ
I would really enjoy this or something like it. I've searched around the official discord, read some of the conversations on the topic of clocks and time in the Metaverse so far, and the desire for this functionality in one form or another seems obvious enough to me.
Web Panels were a great way to deliver this functionality, and then some, but unfortunately they were insecure and may never be secure in the scope of VR Chat, in my mildly-educated opinion.
This seems like a much easier way to secure the desired functionality of real-time clocks in worlds and on avatars.
Mute
Small detail; but something that could be nice to have on avatars
Lil Fluff
Yes. Pleaseeeee.
Neitri
- Having UTC seconds today would allow shader makers synchronize effects so everyone sees roughly the same thing
- Having clock on your VR wrist is more immersive
- Opening SteamVR dashboard to check time can cause FPS drops for next few minutes
ᴋᴀᴡᴀ
ultimate agree
hakanai
My own clocks currently want a way to choose the time zone too. The plugin could have one more parameter for the zone to use, and then it would just change the values provided for Local.
(Maybe straight-forward, but I'd be slightly concerned about whether .NET time zone stuff works, given how much they screwed up other things, like character encoding.)
Neitri
hakanai: The script is meant as something VRChat client it self would instantiate, it would be shared across all shaders. The idea is that all work that's needed of VRChat dev is to copy paste that script and use it once.
If you wanted time zones you could use the UTC data and add int _TimeZone property to your shader that would be added to hours.
In your shaders you would add and use these uniforms:
int _VRChat_Local_UnixTimestamp;
float4 _VRChat_Local_Year_Month_Day;
float4 _VRChat_Local_Hour_Minute_Second_Millisecond;
float4 _VRChat_Local_SecondsToday_DayOfYear_DayOfWeek;
int _VRChat_Utc_UnixTimestamp;
float4 _VRChat_Utc_Year_Month_Day;
float4 _VRChat_Utc_Hour_Minute_Second_Millisecond;
float4 _VRChat_Utc_SecondsToday_DayOfYear_DayOfWeek;
hakanai
Neitri: daylight savings actually makes it a little challenging to implement time zones in a shader. I did try, though.
Load More
→