Could you put here a quick Z buffer explanation?

General Moho topics.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Rai López
Posts: 2234
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Could you put here a quick Z buffer explanation?

Post by Rai López »

I Only want to konw something about that becase I 'm very intrigATED...
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

A Z buffer is one way of drawing objects in 3D. For every pixel, you normally have red, green, and blue (RGB). With a Z buffer, you also have a Z (or depth) value.

As a 3D renderer draws an object, it first checks the Z value of every pxiel the object overlaps. If the object is closer to the viewer than the current Z value, then it is considered visible at that pixel, and the pixel is replaced with that object's RGBZ values.

If the object is further away than the current pixel's Z value, then that pixel is left alone. This allows the renderer to combine many different 3D objects so that nearer ones are displayed on top of more distant ones. The order the objects are drawn does not matter, since that is all sorted out pixel by pixel using the Z buffer.

Moho uses a Z buffer algorithm for displaying 3D layers. That's why 3D layers can move in front of and behind each other without any special layer ordering. However, there are a few cases where you might want to play around with 3D layers and ordering. In the 3D Options tab for 3D layers, you can choose to clear the Z buffer. This means the Z buffer will be cleared befor edrawing that layer, and will start accumulating once again after that.

We'll be posting a tutorial soon that shows how you can use this option to get multi-texturing type effects in Moho. It will make more sense once this tutorial is created.
User avatar
kdiddy13
Posts: 381
Joined: Tue Aug 03, 2004 10:26 pm
Location: New Zealand
Contact:

Post by kdiddy13 »

Since you are creating a z-depth value for each pixel, would it be possible to output this z-buffer render, either as a true z-buffer (like a RLA file) or a grayscale image? That would open up all sorts of new compositing capabilities.

Please? You can't see it, but I'm giving you the puppy dog eyes (I can only imagine how that translates to our non-English speaking friends).
________
Chrysler australia specifications
Last edited by kdiddy13 on Mon Mar 07, 2011 4:56 am, edited 1 time in total.
User avatar
Lost Marble
Site Admin
Posts: 2347
Joined: Tue Aug 03, 2004 6:02 pm
Location: Scotts Valley, California, USA
Contact:

Post by Lost Marble »

The z-buffer only exists for 3D layers. Vector and image layers do not contribute to the z-buffer, so I'm not sure how useful it would be.
User avatar
Rai López
Posts: 2234
Joined: Sun Aug 08, 2004 1:41 pm
Location: Spain
Contact:

Post by Rai López »

Well, thanks for the explanation, I just can't wait to see that tutorial! :P
Post Reply