Rendering学習日記

日々、3DCGの世界は進歩しています。勉強して理解したことをまとめていきます。RenderMan互換レンダラーやグローバル・イルミネーション。いろんなことに好奇心を持って、面白くなる。目指せShader書き!!
ありがとうございます。

matid

各オブジェクトのジオメトリがmatidを持っているかどうかを調べてみた。
なるほど、本家のチュートリアル参考になりました。これでメタセコイアpythonを使って、cgkitのシーン出力できそうです。ありがとうございます。

>>> from cgkit.all import *
>>> load("sample.obj")
>>> listWorld()
Root
+---obj1 (TriMesh/TriMeshGeom)
+---obj2 (TriMesh/TriMeshGeom)
+---obj3 (TriMesh/TriMeshGeom)
>>> objs=["obj1","obj2","obj3"]
>>> model=worldObjects(objs)
>>> model
[, 0x0330E8A0>, ]
>>> for s in model[0].geom.iterSlots():print s
...
N
cog
faces
inertiatensor
matid
st
verts
>>> for s in model[1].geom.iterSlots():print s
...
N
cog
faces
inertiatensor
st
verts
>>> for s in model[2].geom.iterSlots():print s
...
N
cog
faces
inertiatensor
st
verts
>>>
  • -
  • -

matidを確かめる

>>> model[0].geom.hasSlot("matid")
True
>>> model[1].geom.hasSlot("matid")
False
>>> model[2].geom.hasSlot("matid")
False
>>>
  • -
  • -

アンビエントオクルージョン

metasequoia pythonからcgkitシーンを出力した。
シーンにAttributeを追加する。レイトレーシング設定などなど
3Delightでレンダリングしました。
rml=RMLightSource(name = "RMLightSource", shader = "occlight")
rml.shader.declare('uniform float samples=128')

w=WorldObject()
w.rib='Attribute "visibility" "trace" [0]\nAttribute "visibility" "transmission" ["opaque"]'

w2=WorldObject()
w2.rib='Attribute "visibility" "trace" [1]\nAttribute "visibility" "transmission" ["transparent"]'

load("tank_test.obj")
objs =['syatai', 'houtou', 'futa', 'gun', 'gunbase', 'hou', 'wheel', 'd_wheel', 'chata', 'obj1']
models = worldObjects(objs)

for i in range(9):
link(models[i],parent=w)

link(models[9],parent=w2)


ちょっとレンダリングが速くなるかな。
tank4.jpg
  • -
  • -
<< 8/22 >>