We define our sphere shape as in the first tutorial however the only difference is in the bsdf which has a different color for each sphere. The three spheres are defined as follows:
< !-- Setup blue sphere -- >
< shape type="sphere" >
< float name="radius" value="0.1"/ >
< transform name="toWorld" >
< translate x="0.0" y="0" z="0.0"/ >
< / transform >
< bsdf type="plastic" >
< srgb name="diffuseReflectance" value="#0000ff"/ >
< float name="intIOR" value="1.9"/ >
< / bsdf >
< / shape >
< !-- Setup green sphere -- >
< shape type="sphere" >
< float name="radius" value="0.1"/ >
< transform name="toWorld" >
< translate x="-0.2" y="0" z="0"/ >
< / transform >
< bsdf type="plastic" >
< srgb name="diffuseReflectance" value="#00ff00"/ >
< float name="intIOR" value="1.9"/ >
< / bsdf >
< / shape >
< !-- Setup red sphere -- >
< shape type="sphere" >
< float name="radius" value="0.1"/ >
< transform name="toWorld" >
< translate x="0.2" y="0" z="0"/ >
< / transform >
< bsdf type="plastic" >
< srgb name="diffuseReflectance" value="#ff0000"/ >
< float name="intIOR" value="1.9"/ >
< / bsdf >
< / shape >
Lets look at one of the sphere's brdf properties in detail. The type for the bsdf in this case is plastic. The diffuseReflectance is the color of the material. If you look at Mitsuba documentation, this property is defined as a spectrum type. There are many ways to define a spectrum. We define it here as a hexadecimal srgb value. We could also define colors in rgb space (for e.g. blue with value="0.0,0.0,1.0") which would give the same output. The last parameter is the interior index of refraction. The rest of the scene elements are the same as in the previous checkered plane tutorial.
One neat feature of the Mistuba front end mtsgui is that it allows us to change the integrator type in real-time using the render settings options (the gear icon in the GUI) as shown below.
Render settings in mtsgui |
Adjoint path tracer [3.5970 secs @ 640x480] |
Bidirectional path tracing [22.8360 secs @ 640x480] |
Ambient occlusion [2.2860 secs @ 640x480]
The full scene XML file may be downloaded from here: https://www.dropbox.com/s/d7z5rpc5sgwmcpe/checkeredPlaneRGB_spheres.xml
You should play around with different render settings and integrators to see their effect on the rendering output.
|
No comments:
Post a Comment