ElaKiri Community
Downloads
Go Back   ElaKiri Community > General > Education
Reload this Page Trancprancy shadow tute (Maya)
Reply
 
Thread Tools
(#1)
Old
gazaly's Avatar
gazaly gazaly is offline
Senior Member
gazaly has a spectacular aura aboutgazaly has a spectacular aura aboutgazaly has a spectacular aura about
 
Posts: 11,759
Join Date: Nov 2006
Location: S.A
Up Trancprancy shadow tute (Maya) - 04-18-2007, 01:15 AM


click to play animation



The above animation shows the result of animating a searchlight sweeping in front of a blasted wall. Light rays enter the room as shadows are cast into the fog volume.

Be aware that volume shadow occlusion only works with depth-map shadows. This creates problems if you have transparency mapped objects, as is the case with the wall. So how can we get an object with a transparency map to cast accurate shadows without raytracing? (i.e. depth-map shadows).


Shading Network: Transparency, Specular, Bump

In the above scene we have a trashcan made from a revolved surface with a Blinn shader which uses specular, bump and transparency maps to create the desired appearance of being made out of a wire mesh.


trashcan with Depth-map (left) vs Raytrace shadows

In the above image, the key light is using D-map shadows (left), which are casting a fully opaque shadow based not on the object's transparency but on its tesselation. The right image displays accurate shadows, at the cost of enabling raytrace shadows. For a 720x480 render, the D-map shadow took 7sec while the raytrace shadow took 150 sec!

In order to solve this dilemma (which if you are going to use fog volume occlusion you must solve somehow but, if not, you still want to avoid raytracing), we are going to create a 'shadow object'. A surface whose purpose is to cast the accurate Dmap shadow, but not actually render. We will therefore end up with two objects on top of each other in our scene.

Step by Step on a Sphere:

mesh Shader on sphere: Dmap vs raytrace shadows

1. Select the original transparency mapped object and turn off the 'casts shadows' attribute in the Attribute Editor render stats.





2. Put the object on a display layer called 'primary object'.

3. Duplicate the primary object and put the copy on another layer called 'shadow object'.

4. Turn off the visibility of the primary object's layer.

5. Assign a new lambert shader to the shadow object.

6. Assign the primary object's bump map to the shadow object's displacement.


render of mapped Displacement with default settings



7. Determine the appropriate tesselation and alpha gain to yield the desired displacement.

An object's tesselation settings determine how accurately the displacement represents the source image... the higher the tesselation, however, the more polys you are going to get. Keep this to a minimum through the understanding that the displacement will be used to create the Depth map... therefore if your scene is going to have soft light sources (soft shadows), you can get away with fewer polys in the shadow object.


render of displacement after lowering 'alpha gain'



Also be sure to have the depth of the displacement correlate to the shader on your primary object. With the default settings, the displacement was way too deep. To reduce the displacement's depth, lower the 'alpha gain' attribute on the displacement texture.

8. Select the shadow object and utilize 'Modify/Convert/Displacement to Polygons'. This step will create a new poly surface which is the actual 'shadow object'. The object which was converted can be deleted.


shadow object converted to polys

9. Delete faces which represent the 'primary' objects's transparency. Select the poly shadow object, goto Edit/Paint Selection and the vertices will appear. To switch to faces, right-click on the surface and choose 'faces' from the pop-up. You can now 'paint select' with Artisan. To re-size your brush, the default hotkey is 'b'.


progress of deleting faces via Artisan




This step can be time consuming if you select and delete faces manually. Artisan can greatly speed up this process and is almost always faster, unless your shadow object is flat and faces can be quickly selected from an orthographic view.

note: one question that you may be asking is why even bother with the primary object once you have modeled/created the shadow object. The reason is simply that you can get a much smoother level of detail via transparency. The shadow object does not need to have as many polys as the primary object would need... especially when dealing with soft shadows.

10. Turn off 'primary visibility' for the poly shadow object.

11. Turn on the visibility for the primary object's layer.

At this point we have two objects, primary and shadow, which should both be visible in Maya before rendering. One is the object which we see and which the light illuminates, the other we do not see, but the lights incorporates it into the Dmap calculation.


Primary and Shadow objects visibile

The only thing left to do is determine the Dmap settings necessary for the quality of shadows required... high-res for hard shadows, low-res for soft shadows... this will depend on your project.


Dmap Shadows: 256x vs 512x, filter size = 5

In the above image we have achieved our goal... A transparency mapped object casting Dmap shadows which can be efficiently managed in regards to quality and render time. The above images took only 10 seconds to render at 720x480, while raytracing softshadows for the object took about 150 seconds. Plus, we have the added benefit of being able to incorporate fog shadow occlusion effects with the object.






point light with Dmap shadows and fog

Well, that about covers it for now... hope this technique helps you out of a tough spot someday, and shows you how to manage Dmap calculation time as well. While the focus of our discussion was transparency shadows, the concept of having a 'shadow object' is a common production technique used to speed up render time. If a low-res version of an object is casting the shadow, you have to ask yourself if anyone would really be able to tell.
Reply With Quote
(#2)
Old
nukisl's Avatar
nukisl nukisl is offline
Senior Member
nukisl is an unknown quantity at this point
 
Posts: 16,211
Join Date: Sep 2006
04-18-2007, 01:32 PM

cool but 1 knw this


thanx
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autodesk Maya 2008 Unlimited Full 2.5 DVD djkasun Downloads 9 11-10-2007 07:34 PM
Autodesk Launches Autodesk Maya 2008 Software gazaly News 3 09-02-2007 09:38 AM
Maya 8.5 Released........ blackroses ElaKiri Talk! 10 04-10-2007 01:42 PM



Copyright © 2006 - 2011 ElaKiri™ Beta2.Evo vBulletin, vBa iBproArcade Subdreamer I-Magic MKv

Page generated in 0.03996 seconds with 10 queries