home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!mimbres.cs.unm.edu!droid!wick
- From: wick@stone.com
- Newsgroups: comp.sys.next.programmer
- Subject: RenderMan shadow maps
- Keywords: renderman, 3d, shadows
- Message-ID: <1992Dec14.074306.667@stone.com>
- Date: 14 Dec 92 07:43:06 GMT
- Article-I.D.: stone.1992Dec14.074306.667
- Sender: wick@stone.com
- Reply-To: wick@stone.com
- Organization: Stone Design Corp
- Lines: 37
-
-
- A few more things on generating shadow maps with RenderMan.
-
- There are basically 2 steps:
-
- 1. Generate a depth based picture file (Z-File). The RIB file that you want
- to render the Z information from must have a Display call along the lines of:
- Display "filename" "zfile" "z"
- where filename is the name of the output Z-File. This file is not of any
- recognized format so don't bother trying to view it. Also, shaders and light
- sources are not used so don't bother with them, either. Your camera
- transformations should be such that your camera is at the "from" point of
- your light, and pointing at the "to" point of it. Also, if your light is a
- distant light, then you should not use a "perspective" projection and use
- instead "orthographic". For spotlights, you need to use "perspective". For
- pointlights, call Pixar and get them to explain it. (It is not fun) Another
- thing to worry about is the ScreenWindow and whether it is large enough to
- encompass all your shadow casting and casted objects. With distant lights
- the ScreenWindow bounds get used, with spots its the fov parameter in your
- projection. Make it so. Also, make sure the output image is sized by powers
- of 2, or else you will have a very funny looking world.
-
- 2. Call RiMakeShadow("filename.zfile", "shadowfile", RI_NULL) or just stick
- the following line after the last FrameEnd in the RIB file that generates
- your z-file, and you can do both steps in one fell swoop:
- MakeShadow "filename.zfile" "shadowfile"
-
- This will create the shadowmap in the file "shadowfile". Then you just need
- to use a lightsource shader that incorporates shadowmaps.
-
- I think that covers most of things that can go wrong with trying to get
- shadows.
-
- wick
-
- Peter Wickersham
- wick@stone.com
-