Rendering学習日記

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

Guile RMan #13 サンプルテスト

Aqsis1.6とguile-rmanでのサンプルが動くように調整しました。
sphere_two.jpg
以下、test0.scmを実行します。
Some deprecated features have been used. Set the environment variable GUILE_WARN_DEPRECATED to "detailed" and rerun the program to get more information. Set it to "no" to suppress this message.

export GUILE_WARN_DEPRECATED="detailed"
を.bashrcに書き加えた方が良いです。



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

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

(define (progress percent frame)
(display "Percent: ")
(display percent)
(display " Frame: ")
(display frame)
(newline))

(define (subdiv ptr lod)
(display "Ptr: ")
(display ptr)
(display " Lod: ")
(display lod)
(newline))

(define (free ptr)
(display "Ptr: ")
(display ptr)
(newline))

(define bound #f32(0.0 0.0 0.0 10.0 10.0 10.0))

(define data '(some data))

(RiBegin "test0.rib")
(RiDisplay "sphere_two.tif" "file" "rgb")
(RiFormat 320 240 1)
(RiProjection "perspective" '("fov" 45.0))
(RiTranslate 0 0 6)
(RiProgressHandler progress)
(RiWorldBegin)
(let ((o1 (Object (RiSphere 1 -1 1 360))))
(RiLightSource "ambientlight" '("intensity" 0.2))
(RiLightSource "distantlight" '("intensity" 1.2
"from" #f32(0 0 -6)
"to" #f32(0 0 0)))
(RiColor #f32(1.0 0.0 0.0))
(RiSurface "plastic")
(RiTranslate -2.0 0 0)
(RiObjectInstance o1)
(RiColor #f32(0.0 1.0 0.0))
(RiSurface "plastic")
(RiTranslate 4.0 0 0)
(RiObjectInstance o1)
(RiProcedural data bound subdiv free))
(RiWorldEnd)
(RiEnd)


一歩一歩ですね。ありがとうございます。
RIB出力するようになれば完璧です。
以下は課題?。
configure:11571: checking for RiBegin in -laqsis_core
configure:11606: gcc -o conftest -g -O2 conftest.c -laqsis_core >&5
/usr/lib64/libaqsis_ribparse.so.1: undefined reference to `boost::iostreams::detail::zlib_base::inflate(int)'
collect2: ld returned 1 exit status
RenderMan | - | -

Guile RMan #12 RiReadArchive

Aqsis1.6とguile-rmanでのスクリプトの書き方、ReadArchiveの書式がわかりました。

(RiReadArchive "cone.rib" (list ))

パラメータ部分をlistにしときます。
simple4.jpg
以下は、Nupatchのcone.ribを保存します。


NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 2.23607 2.23607 2.23607 2.23607] 0 2.23607 "Pw" [0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1
0.783612 -1 0.783612 1 3.21127e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 2.72688e-016 1 -0.783612 -1 -0.783612 1 -5.95213e-016 -1 -1.10819 1
0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1 0.783612 -1 0.783612 1
0.522408 -0.333333 -0.522408 1 0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1
2.14085e-016 -0.333333 0.738796 1 -0.522408 -0.333333 0.522408 1 -0.738796 -0.333333 2.02203e-016 1
-0.522408 -0.333333 -0.522408 1 -3.96809e-016 -0.333333 -0.738796 1 0.522408 -0.333333 -0.522408 1
0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1 0.261204 0.333333 -0.261204 1
0.369398 0.333333 6.25547e-017 1 0.261204 0.333333 0.261204 1 1.07042e-016 0.333333 0.369398 1
-0.261204 0.333333 0.261204 1 -0.369398 0.333333 1.31718e-016 1 -0.261204 0.333333 -0.261204 1
-1.98404e-016 0.333333 -0.369398 1 0.261204 0.333333 -0.261204 1 0.369398 0.333333 6.25547e-017 1
0.261204 0.333333 0.261204 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1]

NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 2.23607 2.23607 2.23607 2.23607] 0 2.23607 "Pw" [0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1
0.783612 -1 0.783612 1 3.21127e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 2.72688e-016 1 -0.783612 -1 -0.783612 1 -5.95213e-016 -1 -1.10819 1
0.783612 -1 -0.783612 1 1.10819 -1 6.51994e-017 1 0.783612 -1 0.783612 1
0.522408 -0.333333 -0.522408 1 0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1
2.14085e-016 -0.333333 0.738796 1 -0.522408 -0.333333 0.522408 1 -0.738796 -0.333333 2.02203e-016 1
-0.522408 -0.333333 -0.522408 1 -3.96809e-016 -0.333333 -0.738796 1 0.522408 -0.333333 -0.522408 1
0.738796 -0.333333 6.3877e-017 1 0.522408 -0.333333 0.522408 1 0.261204 0.333333 -0.261204 1
0.369398 0.333333 6.25547e-017 1 0.261204 0.333333 0.261204 1 1.07042e-016 0.333333 0.369398 1
-0.261204 0.333333 0.261204 1 -0.369398 0.333333 1.31718e-016 1 -0.261204 0.333333 -0.261204 1
-1.98404e-016 0.333333 -0.369398 1 0.261204 0.333333 -0.261204 1 0.369398 0.333333 6.25547e-017 1
0.261204 0.333333 0.261204 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1
0 1 6.12323e-017 1 0 1 6.12323e-017 1 0 1 6.12323e-017 1]

NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 1 1 1 1] 0 1 "Pw" [0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0.261204 -1 -0.261204 1 0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1
1.58307e-016 -1 0.369398 1 -0.261204 -1 0.261204 1 -0.369398 -1 1.62571e-016 1
-0.261204 -1 -0.261204 1 -2.49669e-016 -1 -0.369398 1 0.261204 -1 -0.261204 1
0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1 0.522408 -1 -0.522408 1
0.738796 -1 -1.82408e-017 1 0.522408 -1 0.522408 1 3.16613e-016 -1 0.738796 1
-0.522408 -1 0.522408 1 -0.738796 -1 3.25142e-016 1 -0.522408 -1 -0.522408 1
-4.99337e-016 -1 -0.738796 1 0.522408 -1 -0.522408 1 0.738796 -1 -1.82408e-017 1
0.522408 -1 0.522408 1 0.783612 -1 -0.783612 1 1.10819 -1 -2.73611e-017 1
0.783612 -1 0.783612 1 4.7492e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 4.87713e-016 1 -0.783612 -1 -0.783612 1 -7.49006e-016 -1 -1.10819 1
0.783612 -1 -0.783612 1 1.10819 -1 -2.73611e-017 1 0.783612 -1 0.783612 1]

NuPatch 11 4 [-2 -2 -1
0 1 2 3 4 5 6 7 8 9 10 10] 0 8 4 4 [0 0 0 0 1 1 1 1] 0 1 "Pw" [0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0 -1 0 1 0 -1 0 1 0 -1 0 1
0.261204 -1 -0.261204 1 0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1
1.58307e-016 -1 0.369398 1 -0.261204 -1 0.261204 1 -0.369398 -1 1.62571e-016 1
-0.261204 -1 -0.261204 1 -2.49669e-016 -1 -0.369398 1 0.261204 -1 -0.261204 1
0.369398 -1 -9.12038e-018 1 0.261204 -1 0.261204 1 0.522408 -1 -0.522408 1
0.738796 -1 -1.82408e-017 1 0.522408 -1 0.522408 1 3.16613e-016 -1 0.738796 1
-0.522408 -1 0.522408 1 -0.738796 -1 3.25142e-016 1 -0.522408 -1 -0.522408 1
-4.99337e-016 -1 -0.738796 1 0.522408 -1 -0.522408 1 0.738796 -1 -1.82408e-017 1
0.522408 -1 0.522408 1 0.783612 -1 -0.783612 1 1.10819 -1 -2.73611e-017 1
0.783612 -1 0.783612 1 4.7492e-016 -1 1.10819 1 -0.783612 -1 0.783612 1
-1.10819 -1 4.87713e-016 1 -0.783612 -1 -0.783612 1 -7.49006e-016 -1 -1.10819 1]



続いて、次のスクリプトをguileで実行します。
simple4.scmで保存します。


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

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

(RiBegin "")
(RiOption "Render" (list "integer multipass" 1))
(RiHider "hidden" (list "depthfilter" "midpoint"))
(RiDisplay "simple4.tif" "file" "rgb")
(RiFormat 512 384 1)
(RiProjection "perspective" '("fov" 30))
(RiTranslate 0 0 3)
(RiRotate -40 1 0 0)
(RiRotate -20 0 1 0)
(RiPixelFilter RiGaussianFilter 2 2)
(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.3))
(RiAttributeBegin)
(RiAttribute "autoshadows" (list "string shadowmapname" "autoshadow.shad" "integer res" 1024))
(RiTranslate 5 5 -5)
(RiRotate -45 0.0 1.0 0.0)
(RiRotate 35 1.0 0.0 0.0)
(define light1 (RiLightSource "shadowspot" (list "intensity" 300
"coneangle" 0.5
"string shadowname" "autoshadow.shad"
"float blur" 0.008 )))
(RiAttributeEnd)
(RiIlluminate light1 1 )
(RiAttributeBegin)
(RiTransformBegin)
(RiColor (Color 0.8 0.8 0.8))
(RiSurface "plastic")
(RiPolygon 4 (list "P" #f32(-1 -0.5 -1 -1 -0.5 1 1 -0.5 1 1 -0.5 -1)))
(RiTransformEnd)
(RiTransformBegin)
(RiColor (Color 0.8 0.4 0.2))
(RiSurface "plastic")
;;(RiRotate -90 1 0 0)
(RiScale 0.5 0.5 0.5)
(RiTranslate 0 0.2 0)
(RiReadArchive "cone.rib" (list ))
(RiTransformEnd)
(RiAttributeEnd)
(RiWorldEnd)
(RiEnd)

RenderMan | - | -

Guile RMan #11 くりかえし処理その4

sin、cosを利用した。半径1の円周上に球体を12個、配置した。
色は乱数を発生させた。
sphere8.jpg
sphere8r.jpg


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

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

(RiBegin "test8.rib")
(RiDisplay "sphere8.tif" "file" "rgb")
(RiFormat 640 480 1)
(RiProjection "perspective" '("fov" 40.0))
(RiTranslate 0 0 4)
(RiPixelFilter RiBoxFilter 1 1)
(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.2))
(RiLightSource "distantlight" (list "intensity" 1.2
"uniform point from" (Point 3 3 -3)))

(define (test x)
(define N1 12)
(define PI 3.141592)
(set! *random-state* (random-state-from-platform))
(let ((n 0))
(while (< n x)
(RiTransformBegin)
(RiTranslate (sin (* 2 (/ PI N1) n)) (cos (* 2 (/ PI N1) n)) 0 )
(RiColor (Color (random 1.0) (random 1.0) (random 1.0)))
(RiSurface "plastic")
(RiSphere 0.25 -0.25 0.25 360)
(set! n (+ n 1))
(RiTransformEnd)
)))

(test 12)

(RiWorldEnd)
(RiEnd)

RenderMan | - | -

Guile RMan #10 くりかえし処理その3

guileで乱数を発生させた。毎回変化させるには、
(set! *random-state* (random-state-from-platform))
を記述しておいた。
(RiColor (Color (random 1.0) (random 1.0) (random 1.0)))
たぶん、0から1までの乱数と思われる。
sphere7r.jpg
sphere7r2.jpg


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

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

(RiBegin "test7.rib")
(RiDisplay "sphere7.tif" "file" "rgb")
(RiFormat 640 480 1)
(RiProjection "perspective" '("fov" 40.0))
(RiTranslate 0 0 6)
(RiPixelFilter RiBoxFilter 1 1)
(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.2))
(RiLightSource "distantlight" (list "intensity" 1.2
"uniform point from" (Point 3 3 -3)))

(define (test x)
(define posx -3)
(set! *random-state* (random-state-from-platform))
(let ((n 0))
(while (< n x)
(RiTransformBegin)
(set! posx (+ posx 1 ))
(RiTranslate posx 0 0 )
(RiColor (Color (random 1.0) (random 1.0) (random 1.0)))
(RiSurface "plastic")
(RiSphere 0.5 -0.5 0.5 360)
(set! n (+ n 1))
(RiTransformEnd)
)))

(test 5)

(RiWorldEnd)
(RiEnd)

RenderMan | - | -

Guile RMan #9 くりかえし処理その2

球体の色を徐々に変化させてみた。
guile-rmanとAqsis1.6 (CentOS6.4 64bitで稼働。)
sphere70.jpg


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

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

(RiBegin "test7.rib")
(RiDisplay "sphere7.tif" "file" "rgb")
(RiFormat 640 480 1)
(RiProjection "perspective" '("fov" 40.0))
(RiTranslate 0 0 6)
(RiPixelFilter RiBoxFilter 1 1)
(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.2))
(RiLightSource "distantlight" (list "intensity" 1.2
"uniform point from" (Point 3 3 -3)))

(define (test x)
(define posx -3)
(define col 0.2)
(define col2 0.9)
(let ((n 0))
(while (< n x)
(RiTransformBegin)
(set! posx (+ posx 1 ))
(RiTranslate posx 0 0 )
(set! col (+ col .2))
(set! col2 (- col2 .2))
(RiColor (Color col .2 col2))
(RiSurface "plastic")
(RiSphere 0.5 -0.5 0.5 360)
(set! n (+ n 1))
(RiTransformEnd)
)))

(test 5)

(RiWorldEnd)
(RiEnd)

RenderMan | - | -

Guile RMan #8 くりかえし処理その1

関数を定義し、繰り返し処理を行いました。
sphere6.jpg
いろいろできそうです。


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

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

(RiBegin "test6.rib")
(RiDisplay "sphere6.tif" "file" "rgb")
(RiFormat 640 480 1)
(RiProjection "perspective" '("fov" 40.0))
(RiTranslate 0 0 6)
(RiPixelFilter RiBoxFilter 1 1)
(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.2))
(RiLightSource "distantlight" (list "intensity" 1.2
"uniform point from" (Point 3 3 -3)))

(define (test x)
(define posx -3)
(let ((n 0))
(while (< n x)
(RiTransformBegin)
(set! posx (+ posx 1 ))
(RiTranslate posx 0 0 )
(RiColor (Color .9 .1 .1))
(RiSurface "plastic")
(RiSphere 0.5 -0.5 0.5 360)
(set! n (+ n 1))
(RiTransformEnd)
)))

(test 5)

(RiWorldEnd)
(RiEnd)



(use-modules (rman ri2rib))
を使うと空のRIBが出るだけで、課題です。
以下、エラー。
guile: symbol lookup error: /usr/local/lib/libguile_rman_ri2rib.so: undefined symbol: RifGetDeclaration
RenderMan | - | -

Guile RMan #7 AutoShadow

Aqsis1.6では、
Attribute "autoshadows" "string shadowmapname" ["autoshadow.shad"] "integer res" [600]
を利用して、影の自動生成を行います。

これと、もう一つ
Option "Render" "integer multipass" [1]
がないと、シャドウマップは生成されません。

simple3.jpg
以下、Aqsis1.6.0のサンプルautoshadow.ribを参考にしました。


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

(RiBegin "illum2.rib")
(RiOption "Render" (list "integer multipass" 1))
(RiHider "hidden" (list "depthfilter" "midpoint"))
(RiDisplay "illum2.tif" "file" "rgb")
(RiFormat 512 384 1)
(RiProjection "perspective" '("fov" 30))
(RiTranslate 0 0 3)
(RiRotate -40 1 0 0)
(RiRotate -20 0 1 0)
(RiPixelFilter RiGaussianFilter 2 2)
(RiWorldBegin)
(RiLightSource "ambientlight" (list "intensity" 0.3))
(RiAttributeBegin)
(RiAttribute "autoshadows" (list "string shadowmapname" "autoshadow.shad" "integer res" 4096))
(RiTranslate 5 5 -5)
(RiRotate -45 0.0 1.0 0.0)
(RiRotate 35 1.0 0.0 0.0)
(define light1 (RiLightSource "shadowspot" (list "intensity" 300
"coneangle" 0.5
"string shadowname" "autoshadow.shad"
)))
(RiAttributeEnd)
(RiIlluminate light1 1 )
(RiAttributeBegin)

(RiTransformBegin)
(RiColor (Color 0.8 0.8 0.8))
(RiSurface "plastic")
(RiPolygon 4 (list "P" #f32(-1 0 -1 -1 0 1 1 0 1 1 0 -1)))
(RiTransformEnd)

(RiTransformBegin)
(RiColor (Color 0.8 0.4 0.2))
(RiSurface "plastic")
(RiRotate -90 1 0 0)

(RiScale 0.2 0.2 0.2)
(RiGeometry "teapot")
(RiTransformEnd)

(RiAttributeEnd)
(RiWorldEnd)
(RiEnd)



"integer res" 1024
"float blur" 0.008
と調整してみた。


(RiAttributeBegin)
(RiAttribute "autoshadows" (list "string shadowmapname" "autoshadow.shad" "integer res" 1024))
(RiTranslate 5 5 -5)
(RiRotate -45 0.0 1.0 0.0)
(RiRotate 35 1.0 0.0 0.0)
(define light1 (RiLightSource "shadowspot" (list "intensity" 300
"coneangle" 0.5
"float blur" 0.008
"string shadowname" "autoshadow.shad"
)))
(RiAttributeEnd)


illum3.jpg
RenderMan | - | -

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
が出ますがレンダリングできました。
RenderMan | - | -

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)

RenderMan | - | -

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)

RenderMan | - | -
1/15 >>