Z-Buffer, Reflections and Defocus Node

Blender's renderer and external renderer export

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Tue Feb 28, 2006 12:30 pm
Location: Malaysia

Z-Buffer, Reflections and Defocus Node

Post by mdique77 »

I was experimenting with the Defocus Node to find out more about its capabilities and limitations. I must say it is impressive, although only am approximation.
Something that I encountered that was interesting was the issue of Z-buffer for raytraced reflections. It seems that blender's ray tracer sets the Z value for the pixel based on the surface the algorithm first hits rather than the last surface the ray tracer stops at. This in effect causes reflections to look like they were "pasted" on to the surface when the defocus node is used because the Z value is essentially wrong. (Sort of)
If we were to set the Z-value to the last surface the ray-tracer stops at, then there is a problem of all the contributed pixel values that the intermediate reflections give at different Z positions along the ray-trace path.
I thought of some possible solutions. One, we can provide a setting on the material that can let us choose how many levels deep (of reflections) to set the Z for a pixel of a ray traced material. Two, we can buffer all the Z -values of all the interreflections of each pixel and have the defocus node blur them separately. Three, we can just set the Z of ray traced materials to the last surface.
I feel that Option 2 is the "coolest" but sounds like a major rewrite. I dont have much knowledge of the blender source code.
Anyone have any suggestions or comments?


Posts: 18
Joined: Fri Oct 25, 2002 9:32 am

Post by pildanovak »

i think the idea isn't bad, but what you propose isn't really logical. Since if you set the Z of a raytraced material to the length of the total ray, you get the same problem with defocus, just turned around. Maybe there could be an option to have an user - specified number of z buffers+reflected color passes, each for 1 ray bump(usually probably only 1). That maybe could help, but I think it's not a feature which would be really used. I don't know about any other renderer supporting something like that.

Post Reply