home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / next / programm / 7724 < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  2.1 KB

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