Day Night Cycle UdonSharp (VRChat Prefab)
This is a fork of a prefab by Nova_max
https://github.com/tommaier123/UdonSharpDayNightController
https://github.com/Iconoclass/UdonSharpDayNightController
IMPORT THE FOLLOWING TO USE THIS PREFAB:
VRCHAT SDK3 WORLD https://vrchat.com/home/download
UDON SHARP https://github.com/MerlinVR/UdonSharp/releases
BFW SIMPLE DYNAMIC CLOUDS https://assetstore.unity.com/packages/tools/particles-effects/bfw-simple-dynamic-clouds-85665
I added a UI prefab, a custom reflection probe and the option to toggle sun shadows on and off. I added headers and tooltips to the script. I also commented out parts of the script specific to Nova_Max's world.
Serene Seaside: https://vrchat.com/home/launch?worldId=wrld_8b709af3-4e49-4dec-9cbb-132b2234fe7f (My world featuring the day night cycle)
From the original readme:
Day Night Cycle Island
https://vrchat.com/home/world/wrld_6c4f1572-a918-4e6d-b383-6b056111768f
Features:
Day night cycle
Global time syncing
Performance optimized real time lighting and shadows
Quest support
Time of day and speed controls (accessible by everyone)
Performance options
Mirror
Seats
Custom water shader
Moving grass and trees
Audio dynamically changes with time of day
Campfire lights dring the night
Leaf particles
Procedural Clouds
Procedural Stars
My goal was to create a comfy place to hang out with the additional feature of the day night cycle to make the world feal more immersive. I wanted everyone to be able to have fun with the day night cycle so I made the controls accessible for every player and not just the master. On the other hand the time of day and cycle speed are synced globally so everyone can enjoy the sunset at the same time or watch the stars together. I spent a lot of time optimizing the lighting and shadows so the world is able to run on all systems including quest. For that reason I was able to simplify the menu by removing most performance settings. The only settings that are still in the menu are for controlling the cycle and to toggle some of the visuals and background music.
Assets/Tools used:
Udon Sharp
Amplify Shader Editor
Unity Default Skybox
BFW Simple Dynamic Clouds
Stylized Forest Environment
You can download the day night cycle controller script here. It will definitely work with the default skybox and should also work with any procedural skybox.
<iframe width="560" height="315" src="https://www.youtube.com/embed/1Z6Rn9kwy_A" frameborder="0" allowfullscreen sandbox="allow-scripts allow-same-origin allow-popups allow-presentation"></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/-ykHCa4ueFw" frameborder="0" allowfullscreen sandbox="allow-scripts allow-same-origin allow-popups allow-presentation"></iframe>
<iframe width="560" height="315" src="https://www.youtube.com/embed/hRjFOVZbyNs" frameborder="0" allowfullscreen sandbox="allow-scripts allow-same-origin allow-popups allow-presentation"></iframe>
Read the readme and/or watch the setup tutorial.