<< NVIDIA Gelatoでreflectを試す 戻る NVIDIA Gelatoでcheckerを利用する >>

NVIDIA Gelatoでアンビエント・オクルージョン

まず、AO(ambient-occlusion)を求める。
#sphere32ao.pyg

Attribute ("int ray:maxdepth", 1)

Output ("sphere32ao.tif", "tiff", "rgb", "camera", "float gain", 1, "float gamma",
1, "string filter", "gaussian", "float[2] filterwidth", (2, 2))
Attribute ("float shadingquality",2)
Attribute ("string projection", "perspective")
Attribute ("float fov", 13)
Attribute ("int[2] resolution", (640, 480))
#placecam -20 15 0 0 0 0
Rotate (-36.87, 1.00, 0.00, 0.00)
Rotate (-90.00, 0.00, 1.00, 0.00)
Translate (20.00, -15.00, 0.00)

Attribute ("string occlusion:spatialdb", "occ.sdb");
Attribute ("string spatialdb:write", "occ.sdb");

World ()
Shader ("surface", "ambocclude", "string occlusionname", "localocclusion", "float samples", 256, "float bias", 0.01)

Attribute ("string geometryset", "+localocclusion")
Attribute ("float occlusion:maxpixeldist", 20)
Attribute ("float occlusion:maxerror", 0.25)

PushTransform ()
Attribute ("color C", (1, 1, 0.25)) #yellow
Translate ( 0, 1, 0)
Sphere (1, -1, 1, 360)
PopTransform ()

PushTransform ()
Attribute ("color C", (0.25, 0.25, 1)) #blue
Translate ( 0, 1, 2.5)
Sphere (1, -1, 1, 360)
PopTransform ()

PushTransform ()
Attribute ("color C", (1, 0.25, 0.25)) #red
Translate ( 0, 1, -2.5)
Sphere (1, -1, 1, 360)
PopTransform ()

Attribute ("color C", (1, 1, 1))
Rotate (90.00, 1.00, 0.00, 0.00)
Input("PlaneGeom.rib")
Render()

sphere3_ao.jpg

つづいて、Photoshopでレイヤーに入れて乗算処理する。
sphere3_multi.jpg
  • -
  • -

<< NVIDIA Gelatoでreflectを試す 戻る NVIDIA Gelatoでcheckerを利用する >>