Jump to content

Day and Night Cycle shader


shadmar
 Share

Recommended Posts

Updated:

 

*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)

  • Upvote 4

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

  • 4 months later...
  • 2 weeks later...
  • 2 months later...

Yes there is, you can't find the material editor in Leadwerks? I don't understand, if that is the case just right click the material choose edit, or doubleclick the material, or find the mat file and edit it using notepad or vi.

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

  • 5 months later...

Does anybody know how to tweak the cloud direction? THey are coming towards and right to left in my standard setup and I really want them to come left to right ( and probably towards a little bit).

 

I see how you can change the way the sky moves and the speed but the clouds themselves seem separate and I'd like to control them so they match the way I'm making the wind blow in the level (puffs of dust etc.). It seems a bit odd when the sky doesn't match the direction the ground wind seems to be blowwing.

 

I COULD change my level so my wind effects match the the sky but matching the SKY to the LEVEL seems the logical way to me.

 

I've had a look through the related lua and shader files and tried changing various values (guessing incorrectly every time) and I've never worked out which one I need to change.

 

SO, anybody worked out how to change the cloud direction?

Link to comment
Share on other sites

This generates clouds in the DayNight.shader

if you change ctime to -ctime they go the opposite way.

 

vec3 cloud2(float cloudheight,float scale)
{
   vec2 p=vec2(vp.zx/(vp.y))*cloudheight;
   vec3 c = vec3(.0, .0, .2);
   c.rgb += vec3(.6, .6, .8) * cloud(p*.3+ctime*.0002,scale)*.5;
   c.gbr += vec3(.8, .8, 1.) * cloud(p*.2+ctime*.0002,scale)*.1;
   c.grb += vec3(1., 1., 1.) * cloud(p*.1+ctime*.0002,scale)*1.;
   return c.rrr;
}

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

Thanks Shadmar. I'd tried changing some of the other values in that section before, but not ctime. It goes right to left now and away from me which is better. I wish I could make it go any way I'd choose which after some more fiddling I've not sorted, but it's great that it now better matches the way I'd setup the level.

 

This is a fantastic shader and prefab/map. Not sure why it isn't yet visible in the public workshop section on Steam. Maybe waiting for possible changes to the how the workshop will operate?

 

Many many thanks for your stellar work Shadmar!

Link to comment
Share on other sites

  • 11 months later...

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 it i know it says at the bottom of the page but i do not see it?

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