Learn creative coding writing simple programs

153. Rendering Processing shapes in Blender

After the two previous episodes, in which we created a 3D shape in Proccesing and exported it as .obj file, we are ready to import that shape into Blender and render a realistic looking image.

These are the steps we take to get our render ready:

1. Import the .obj file into Blender
2. Clean up the imported model by deleting a huge rectangle that somehow grew in one side. Maybe it was caused by using lights() in Processing, or some kind of bug.
3. Adjust the view. We move and rotate the objects and the camera around to make a composition we are happy with.
4. Add a background plane that will receive the shadows of our galaxy object and also reflect sun light.
5. Replace the default light with a proper sun, which seems to produce better results. Try different lights yourself!
6. Add simple materials to the plane and to the galaxy to set colors for them.
7. Do some color management. Choose the look of the render by simulating different film styles. Basically it adjust the color range and tints the whole scene. This can add a nice touch to the result.
8. Do test renders and one final render with a higher sample value. Increasing the samples improves the quality, reduces noise, and makes it much slower too. Find the balance.
9. Save and enjoy the rendered image.

If you didn't do so already, I recommend you watch the Blender beginner tutorials at:
http://cgcookie.com/blender/cgc-courses/blender-basics-introduction-for-beginners/ :)

Tags: blender, obj, render

Code editor

You can make changes to the code below. Then
Reference

Questions and comments

Try to stay close to the topic of this episode. Use the Processing forums for help with unrelated Processing projects (or hire me for help ;-)

To indicate that a word in your comment is code, use the `backtick`. Example
Do `float` and `int` smell similar?
To highlight code blocks, surround it with ``` code-fences ``` like this:
``` void setup() { size(600, 600); } ```