Jump to content
shadmar

Day and Night Cycle shader

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)

Share this post


Link to post

Thanks Jorn, maybe one day. smile.png

 

This will be a workshop item only very soon, and I will remove the links to the "standalone" one.

The new version have some improvements.

Share this post


Link to post

Thanks a lot. I can't find where you edit the .mat file. for the muzzle flash problem.

The topic you redirect to is locked so I can't ask there. Looks like from your image its being edited in LW but I can't find it.

Thanks again.

Share this post


Link to post

Sorry I wasn't more clear and thank you very much for answering! I meant to say I can't find in LeadWerks where to

edit the .mat file. Is there a material editor in LW? From the screen shot it looks like its edited in LW, thanks.

Share this post


Link to post

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.

Share this post


Link to post

Thank you kindly for completely answering my question. I was looking for it in the menu systems.

 

If only I could ask you a 100 more...

 

Also thank you for letting us use the script.

 

CB

Share this post


Link to post

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?

Share this post


Link to post

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;
}

Share this post


Link to post

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!

Share this post


Link to post

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?

Share this post


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.

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.

×
×
  • Create New...