ANN: Examples for Physically Based Rendering

After reading this impressive article: Introducing Physically Based Rendering with VTK. I created a couple of examples (both in C++ and Python) that (I hope) capture most of what has been written in the articles.

In the examples you can select different surfaces to visualise: Boy’s Surface (default), Mobius Strip, Torus, Sphere and Cube. The non-orientable surfaces are interesting e.g. in the case of Boy’s Surface on the left side you see reflections of the sky even though the surface is angled to the ground at that point.

You can also select different skyboxes, the images are found in VTKExamples/Testing/Data/skyboxes/. Try different skyboxes! For texturing the images are found in VTKExamples/Testing/Data/

Here are the C++ examples, links to the corresponding Python examples can be found on these pages:

  1. Skybox_PBR
    These sliders set metallicity and roughness of the object:

  2. PhysicallyBasedRenderingTestPhysicallyBasedRendering

    Here texturing is used to generate lighting effects. The sliders allow you to adjust: metallicity, roughness, occlusion strength and normal scaling


Impressive work, impressive examples. Thanks for doing this @amaclean !

Awesome, thank you @amaclean !
I would be very happy to have your feedback regarding PBR. Did you have difficulty using it? Is the documentation sufficient? Is everything clear in the blog article?

@Michael, in relation to the first example, the documentation was pretty clear and straightforward. I must admit, I was pretty pleased when it all worked and the results looked so beautiful.

In relation to the texturing example I had to feel my way a bit, I searched the VTK repository to find the textures used in the picture in the article. I was also unfamiliar with the terminology. My biggest problem was finding an emissive texture so I used Photoshop to modify the VTK logo and convert it to a black background. You will see I kept the bars around the letters as they gave me an indication of the lighting colour when setting the emissive factor.

With respect to the sources used, it was interesting to do uv-texturing on the parametric surfaces. Once I figured this out, the texturing of these surfaces was easy! For debugging texturing I found your files: tex_debug.jpg and vtk_Base_Color.png useful.

I learned a lot from your well written article.

One other big bonus from the work you guys have done is that it was really simple to convert the C++ code to Python as you can see in the examples.

@Michael it goes without saying that if the examples can be enhanced/improved please submit merge requests.

Thank you for the feedback and I will definitely have a look at your examples code when I find the time.