1
1
#!/usr/bin/env python
2
- # on mac I'm using rmanpy which is 2.7 so best to be safe
3
- from __future__ import print_function , division
2
+
4
3
import sys
5
4
import os
6
5
import time
@@ -50,6 +49,19 @@ def createSphere(scene, group):
50
49
scene .Root ().AddChild (quadric )
51
50
52
51
52
+
53
+ def buddha (scene ,group ,ri ) :
54
+ #ri.ReadArchive("buddha.zip!buddha.rib",None)
55
+ #Procedural(self, data, bound, sfunc, ffunc)
56
+ white = scene .CreateMaterial (None )
57
+ bxdf = rman .scenegraph .Shader ("Bxdf" , "PxrDiffuse" , "white" )
58
+ bxdf .params .SetColor ("diffuseColor" , (0.8 , 0.8 , 0.8 ))
59
+ white .SetBxdf (bxdf )
60
+ bound = [- 20.5 ,20.5 ,- 20.5 ,20.5 ,- 20.5 ,20.5 ]
61
+ ri .Procedural (["teapot.rib" ],bound ,"ProcDelayedReadArchive" ,None )
62
+
63
+
64
+
53
65
def cornellBox (scene , group ):
54
66
55
67
# Create scene materials: white, red, and green
@@ -109,14 +121,15 @@ def cornellBox(scene, group):
109
121
110
122
# Set scene options
111
123
options = rman .Types .RtParamList ()
112
- options .SetString (Constants .k_bucket_order , "circle" )
124
+ # options.SetString(Constants.k_bucket_order, "circle")
113
125
options .SetIntegerArray (Constants .k_Ri_FormatResolution , [1024 , 1024 ], 2 )
114
126
options .SetFloat (Constants .k_Ri_FormatPixelAspectRatio , 1.0 )
115
127
options .SetFloat (Constants .k_ShadingRate , 1.0 )
116
128
options .SetFloat (Constants .k_Ri_PixelVariance , 0.1 )
117
129
130
+
118
131
options .SetString (Constants .k_searchpath_archive , "../../Lecture3/assets/:@" )
119
- options .SetString (Constants .k_searchpath_shader , "./:@" )
132
+ options .SetString (Constants .k_searchpath_shader , "../../Lecture3Lighting /:@" )
120
133
121
134
scene .SetOptions (options )
122
135
@@ -140,6 +153,7 @@ def cornellBox(scene, group):
140
153
141
154
cornellBox (scene , group )
142
155
createSphere (scene , group )
156
+ buddha (scene ,group ,riContext )
143
157
144
158
# Create render camera and parent under a group
145
159
cameraGroup = scene .CreateGroup ("cameraGroup" )
0 commit comments