Rendering学習日記

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

Guile RMan #4 RiPoints

guile-rmanでのRiPointsでは"constantwidth"を使う。ありがとうございます。
points4.jpg

#!/usr/bin/guile -s
!#

(use-modules (rman rispec))
(use-modules (rman utilities))

(RiBegin "points4.rib")
(RiDisplay "points4.tif" "file" "rgb")
(RiFormat 640 480 1)
(RiProjection "perspective" '("fov" 30))
(RiTranslate 0 0 3)
(RiPixelFilter RiBoxFilter 1 1)
(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.2))
(RiLightSource "distantlight" (list "intensity" 1.2 ))
(RiAttributeBegin)
(RiColor (Color 1 0 0))
(RiSurface "plastic")
(RiTransformBegin)
(RiTranslate -0.5 -0.5 0)
(RiPoints 4 (list "P" #f32(0 0 0 0 1 0 1 1 0 1 0 0) "constantwidth" 0.4))
(RiTransformEnd)
(RiAttributeEnd)
(RiWorldEnd)
(RiEnd)

  • -
  • -

Guile RMan #5 RtLightHandle

やっと、わかりました。PixarのRenderMan C Bindingにヒントがありました。bulb.cを参考にしました。ありがとうございます。
guile-rmanでのRtLightHandleの記述例:

(define light2 (RiLightSource "distantlight" (list "intensity" 1.2 )))
(RiIlluminate light2 0 )

LightID、"light2"をRiIlluminateでオフ(0)にしています。
以下は、サンプルilluminate.scm
ambientlightのみの灯りになっています。

#!/usr/bin/guile -s
!#

(use-modules (rman rispec))
(use-modules (rman utilities))

(RiBegin "illum.rib")
(RiDisplay "illum.tif" "file" "rgb")
(RiFormat 640 480 1)
(RiProjection "perspective" '("fov" 30))
(RiTranslate 0 0 5)
; (RiProgressHandler progress)
(RiPixelFilter RiBoxFilter 1 1)
(RiWorldBegin)
(display (RiLightSource "ambientlight" (list "intensity" 0.2)))
(newline)
(define light2 (RiLightSource "distantlight" (list "intensity" 1.2 )))
(newline)
(RiIlluminate light2 0 )
(RiAttributeBegin)
(RiColor (Color 1.0 0.6 0.0))
(RiSurface "plastic")
(RiTransformBegin)
(RiRotate 90 1 0 0)
(RiSphere 1 -1 1 360)
(RiTransformEnd)
(RiAttributeEnd)
(RiWorldEnd)
(RiEnd)

  • -
  • -

Guile RMan #6 ShadowMap part 2

illum3.jpg

FramBegin〜Endを使ってAqsisサンプルのSoftshadowをguile-rmanで生成してみました。

#!/usr/bin/guile -s
!#
(use-modules (rman rispec))
(use-modules (rman utilities))

(RiBegin "illum3.rib")
;;(RiOption "limits" (list "bucketsize" #f32(32 32)))
(RiOption "limits" (list "eyesplits" 10))
(RiDeclare "bias" "float")
(RiHider "hidden" (list "depthfilter" "midpoint"))
(RiDisplay "softshadow.zfile" "zfile" "z")
(RiClipping 0.01 10)
(RiSides 2)
(RiFormat 512 512 1)
(RiPixelFilter RiBoxFilter 2 2)
(RiPixelSamples 1 1)
(RiShadingRate 2)

(RiFrameBegin 1)
(RiProjection "perspective" '("fov" 57.30))
(RiRotate -35.26 1.00 0.00 0.00)
(RiRotate 45.00 0.00 1.00 0.00)
(RiTranslate -5.00 -5.00 5.00)

(RiWorldBegin)
(RiSurface "null")
(RiSphere 1 -1 1 360)
(RiWorldEnd)
(RiFrameEnd)

(RiMakeShadow "softshadow.zfile" "softshadow.shad")


(RiDisplay "illum3.tif" "file" "rgba")
(RiFormat 512 384 1)

(RiPixelFilter RiGaussianFilter 2 2)
(RiPixelSamples 2 2)
(RiClipping 0.2 10)
(RiShadingRate 1)
(RiFrameBegin 2)

(RiProjection "perspective" '("fov" 45))
(RiTranslate 0 0 5)
(RiRotate -25 1 0 0)

(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.2))
(RiLightSource "shadowspot" (list "intensity" 80
"from" (Point 5 5 -5)
"to" (Point 0 0 0)
"coneangle" 0.5
"float blur" 0.03
"string shadowname" "softshadow.shad"))

(RiColor (Color 0.4 0.4 0.1))
(RiSurface "matte")
(RiSphere 1 -1 1 360)

(RiOrientation "rh")
(RiColor (Color 0.5 0 0))
(RiSurface "matte")
(RiPatch "bilinear" (list "P" #f32(-10 -1 -10
10 -1 -10
-10 -1 10
10 -1 10)))
(RiWorldEnd)
(RiFrameEnd)
(RiEnd)


Max eyesplits for object "unnamed" exceeded
Object "unnamed" spans the epsilon plane
Object "unnamed" spans the epsilon plane
Max eyesplits for object "unnamed" exceeded
Object "unnamed" spans the epsilon plane
Max eyesplits for object "unnamed" exceeded
が出ますがレンダリングできました。
  • -
  • -
<< 2/5 >>