<< 「実践CGへの誘い」例題をPythonで・・その11 戻る pythonでパーティクル >>

Depth of field

Essential RenderManから、loop.cをPythonで試してみる。
Depth of field、PixelSamples、ShadingRateを調整しています。
ありがとうございます。
loop.jpg


#/* loop.py - Create a line of Spheres */
# Essential RenderMan p.113
import cgkit.cri
from cgkit.cgtypes import *

# Load the RenderMan API.
# Replace the library name with whatever renderer you want to use.
ri = cgkit.cri.loadRI("3delight")
cgkit.cri.importRINames(ri, globals())

RiBegin(RI_NULL)
RiDisplay ("loop.tif",RI_FILE, RI_RGB)
RiFormat(320, 240,1)
RiPixelSamples( 8, 8)
RiShadingRate(0.25)
RiProjection (RI_PERSPECTIVE)
RiDepthOfField(2.8,0.100,2)
RiTranslate(0,0,0.25)
RiRotate(-10,0,1,0)
RiWorldBegin()
RiLightSource("ambientlight","intensity",0.2)
RiLightSource("distantlight", "from",[-1,1,-1])
RiTranslate(0.3,0,0)
for i in range(12):
RiSurface ("plastic")
RiColor((1.0,0.05,0.05))
RiSphere(0.25,-0.25,0.25,360,RI_NULL)
RiTranslate(-0.2,0,0.5)

RiWorldEnd()
RiEnd()


RiLightSource("distantlight", "from",[-4,1,-1])
ディスタントライトの方向を変更してみた。

#RiDepthOfField(2.8,0.1,2)
とコメントアウトすると、くっきりになる。
cgkitと3Delightを使用しました。
  • -
  • -

<< 「実践CGへの誘い」例題をPythonで・・その11 戻る pythonでパーティクル >>