envSky

Embed Size (px)

Citation preview

  • 8/8/2019 envSky

    1/19

    HOW TO CREATE A REALISTICSKY WITH THE ENVSKY TEXTURE

    By S. Christov

    Maya CompleteRendering

    The environment skyis a powerfulprocedural texturethat you can quicklyand easily add toyour scene to givethe appearance of asky overhead.

    In this first part of a three part lesson you will learn howto create an environment sky and set attributes that willcreate a realistic looking sky.

    In the next lesson - How to create realistic shadowsusing envSky - you will learn how to achieve realisticshadows using the position of the sun on the envSkytexture. In the final lesson you will learn how to "grow" atree in Paint Effects from a simple black brush stroke -How to create a tree using Paint Effects.

    After these three lessons, you will be able to combinethese elements to produce an animation similar to theone above where you create a time lapse animation of asunset.

    Play Movie [~800k]

    You will first need tocreate a new camera

    and then attach animage plane to it.

    Createa new cameraby selecting Create >Camera.

    Translate the camera 2 units in theY axis and 6in the Z axis.

    STEP ONE

    Page 1 of 7

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt1.htm

  • 8/8/2019 envSky

    2/19

    Open the Attribute Editor for the new camera, andopen the Environmentsection. Click on theCreate button next to Image Plane. The AttributeEditor window will now switch to the AttributeEditor for the Image Plane.

    Open the Placementsection and click on Fit toResolution Gate.This will ensure that your image

    plane will fill the entire rendered scene.

    While you are still inthe Attribute Editorfor the Image Plane,Click on the Map

    button next to

    Texture and map anenvSky.

    The envSkynode islocated in theEnvironmentTextures section ofthe Create RenderNode window.

    STEP TWO

    You will now set thecolors for yourenvironment. In theAttribute Editor forthe envSky, Set thefollowing attributes:

    SunBrightness to1, 1, 0.5

    Halo Brightness to 0.35, 0.36, 0.5 UnderAtmospheric Settings, Set the Sky

    Brightness to 0.56, 0.617, 1.0

    To change any of the color values, select the color iconnext to the attribute. This will open the Color Chooser.

    STEP THREE

    Page 2 of 7

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt1.htm

  • 8/8/2019 envSky

    3/19

    Make sure you are using the RGB values by checkingthe RGB box near the bottom of the window. You canthen type the values in manually.

    NOTE: To open the Attribute Editor for the envSky,select the 3D Icon for the envSky texture and open theAttribute Editor. Click the Goto Output Selection

    Button at the top right side. This will take you tothe envSky Attribute Editor.

    Open the FloorAttributes section forthe envSky, Map thecolor of the floor to a

    2D Fractal texture.

    Change the ColorGain to a DarkGreen and the ColorOffset to a DarkBrown. This will beyour floor.

    Select Camera 1andSelect > Panels >

    Look ThroughSelected. Turn onthe Resolution Gateby selecting View > Camera Settings > ResolutionGate.

    Renderthis view by selecting Render > Render intoNew Window.

    STEP FOUR

    When you renderwith the floor turnedon, you mayencounter a brightred surface for partof the floor. This isdue to the fact thatyour camera isrendering a point that is below the Floor Altitude. You

    STEP FIVE

    Page 3 of 7

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt1.htm

  • 8/8/2019 envSky

    4/19

    can fix this by either lowering the Floor Altitude, raisingthe look at point of the camera, or scaling the 3D icon.In this case we are going to scale the icon.

    Select the envSky icon in the perspective viewwindow. In the Channel Box set the Scale X Y Z to 5.

    Re-Renderyourscene. You shouldnow have a floorthat extends to avanishing point.

    You are now readyto add clouds to thescene. Open theCloud Attributessection in theAttribute Editor forthe envSky. Click the box next to Use Texture to turn iton.

    Click the Map button next to Cloud Texture. This willopen the Create Render Node window. Select a CloudTexture.

    STEP SIX

    Preview your sky byrendering theCamera 1 view.

    You will notice cloudsin the scene but theyare faint. You canmake them morepronounced by setting the density. Set the Densityunder the Cloud Attribute of the envSky to 2.0.

    Renderyour scene.You should now see

    STEP SEVEN

    Page 4 of 7

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt1.htm

  • 8/8/2019 envSky

    5/19

    clouds in the sky.

    Switch to yourperspcamera. If you take aclose look at the 3D iconfor the envSky, you willnotice that there is a pointthat represents the sun. By adjusting the Elevation,Azimuth and Size, you will change the position and sizeof this point.

    Set the Elevation to 90 degrees. This will position thesun directly in the middle of the sky and also producethe brightest light. Notice on the 3D icon, that the sunicon has moved directly to the top middle of your icon.

    Renderthe scene.You should now see abright blue sky.

    STEP EIGHT

    You will now position

    the sun so that itappears in your scene.To do this you will needto align the line thatrepresents the sun tointersect a point in your image plane. Make thefollowing changes to position and size of the sun sothat it will be seen in the image plane.

    STEP NINE

    Page 5 of 7

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt1.htm

  • 8/8/2019 envSky

    6/19

    Elevation to 10 Azimuth to 0 Size to 3.0

    If you imagine the line onthe 3D icon representingthe sun going off toinfinity, it will intersect theimage plane which in turnwill render the sun in yourimage. You may need toswitch to yourpersp viewand zoom out to see this.

    Renderthe Scene. Notice how the color of the skychanges in relation to the elevation of the sun. At anelevation of 90, you get an image that has thebrightest possible sky. At a lower elevation your sky

    begins to change to a darker color. However theappearance of the sun does not seem quite brightenough. In this case we will increase the totalbrightness to get a nice sunset.

    Increase the Total Brightness to 3.0.

    Renderthe Scene. You should now have a decentlooking sunset.

    Save your File.

    You have now setupan envSky texturethat will produce anenvironmentcomplete with sunand clouds. Thereare many attributes

    to experiment withon this texture. You can achieve some interestingresults by adjusting the some of the Atmospheric andCloud attributes.

    In the next lesson you will use this file and learn how-toachieve realistic shadows based on the position of thesun.

    CONCLUSION

    Page 6 of 7

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt1.htm

  • 8/8/2019 envSky

    7/19

    HOW TO CREATE REALISTICSHADOWS WITH ENVSKY

    By S. Christov

    Maya CompleteRendering

    This lesson is acontinuation ofHowto create a realisticsky using envSky.

    In this lesson youwill use yourenvironment sky

    texture from the lastlesson and link a directional light to the elevation andazimuth that will simulate the shadows cast when youanimate the position of the sun.

    In the final lesson you will learn how to "grow" a tree inPaint Effects from a simple black brush stroke - How tocreate a tree using Paint Effects.

    Play Movie [~800k]

    Open Env_Sky.ma filethat you saved from thelast lesson.

    In the Attribute Editor forthe envSky, Set theElevation and Azimuthto 0. Set the Total Brightness to 1.0.

    Providing you have not moved or rotated the 3D icon

    the sun position should be lined up along the Z axis.

    STEP ONE

    You are now ready tocreate a directional lightand link it into theattributes of the envSky

    STEP TWO

    Page 1 of 6

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt2_shadows.htm

  • 8/8/2019 envSky

    8/19

    texture.

    Create a DirectionalLight.

    You will want this light tocast shadows so you willneed to turn onshadows. Open the Attribute Editor for the light. In theshadows section, Click the box next to the Use DepthMap Shadows.

    You will notice that the light is pointing at the sun ratherthan away from it. Rotate the light 180 in theY axis.This will align it properly.

    With the lightselected, Group it to itself by selecting Edit > Group.

    In the Attribute EditorRename this node lightLinker.

    STEP THREE

    Open the

    Hypergraphwindow andholding the shift key, Select the lightLinker node andthe place3dTexture node forenvSky.

    Select Graph > Up and Downstream Connections.

    With the Middle Mouse Button, Drag the EnvSky1node onto the lightLinkernode.

    In the Connection Window that opens, click on

    Elevation on the left side, then click on Rotate X onthe right. This connects the Elevation on the envSkynode to the Rotate X attributes on the lightLinkernode.

    Close the Connection Editor window.

    STEP FOUR

    STEP FIVE

    Page 2 of 6

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt2_shadows.htm

  • 8/8/2019 envSky

    9/19

    In theHypergraph window, click on Rendering > CreateRender Node window. . .

    If you were to directly connect the azimuth to thedirectional light you would find that as you adjust theazimuth your light would rotate in the oppositedirection. In this case a reverse node will be used tocorrect this.

    In the Create Render Node window, click on theUtilities tab. UnderGeneral Utilities section, Create aReverse node.

    In the Hypergraphwindow, Drag withthe Middle Mouse Button, the envSky1 node onto theReverse node. This will open the Connection Editor.

    Connect the Azimuth on the left side, with the Input Xon the right side.

    In Hypergraph, Drag the Reverse node onto thelightLinkernode. In the Connection Editor, Connect

    Output X to the Rotate Y.

    Test your light connection by opening the AttributeEditor for the envSky node, and changing theElevation and Azimuth settings.

    You should now notice that the directional light willrotate along with the Elevation and Azimuth.

    STEP SIX

    Create a plane, byselecting Create >NURBS Primitive> Plane.

    Because you areunable to castshadows on the floor of the envSky, you will need to

    STEP SEVEN

    Page 3 of 6

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt2_shadows.htm

  • 8/8/2019 envSky

    10/19

    turn it off. Open the Attribute Editor and Uncheck thebox next to Has Floor. Scale the Plane out to roughly35 units.

    Create a new Lambert material in the Hypershade,Change the color of the new Lambert to white. This willmake it easier to see the shadow.

    Assign this material to the Plane.

    Select Create > NURBS Primitive > Sphere.Move thesphere up in theY axis. This will be your shadowcasting object and will make it easier to see where theshadow will fall. Assign a new material to the sphere.Move the sphere so that it sits just above the floor.

    Create an Ambient Light. Move the light to a point infront of the cone. Set the Intensity to 0.5.

    PositionCamera1in your scene. Themost effectivepositioning of thecamera whenusing an envSkyis to point the

    camera slightlytowards the sky.

    Move the camera away from the cone to see a goodportion of the floor in front of it. This is where yourshadow will be cast. Make sure that the camera is notpositioned past the edge of the plane.

    STEP EIGHT

    You are now are going toanimate the clouds.

    Select the 3D icon for thecloud. Move it 6 units inthe Z axis. Set a key attime 1 by selectingTranslate Z in thechannel box and with the right mouse button select

    STEP NINE

    Page 4 of 6

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt2_shadows.htm

  • 8/8/2019 envSky

    11/19

    Key Selected from the drop down menu. Set anotherkey for the Rotate X attribute value at time 1.

    Move the time slider to time 100. Change theTranslate Z of the icon to 0 and set a key. Changethe Rotate X to 60 and set another key.

    You are now readyto animate thesetting of the sun.

    Move your timeslider to 1. Set theelevation attribute

    on theenvSkyto 75 and click the attribute with yourright mouse button and select Set Key.

    Change the time slider to 100. Change the elevation to0 and Set a Key.

    Press Play, you should now see the envSkyiconanimate the elevation over time.

    Set up your Render Globals to render out 100 framesfrom Camera1. Save your file and then render out theframes.

    STEP TEN

    You have nowconstructed anenvSky that will castaccurate shadowsaccording to theposition of the sun.Click on the imageto get a "time lapse"animation of asetting sun. Payattention to the length and direction of the shadow asthe sun sets.

    You can further enhance the animation by keying thesize and total brightness of your sun as it sets toproduce a more dramatic sunset. You may also want tokey the ambient light slowly to zero intensity at around

    Play Movie[~800k]

    CONCLUSION

    Page 5 of 6

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt2_shadows.htm

  • 8/8/2019 envSky

    12/19

    HOW TO CREATE A TREEIN PAINT FX

    By S. Christov

    Maya CompletePaint Effects

    In this lesson youwill create a tree inPaint Effects startingfrom a simple blackbrush stroke.

    While this approachis somewhat drastic

    it will help you forma good understanding of the attributes that make upPaint Effects.

    This article assumes you have Paint Effects loaded intoMaya. Please see the Maya help menu on how to installPaint Effects if you have not already done so.

    This lesson is the third of a three part lesson. You maywant to complete parts one "How to create a realisticsky using EnvSky" and two "How to create realistic

    shadows using EnvSky" before you start this lesson.

    Play Movie [~800k]

    Download and openthe sceneEnv_sky_shadow.ma.If you havecompleted theprevious lessons,

    you can use yourlast saved scene file.

    Delete the sphere.

    Select the lights, 3D env_sky icon, and the 3D textureicon for the cloud.

    Select Display > Hide > Hide Selection. This will

    STEP ONE

    Page 1 of 9

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt3_trees.htm

  • 8/8/2019 envSky

    13/19

    unclutter the scene so we can concentrate on the PaintEffects stroke.

    Switch to the Perspwindow. Select theplane and select thePaint Effects >Make Paintable.

    Open the Visor byselecting Windows > Visor. Scroll to the bottom andopen the section marked Brushes. This will give youaccess to the Paint Effects preset brushes.

    Open the Pens and select the simpleLine brush.

    In your perspective window, Paint a small stroke nearthe origin.

    STEP TWO

    With the stroke stillselected, open theAttribute Editor.

    Open the tabsimpleLine1. Yourfirst step is to addtubes to the brush.

    Open the tubes section and Click beside Tubes andthen Tube Completion.

    Open the Tubes >Creation section. Change theTubes Per Step to 0.1 and the Tube Rand attribute to0. Also change the Length Min to 0.8, and the Length

    Max to 0.9.

    You will also see some attributes called Tube Width1and 2. These set the width for the base of the tube andthe tip of the tube respectively. Change the TubeWidth1 to 0.12 and Tube Width2 to 0.09. There aresettings for randomness and bias for multiple tubesacross the same stroke but because we are onlycreating one tube, we can ignore these settings.

    STEP THREE

    Page 2 of 9

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt3_trees.htm

  • 8/8/2019 envSky

    14/19

    Change the number ofSegments to 40. This willincrease the number of segments that are used tocreate the tube.

    The Elevation attribute dictates the lean on the tube.Where 0 is the tube lying flat against the curve and 1standing straight up. Since you want the tree to standstraight up, set the ElevationMin and Max to 1.0.

    NOTE: You may notice that your tube is still lying flatagainst the curve despite changing the elevationattribute. You can fix this in the attribute editor. OpenBehavior > Forces. Change the Path Follow to 0.0.

    Now that you havethe basic shape ofthe trunk you arenow ready to shadeit.

    Open the Shadingsection in the Attribute Editor. Click on the colorswatch next to Color1. In the color chooser changethe RGB values to 0.64, 0.52, 0.41.

    Open the Tube Shadingsection. Click on the color

    swatch next to Color2. Set the RGB values to 1.0,0.85, 0.83.

    You have now set the colors for the trunk of your tree.If you render now you will see that it will render out inone uniform color. By adding a simple ramp texture tothe tube you can simulate bark.

    Open the Texturingsection. Click on the icon next toMap Color. We are going to map a V Ramp to thetrunk of the color to give the appearance of bark.

    From the drop down menu beside Texture Type,Select V Ramp. Set the following attributes:

    Texture2 Colorto RGB 0.54, 0.49, 0.44 Repeat U to 6.0 Repeat V to 2.2 Blur Mult to .26 Smearto 0.203

    STEP FOUR

    Page 3 of 9

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt3_trees.htm

  • 8/8/2019 envSky

    15/19

    Smear V to 0.61

    You can preview the progress this far by pressing thehotkey "8" while in the persp window to switch to thepaint effects preview render window. In the menuselect Stroke Refresh > Rendered. However it willtake longer to refresh with each change.

    NOTE: When you render, depending on the length ofyour original stroke, you may have more than one tubeattached to your stroke. One way to solve this is tolower the Tubes per Step attribute in the Tubes >Creation section.

    In Paint Effects youhave the option toIlluminate the treewith simulated orreal lights.

    Open theIllumination section, Check the box next to Illuminated.This will use real lights from your scene on your painteffects tree.

    We are also going to add some specular qualities to

    the tree to give it some highlights. Set Specularto0.15.

    STEP FIVE

    Now that we havethe trunk, we areready to add somebranches. Open theTubesGrowthsection and clicknext to Branches toadd them to the trunk.

    Open the Branches section. Increase the Split MaxDepth to 7. This increases the number of times thebranch will split up.

    Increase the Branch Dropout to 0.02.

    STEP SIX

    Page 4 of 9

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt3_trees.htm

  • 8/8/2019 envSky

    16/19

    The next set of values control different attributes for thesplit on the branch including Randomness, Angle ofsplit, Twist. Feel free to experiment with these valuesand come up with your own style of tree or you can setthe following values:

    Split Rand to .017 Split Angle to 26.3 Split Twist to 0.32 Split Size Decay to 0.67 Split Bias to 0.19

    Click on the boxnext to Twigs to turnthem on. Open thetwigs section.

    Set the Num TwigClusters to 8.0 andset the Twig Dropout to 0.439.

    Then next attribute set length, width,angle and twist.Again feel free to experiment with the settings to getyour own tree or set the following attributes:

    Twig Length to 0.08 Twig Base Width to 0.7 Twig Tip Width to 0.15 Twig Angle1 to 52.5 Twig Angle2 to 54.0 Twig Twist to

    0.512

    Keep in mind that yourtwigs will decide theplacement of leaves.

    So these settings canhave a pretty dramaticeffect down the line.For example increasing the number of Twig Clusterswill result in more leaves on your final tree.

    STEP SEVEN

    STEP EIGHT

    Page 5 of 9

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt3_trees.htm

  • 8/8/2019 envSky

    17/19

    You will now addsome leaves to thetree to complete thelook. Click the boxnext to Leaves. Setthe followingattributes:

    Leaves inClusterto 5.0

    Num Leaf Clusters to 4.0 Leaf Dropout to 0.154 Leaf Length to 0.04 Leaf Base Width to 0.035 Leaf Tip Width to 0.01 Leaf Start to 0.9 Leaf Twist to

    0.5

    LeafTranslucenceto 0.561

    Leaf Sat Randto 0.033

    Leaf Val Randto 0.114

    Check the box next to Terminal Leaf. This will place aleaf at the end of each twig.

    If you render yourimage at this pointyou should have abasic looking tree.You are now readyto add variousother attributes tofurther enhance

    your tree.

    In the Attribute Editor open the Behavior > Forcessection. Set the Gravity slider to 0.05. You will noticethat the branches and leaves spread out as if theweight of the leaves was pulling the branches down.

    STEP NINE

    STEP TEN

    Page 6 of 9

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt3_trees.htm

  • 8/8/2019 envSky

    18/19

    You are now readyto add someanimation to thetree to simulate itswaying in the wind.

    Open theBehaviourthen the Turbulence section. Set theTurbulence Type to Grass Wind. Set TurbulenceInterpolation to Smooth over Time and Space.

    Because we are going to use this tree with a time lapsesunset, you will want the tree to behave with tightmotion in the tree trunk and branches but you do wantthe the leaves to give the impression of some quickfluttering in the wind. Set the following values:

    Turbulence to 0.02 Turbulence Frequency to 0.005 Turbulence Speed to 1.0

    Set the Time Sliderto 100. Press Play. Switch to thePerspective window. The wireframe will give you anindication of the general motion of the tree.

    You will now save

    your brush to thevisor so you canaccess it in thefuture. With the treeselected, go toPaint Effects > GetSettings fromSelected Stroke.This will apply yourtree to the templatebrush.

    Now select Paint Effects > Save Brush Preset. . .

    Set the Label and Overlay Label to Mytree.

    Save it To Visorand set the Visor Directory to Trees.

    Click on Grab Icon and drag around your tree in therender view to make an icon for you brush.

    STEP ELEVEN

    Page 7 of 9

    3/18/2002file://K:\maya%20tutorials\Env%20Sky%20pt3_trees.htm

  • 8/8/2019 envSky

    19/19

    Click Save Brush Preset.

    Select Panels >

    Perspective >Camera 1.

    Position your tree inthe frame byselecting the strokeand moving it withthe manipulator. Add a texture to the ground plane.

    Do some test renders at different frames to make sureyou are happy with the framing and lighting. When you

    are satisfied with the results, set the render globals torender the animation for 100 frames from Camera1.

    STEP TWELVE

    You have nowassembled acomplete scenesimilar to the oneabove. By this point

    you have learnedhow to create anduse an environmentsky, add a light to itto simulate realisticshadows based on the sun position, and made yourown tree in paint effects.

    Enhance your scene by sculpting the floor surface withArtisan to make some nice rolling hills and adding somegrass strokes to it.

    Download the completed scene file. [~100k]

    Play Movie[~800k]

    CONCLUSION

    Page 8 of 9