RenderMan Lego Figure

A Python script using PRMan and OSL to generate a Lego figure


Final Image

Final Image

Key Details

Made using Python, PRMan and OSL.

Master's Degree University Assignment - Currently Ungraded.

PRMan is the Python API for RenderMan.

The script has command line options for things such as colour, damage, dirt and shirt type.

Uses a HDRI for the lighting and background and OSL for the shaders.

Source code on GitHub

Online version of the documentation


This is a Python script that I created for my Rendering assignment as part of the Simulation and Rendering unit for my master’s degree. For the assignment I had to use RenderMan and its associated API to model, and render a simple scene containing a single object. I decided to use PRMan to allow me to write the script using Python as PRMan is the RenderMan API for Python. I decided to create a Lego Figure as it was made up of mostly primitive shapes and part of the brief was to create the geometry using primitives. I then used OSL (Open Shader Language) to create the shaders for the figure. The shaders created allowed the texturing and colours along with the displacement for the scratches and the hole for the Lego figure’s arm. I built in command line functions for the script that would allow the figure to have variation, with the ability to set the colour, the damage and the dirt levels. You can also choose the shirt type the shader to generate, a choice of Perlin, check, blank and camo. As the assignment required to images from different angles I also added a command to switch to an alternative angle, along with the file type to output (.rib, .exr or just render to it). This assignment was graded as a high merit.

© 2024 Jamie Slowgrove