home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5371 < prev    next >
Encoding:
Text File  |  1992-07-30  |  3.4 KB  |  83 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!cs.utexas.edu!wupost!usc!aero.org!Aero.org!strauss
  3. From: strauss@Aero.org (Daryll Strauss)
  4. Subject: Re: Renderman surface mapping problem
  5. Message-ID: <1992Jul30.193923.10909@aero.org>
  6. Sender: news@aero.org
  7. Organization: The Aerospace Corporation
  8. References:  <1992Jul30.084334.9893@reed.edu>
  9. Date: Thu, 30 Jul 1992 19:39:23 GMT
  10. Lines: 71
  11.  
  12. In article <1992Jul30.084334.9893@reed.edu>, lydgate@reed.edu (Chris Lydgate) writes:
  13. |>... 
  14. |> Basically, I'm wondering:
  15. |> 
  16. |> 1) How do I map a texture file onto a surface using the 3DKit?
  17.  
  18. First off, realize that QuickRenderMan only understands a few simple
  19. shaders. Any of this fancy stuff will only be visible if you render the
  20. picture. With that said:
  21.  
  22. I don't know what all the shaders are on the NeXT. I assume that NeXT
  23. will provide the interface to all the shaders in the finally release
  24. (although source to them would be great guys!!!) I do know one
  25. particular shader from another RenderMan implementation, which should get
  26. you started. Try using paintedplastic. Here's the interface:
  27.  
  28. surface
  29. paintedplastic(float Ks=.5, Kd=.5, Ka=1, roughness=.1, color specularcolor=1,
  30.         string texturename = "";)
  31.  
  32. Ks is the specular reflection.
  33. Kd is the diffuse reflection.
  34. Ka is the ambient reflection.
  35. roughness is a measure of the roughness of the surface (for reflections)
  36. specularcolor is the color of the specular reflection
  37. texturename is the name of the texture map.
  38.  
  39. So create a shader with the right parameters and apply it to an object
  40. and it should work. This should be enough to let you take a plastic
  41. object and apply a texture. Assuming you already have a texture.
  42.  
  43. |> 2) If there's no standard shader for doing this, how could I write
  44. |> one?
  45.  
  46. No need. I think there are other types of texture mapping shaders in
  47. there, but I don't know anything about them.
  48.  
  49. |> 3) How can I create a texture file from, say, a TIFF file?  (I know
  50. |> about RiMakeTexture(), but the documentation is vague about file 
  51. |> formats.)
  52.  
  53. You are right on both counts; RiMakeTexture is the right way and they are
  54. vague on the formats. Pixar was trying to make the specification
  55. independent of the hardware it is running on, so they didn't say "make
  56. a file in this format" they just assumed you had an appropriate format.
  57. TIFF had better be an appropriate format on the NeXT.
  58.  
  59. What you do in normal RenderMan is first create a texture file from your
  60. standard file. This is done by rendering a simple RenderMan file with
  61. this one line:
  62.  
  63. MakeTexture "original.tiff" "result.tx" "periodic" "periodic" "box" 1 1 
  64.  
  65. What this says is that I'm taking my TIFF file original.tiff and
  66. converting it to a texture file called result.tx, I want the texture
  67. to be periodic (repeating both vertically and horizontally) The
  68. resulting texture should be smoothed with a 1 by 1 box filter. In other
  69. words, no smoothing.
  70.  
  71. I think all the Ri Functions really do is make a text rib file, they
  72. don't do any real rendering. So if you put this at the beginning of your
  73. object structure, you'll recreate the texture file each time your render
  74. the object which is kind of dumb. I don't know if your application can
  75. check to see if "whatever.tx" already exists and if not, force a
  76. rendering like the one line shown above. Otherwise, you might just want
  77. to create the texture by hand once and not worry about it later.
  78.  
  79. Hope this helps, and feel free to send questions. I'll see what I can answer.
  80.  
  81.                             - |Daryll
  82.  
  83.