Advertisement

You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

Converting texture data pixels to voxels in Blender

9

Noah Paessel scripted an add-on to generate 'voxel' type images from bitmaps.

It all started when I wanted to grab some colors from Vincent Van Gogh for use in one of my renders. I figured it should be possible to convert pixels into voxels, and using Blender's Python API, it was pretty easy. This technique might have general appeal, so I created a video tutorial for it.

The python script reads pixels RGB values from an texture image you specify by name. It then creates a new diffuse shader material of the same color for each pixel (wasteful!), and final it creates a rectangular prism at x,y coordinates, whose hight is determined by the pixels intensity.
Thanks for checking it out!

About the Author

Avatar image for Bart Veldhuizen
Bart Veldhuizen

I have a LONG history with Blender - I wrote some of the earliest Blender tutorials, worked for Not a Number and helped run the crowdfunding campaign that open sourced Blender (the first one on the internet!). I founded BlenderNation in 2006 and have been editing it every single day since then ;-) I also run the Blender Artists forum and I'm Head of Community at Sketchfab.

9 Comments

  1. nice script!
    the resulting renders look pretty slick. :)

    would be awesome btw. if we could work with actual voxel grids like this in blender

  2. awesome thing. instead of a new material per cube i would suggest to use vertex colors and one material, that uses the vertex colors as input.

  3. Cool, but these aren't voxels. Voxels are 3D pixels, forming a 3D grid. This is just a 2D grid with a height property. A smoke simulation, for example, has voxels, or a mesh remeshed with the Octree modifier in "Blocks" mode.

  4. Mircea Kitsune on

    As someone highly interested in voxels, I approve of this post. But I wish Blender had better voxel systems... such as a marching cubes algorithm builtin. Guess we have to stick with metaballs for now.

    • Zachman asked about this on blender.stackexchange and the tests I ran showed that a mesh (which can be vertices only) using dupliverts for a cube is the quickest way to perform this duplication task.

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Advertisement

×