I am using Blender's particle system to try to voxelize my mesh. I'd like to color the voxels based on the diffuse color of the textured mesh at the closest location to each voxel. This is an image that shows what I'm trying to do:
This Stack Exchange post explains how to color emitted particles based on the mesh from which they are emitted. The technique uses the "jittered" emission setting:
Using the technique in the post I linked to, here is what I get with "jittered" selected. You can see that the emitted cubes correctly match the color of the mesh:
When I change the emission setting to "grid", the cubes no longer match the color of the object:
I'd like to use the "grid" emission setting for voxelization, but can't figure out how to get the color of the emitted particles to correctly match the color of the mesh.
This is what my shader nodes look like for the cube which I am using as the dupli object:
I'd appreciate any help with this! Please let me know if there's something I can clarify.

























