Tuesday, March 20, 2007

Baking is easy

原本我要將已經算出來的occlusion或shading color bake成2D的texture都需要自己兜一堆SLBOX跟RIBBOX,
可是剛剛發現了Bakeable這個好用的shader。
----
It's a trouble for baking calculated occlusion color or some shading color as 2D texture.
I must write some SLBOX and RIBBOX for indicating what I want to baking.
Now, I fund Bakeable for dealing this routine.


在slim中的Color/Utility可以找到Bakeable這個shader,
可以在Color連入想要bake的內容,
然後將Bake Style換成texturemap,
BakeManifold的space設成ST,
render之後就可以在rmantext下找到算出來的ptc檔,
他的命名規則為${BakeAltas}_${FileContext}.ptc,
要bake的東西會存在該ptc檔的_color channel中。
可以用ptrender -size w h foo.ptc _color foo.tif 產生圖片,
簡單吧!!
----
You can find Bakable shader in Slim Color/Utility menu.
Connect the color you want to bake to the "Color" property.
Set "Bake Style" as "texturemap".
Set "BakeManifold / space" as "ST".
After render, baked ptc file will store in remantex fold.
Baking color stores in "_color" channel.

If you want to see picture, render it by ptrender.
example: ptrender -size w h foo.ptc _color foo.tif
See!!! What a easy way.

Monday, March 19, 2007

Pointbased Occulsion

在Renderman的rsl function列表中,
occlusion函式並沒有列出pointbased這個參數,
但是他確是使用pointcloud based occlusion不可或缺的設定。
--------------
In Rendernman rsl function document,
you can't see nothing about pointbased description at occulsion part.
It's very important when using pointcloud based occlusion.


如果你已經將area資訊bake到ptc檔案中的__area channel,
可以使用occlusin(P, N, samples, "filename", "xx.ptc", "pointbased", 1, ....);
這樣就會用pointbased的方式算出occlusion,而不是用raytraced的方式。
這樣的方式在連續圖片的Occlusion較不會閃。
--------------
If you have calculate area value and using bake3d to store it in a ptc "__area" channel.
When having a ptc file which stored area() information in __area channel(using bake3d function),
you can get pointcloud occlusion value by occlusion(P, N, samples, "filename", "xx.ptc", "pointbased", 1, ....).
This way will reduce image sequence flick.