由 ChildPark » 4日 9月 2003年, 21:49
這是做練習時寫下的筆記,現提交出來和大家分享!以下是Texture mapping常預見的三數,我將了解的全寫下,方便大家三考,如有錯失請指教,謝謝!
Texture的生成做法有用掃描儀和相機,然後轉換到電腦內,注意pixel 、resolution和format制式。
Texture mapping的轉換方法:
在commod內設置的方法 - 路徑需要到達轉換圖片的地方,然後便輸入txmake作執行指令。
D:\>Home\Renderman\textures\txnake picturename.jpg picturname.tex
JPEG的類別:txmake picturename.jpg picturename.tex
SGI的類別:txmake picturename.sgi picturename.tex
TAGA的類別:txmake picturename.tga picturename.tex
選擇轉換類型時需了解texture本身的質素format,否則不能達到理想,圖象儲存知識都需了解,我不是專家,所以我只能提供常用的format,例如sgi、tga、tiff、rat。
txmake這功具是Renderman內置的轉換器,還有BMRT的mkmip,mkmip這轉換器可作轉換TIFF的用途,最適合不過,三考文章在以下有解釋,當然還有其它轉換器,例如houdini的iconvert和icp,但是它們都是為了配合自身軟件作轉換用途,例如Houdini常用的rat文件,便需要用iconvert和icp執行,多輯圖片的轉換可三考以下的資料在城市大學CG/CEC,Computer Opteration網頁內。
BMRT, on the other hand, allows you to use TIFF files directly as textures, though this is not terribly efficient or flexible for ordinary scanline-oriented TIFF. However, BMRT comes with a utility called mkmip, which operates much like txmake, preprocessing your textures so that memory and time are greatly reduced for the renderer when using your texture. The texture files created by mkmip are still legal TIFF files-they just happen to be multiresolution, tile-oriented TIFF, which can be very efficiently accessed by BMRT. The mkmip program also takes the –mode / -smode / -tmode parameters to determine wrapping. There are no –short or –float options-mkmip will always create a texture file with the same bit depth and format of your original TIFF file. Consult the BMRT User Manual for details and other options.
有些PRMan轉換指令三考:
PRMan requires that all texture be in a special, proprietary texture format. The txmake program that comes with PRMan will convert a variety of image file formats into PRMan texture file:
Txmake [arguments] inputfile outputfile
Several optional arguments are occasionally useful:
· -mode modename
Determines the “wrap mode,” or what value the texture takes on for values of s and t outside the range [0,1]. If the modename is black (the default), out-of-rang texture lookups will return black for all channels. A modename of clamp treats out-of-range texture lookups as if they happened right on the border of the texture-in other words, the texture extends its border values to infinity. Finally, the modename periodic will cause the texture to simply wrap.
The –mode flag specifies the wrapping behavior for both the s and t directions, but you could specify them separately using the –smode and –tmode flags.
· -resize resizemode
The use of this flag is somewhat esoteric, but we strongly recommend that you use resizemode of up-. (yes, that’s “up dash.”) The several other options are explained in the PRMan documentation.
· -short
-float
By default, txmake creates 8-bit, unsigned textures, regardless of the input file. Therefore, if your input file is 16 bits per channel and you want to retain full precision, you must use the –short flag. Similarly, the –float flag will create a 32-bit float-point texture if you have a floating-point input file.