I have rendered an object using a number of composite output nodes : color, depth.
Now I would like to render it again but this time the color of the surface of the object should
be equal to the xyz coordinate at that point. Or some scaled version of it.
How can I do this? I thought it should be easy to define a custom GLSL material in blender
but I cant figure out how to do it.
It in fact is not that difficult. I’m sure you know the concept of “Material Override” for render layer, right?
Below you’ll see the setup of the shader (left) and setup of the render layer where you need to use the shader like on the left part of the image as material override.
When you render this you’ll get XYZ positions of the pixels - all values (negative and positive) included. All will be measured in blender units.
In Blender internal however it doesn’t work well, because the values below zero get clamped. In order to get the proper values you need to add something to “Global” output of geometry node. I usually add something ridiculous like 1000. Then I subtract the same value in compositing.