It looks like you're using an ad blocker! I really need the income to keep this site running.
If you enjoy BlenderNation and you think it’s a valuable resource to the Blender community, please take a moment to read how you can support BlenderNation.

How to Create a Realistic Sky and Sun Casting Shadows in Cycles

Learn how to create a realistic sky in this videotutorial by Peter Drakulić.

Peter writes:

Hi
This is a video tutorial showing how you can create a realistic,real time adjustable sky with clouds,as well as Sun and sunlight with shadows casting using compositing.

Overview:

  • 00:00 to 02:15 : introduction/overview
  • 02:16 to 08:30 : enhancing the default background shader/sky texture using nodes
  • 08:31 to 19:23 : making the clouds / setting up the clouds layer
  • 19:24 to 33:20 : making the sun light and shadows using compositing

http://www.youtube.com/watch?v=BaJp-RfcElw

19 Comments

  1. Hi Gottfried,thank you for your so well aimed comment!Let me assure you that I have learned,me too,quite many tips'n'tricks by watching >>> your great tutorials that have greatly helped me in many cases!.Just keep them coming! :)
    now,as for the sun/directional light functionality currently found in Cycles  : at least in my tests,and using the 2.61.0 (42615 revision) the traditional Sun lamp seems to be translated into a sort of a non-directional light source,which is more reminiscent of a Point lamp,as one can easily say by jut watching the cast shadows.
    What is even more amazing >>> when I change the type to a HEMI lamp,this one  seems to have the behavior of a Directional light source,although in the Blender Internal this would provide light coming from a 180 degrees hemisphere (simulating,let's say,an overcast uniform sky) as we all know!!!So,yes,perhaps this could be an easy way to simulate a Directional light > by using the Blender Internal's Hemi light!Please correct me if I am wrong!BUT...
    since,at its current stage of development,Cycles doesn't support yet render passes and/or an option for adjusting the softness of the shadows (we all know that sun's shadows can be "harder" or "softer" depending on the amount of clouds and the light diffuse occurring when the sunlight penetrates those clouds) using a combined compositing technique ,like the one I describe in my tutorial,seems to be a handy solution.
    Of course,please bear in mind,that this technique can be greatly improved ( just an idea : try to connect a Blur filter node just after the Shadows pass and adjust it so that you can interactively alter the "softness" of the shadows).For simplicity's(and time's) sake I didn't mention the need for using ,for example, a "Separate RGBA" convertor node,just after the "SkyDome" Render Layer's image/color output socket,so that we could take advantage of the Red channel greyscale information or,even better,of the  difference (Convertor > Math > Subtract)  between the Blue and the Red channels (which ,in compositing terminology,is called "Density") for providing a more exact greyscale map that we would,then,use as a "Fac" input for controlling,let's say,the blending of the Emission with Diffuse shaders...and many many more...this was just a brief outline and a rather "rough" technique (given the limits of a video tutorial)
    also,it is more possible than not,this technique to become outdated,once a Render Layers functionality is added to Cycles.

    So,once again,I thank you for your so well aimed comment and for giving me the chance to say a few more things about this tutorial!
    I wish to you ,and to all my friends here aHappy (and most creative and productive!) New Year! Peter 

    • Guest is right - here is a demo file: http://www.pasteall.org/blend/10546

      It contains a sun animated from harsh to soft to harsh shadows. It's also randomly moving on the Z-axis without altering the shadows at all.

      Of course your technique is alot more versatile, but if someone just wants a sun lamp then it works as well as the sun lamp in Blender internal did.

      Cycles r42438

      • thank you Gottfried for your well documented response..Yes,you are right about the directional light,but as I've just explained to Guest,it would be rather of a limited use in a real world scenario ( I'm sure,judging from your tutorials,your level of experience allows you to be well aware of the fact...)
        I made this tutorial because professional experience has taught me,that it is WAY MORE IMPORTANT to being able to COMPOSE the elements (shadows and lights included) into the final scene than to being given just a slider to play with.Just scrubbing that slider (with no further usability) and being happy for being given a button for "instant" shadows,I'm sorry to say,this would be the perfect toy for an amateur,not for the serious user,to say the least.
        And,for the moment,such a functionality cannot be found in Cycles (and it's okay with that,...just look at how awesome things Cycles developers have provided us with,already from that early!...)
        So,my tutorial was intended to be more of an introduction to the available functionality for some tasks a bit more demanding than offering the joy of discovering the secret of "click'n'render" to some new users...
        Thank you for your well aimed comment,once more,Peter

  2. The sun in cycles is perfectly capable of making hard shadows, you have to adjust the size option to something low (0 -> 0,1)
    The hemi light works as the sun (it actually says "Not supported, interpreted as sun lamp", if you cared to read)

    Please don't make this harder for yourself than it is.

    • thanks for commenting Guest.I just make this more flexible for many of us who just want to go a step beyond than just entering a number in a box.Being creative,this was always a good thing...wanna try?...:)  

    • btw,IF you cared to read this is a tutorial aiming to take advantage of the Render Passes awesome functionality which is still unavailable in Cycles...now if all you needed was to adjust a directional light,then,perhaps,this might not be the right tutorial for you...you can always keep searching in the Wiki though...  

        • oh,you just sounded like if your ideals were attacked and hurt by a mysterious and superior authority :)
          of course this was not the case and I,personally,enjoyed talking with
          you,as well as most of the viewers of this page I suppose...:-)
          the piece of info you shared with us was really useful,so,we all thank you for your contribution,I guess!
          so,why should you regret really?
          hope you are now feeling better?...back to earth again?...:-)
          Good day to you too  :)

  3. oh,you just sounded like if your ideals were attacked and hurt by a mysterious and superior authority :)
    of course this was not the case and I,personally,enjoyed talking with you,as well as most of the viewers of this page I suppose...:-)
    the piece of info you shared with us was really useful,so,we all thank you for your contribution,I guess!
    so,why should you regret really?
    hope you are now feeling better?...back to earth again?...:-)
    Good day to you too  :)   

  4.  Very nice to see the knowledge being shared, I look forward to using some of this once I get time to experiment in the new year...

  5. Peter, thanks for this tutorial. I was simulating directional light in cycles by making a small plane, moving it far off and pumping up the power. It works okay, but takes tens of thousands of cycles to render cleanly. I suppose this is because only a small number of the rays being traced from the source are striking the scene in the camera's view. I'm trying to figure out if I can use light paths to limit the sampling of the emitted rays from the distant source.

  6. Great way of creating shadows! Lots of fine tweaking can be done with this method.

    The bug you mentioned when creating the BI full copy and not linked objects, has it been fixed yet? I want to use this in a current project and I do not know wether to do full copy of linked objects.

    Thanks.

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Share this story: