Jump to content

Day and Night Cycle shader

Recommended Posts

Is there a way to have this work when there is constant camera switching?

Whenever our player switches from first to third person, or vise versa, or changes camera for cutscenes, it crashes the game with the newest version of the script.

It only does it during a camera switch (we call to destroy our current camera and create a new one)

Link to post

Could you not camera switch and instead just snap the camera to the pos/rot it needs to be?

Link to post
On 8/6/2014 at 11:02 PM, shadmar said:

Wasn't sure where to put this since I can't get it to work in the workshop since it needs a big controlscript.





Anyway here it is :



  • Preetham skymodel is used (look up on wikipedia)
  • UnCharted2 tonemap
  • Procedural stars at night
  • Procedural Clouds.
  • Alot of adjustables



  • Download at bottom of page here
  • Unzip straight into the projects root folder



  • Drag the Sun prefab from the prefab folder
  • You can adjust all sorts of stuff in the script tab of the Sun object
  • It will adjust to the rotation of the Sun (which is a directionallight) when you run (F5/6)
  • Works very well with bloomsettings : luminance=0.11 midgray=0.158 whitecutoff=0.298
  • Added one small example map as well in the maps folder.


Update :

  • Fixed the ATI issue, thanks TattieBoJangle
  • Fixed the cloudscale issue, thanks HaydenMango
  • Skydome now follows the camera (if found)
  • Skydome resizes to the camera's drawdistance (if found)
  • Added adjustable bloom settings (if workshop the bloom is added the scene)


Edit: soon inthe workshop.


Where can I download?

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...