Forest Road using Paint Effects

By -
Duration
4 mins
Last modification: 16 Sep, 2017

This example scene shows Paint Effects trees and grass used to create a forest along with some fog. In order to get the lighting in the clearing the way I wanted I used several very bright spotlights with fairly high resolution shadow maps. The leaves and branches are animated using the built in turbulence on the pfx brushes. I used translucence on the leaves so they would back light and as well edited the shadow color on some lights to allow more light to penetrate through the leaves, simulating scattering a bit. Note that the render is rather longish, partly due to all the shadow maps( it draws the entire pfx scene for each shadow map). The scene has the stroke display quality settings low to make updating a bit faster and use less memory. In addition displayAsMesh is toggled off for grass and brush, which reduces memory overhead a bit. Note that trees and blowing grass update during playback, because they have turbulence animations. For fast playback one could set paint effects to "interactive" in the performance options. Then the pfx would not animate during playback. There is a slight flicker problem during animation that perhaps a bright user could fix. I think this must be due to the brightness of the lights combined with the depth map resolution limits... perhaps made worse by having a non-black shadow color. As the leaves animate the combination can result in holes suddenly opening up in the shadow map allow light to pop on for those bits. A real scene would tend to not have this problem due to multiple scattering of light through the leaf canopy. I tried converting everything to poly and had the same problem, so I'm pretty sure its the way the lights are defined... they have rather extreme intensities, but in real life a forest is quite dark compared to the sky and outer illumination.

Fog illumination seen without Paint Effects

I used the physical fog "atmospheric" setting ( see envFogMaterial node ) with a low airLightScatter value and careful placement of the fog's sun position. (the physical fog has a single simulated sun that illuminates the fog, but not objects in the scene) The low airLightScatter causes the fog to be brighter where one looks more in the direction of the sun. By positioning the sun to the right of the scene I was able to create the brightness gradient in the fog that I wanted, without resorting to full volumetric shadowing. One can do nice volumetric shadowing with Maya Fluids, but they do not integrate well with paint effects at render time, while the environment fog has special code that makes it work well with paint effects. In an actual forest the light scattered through the leaves would illuminate the fog, giving the fog a greenish tinge, so I make the fog slightly green to simulate this. Additionally I wanted the background to be very bright from overhead. To simulate this bright background I created a box(nurbsCube1) with a surface shader that had a bright outColor(value set to 4.5 in color editor) and positioned it around my scene. The bright color punches through the fog where it is nearer to the eye. Finally I added a small amount of depth of field, focusing near the camera to simulate the way dense fog slightly blurs distant objects. The trees in this scene are have been modified from existing presets. If you want to make any tree or bush in this scene a preset it is easy. Select the tree and then do "Paint Effects:Get settings from selected stroke", followed by "Paint Effects:Save Brush Preset". If you want to create an icon for the preset you can paint a stroke of the brush in the paint effects panel, then in the save preset box select "grab icon" and drag the mouse over the region in the panel to become the icon, then save the preset. One can also create icons from the render view window by using "View:Grab Swatch" from its menu. You can find the Scenefile and SourceImages below.

editPfxOnPolyPath.mel parentToSurface.mel nClothBook.ma dynamicFollow.mel cameraFollow.mel cameraFollowScene.ma lightOcclusion.ma fireball.ma itsSlinky.ma TunShu_BindClothSkin.zip confettiFall.mb simpleConfetti.ma roundConfetti.ma partyStreamers.ma waterTank.ma nClothWater2.ma nClothWater.ma waterPlayground.ma sunsetLeaf.zip oakBigLeaf.mel + oakBigLeaf.mel.icon ribbonTwist.ma bagOfMarbles.ma toonOcean.ma buckySphere.ma thickSlab.ma phoneChord.ma forestRoad.ma bark.iff basicLeafHC.jpg birchBark.gif grassRoad.jpg leafSerrate.tif WhiteBark.tif sideleaf.rgb
Posted By
Published In
Tags
  • Example scenes
10 Comments
To post a comment please login or register
| 10 years ago
Video is not loading... Can you reupload, please? :) Thanks!
| 10 years ago
The video is not working...could you look into it please. I would very much like to see it.
| 12 years ago
Thanks Duncan for a beautiful scene for us to learn from. I hope that your next tutorial with the trees and leaves blowing, clinging to the winds using nCloth will include that magnificent scene for us to break down and learn from. Thank you very much.
| 12 years ago
Paint effects uses the depth buffer from the scanline render, which only has one depth value per pixel. One can use the depthType on the camera to control whether partial overlap of a pixel appears in the depth or not. Thus setting the depthType to nearest visible should get rid of the poke-through you describe, although the borders of objects may then pull through some of the background color, causing fringes. One solution is to render at a higher resolution without antialiasing and then resize back down to the target resolution.
| 12 years ago
A very beautiful lighting job. Thanks for making the source available to us. I used it and noticed that translucent (semi-transparent) NURBS display a 'poke-through'. Additionally, extremely tiny cracks between NURBS surfaces also show a very visible 'poke-through'. I understand that these artifacts may be unavoidable because of the post-processing nature of Maya Paint Effects. Do you have any suggestions as to how to ameliorate these effects?
| 13 years ago
I`ve got it thanks. DragnDrop worked , open scene did not, but thats normal. cheers Mike
| 13 years ago
Hi Mike, try doing a rightmouse->saveTargetAs and put forestRoad.ma into your scenes directory and the supporting texture files in your sourceimages directory. If it then doesn't load properly using the maya open scene menu (instead of drag/drop) then let me know. The file is a 7.0 format file, so it should work with your version fine. Duncan
| 13 years ago
Hello Duncan, thanks very much for that. I`m having difficulty in opening the scene file. I`ve tried to drop it into Maya 7.0, and its not working. Any idea why? Thanks for your time Mike.
| 13 years ago
The avi link should still be working. You may need to download the divx codec: http://www.divx.com/ Let me know if it is still a problem. Duncan
| 13 years ago
the linked AVI is no longer there
*Save $66 per month on Autodesk's Suggested Retail Price (SRP) when purchasing 1 year term 3ds Max or Maya subscription.