Jump to content

Day and Night Cycle shader


shadmar
 Share

Recommended Posts

  • 1 month later...
  • 1 month later...
  • 1 year later...

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 comment
Share on other sites

  • 2 years later...
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.

 

sunset.JPG

 

 

Anyway here it is :

 

General

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

 

Install

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

 

Use

  • 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 comment
Share on other sites

  • 2 years later...

Not knowing what to do worked out something.....

Added 'daynight.lua' to the Directional Light (no such prefab exists for me as the instructions say...?)

And added '08 pp_bloom+godrays.lua' into the Root / Post Effects box.....

I'm now getting day/night cycle for the directional light but cant see any sun object moving across the screen....?

I turned off Follow Camera as was having a problem running with this....

Also the skybox doest change colors - or do I need a sky sphere...and where to get that ?

 

Any suggestions ?

Thanks.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
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.

 Share

×
×
  • Create New...