#Zbuffer IXP in DL1
30 messages in this thread
Hello all r4 mutants!
You might've noticed that I uploaded the following IXP to DL1 a couple
of days ago:
SEEZ.ZIP/Bin Bytes: 24924, Count: 92, 09-Nov-94 Last:12-Nov-94
Title : Zbuffer IPAS IXP plugin for 3DSr4 from Yost Group
Keywords: SEEZ ZBUFFER ACCESSOR IPAS IXP REQUIRES 3DSR4 YOST GROUP
This zip file contains SEEZ.IXP, a public domain IPAS routine by Tom Hudson
of the Yost Group that will let you access the z-buffer inside of 3DSr4 for
interesting compositing effects in the Video Post system. It also includes
the source code for the routine (SEEZ.C) for IPAS developers to use as a
learning aid for accessing the z-buffer with their own applications.
—
If you hadn't noticed, and if you're interested in playing around with
z-buffer effects, check it out.
– G
<< mutant alert! >>
I'll put a copy into Software Dev Kits too.
My thanks to Tom!
Now we just need Martin to compose an IXP sample script that accomplishes the
same task <g>.
– Phil
Gary,
>> access the z-buffer inside of 3DSr4 for interesting compositing effects in
the Video Post system. <<
sounds highly interesting. Any ideas what an end-user, video-post hack might
use it for? Or is that for us to find out <g>?
Run it and you'll discover that it's the PERFECT tool for creating bump maps
that relate to geometry, or an equally valuable method for creating a masking
selection (that fades according to distance) for use in a paint package.
– Phil
Thanks for the upload!
Phil,
<bump maps that relate to geometry>
Does this imply that you could build real displacement maps using the
Z-buffer?
Sanford
What I meant was that you can "model" a bump map fairly easily. Say yuo wanted
a bitmap that produced a bump of a series of balls around a clock face. Without
too much thought, you could quickly make a cylinder and array a series of
GSspheres around it, letting them intersect the cylinder as much as you want
them to "bump" out in the map. Now go into video post (there's no need for
lighting!) and render the perpendicular viewport. You now have grey scale map
that corresponds to the distance the objects were from you – an bump map of
balls pushing through a round face.
Now I bet you were searching for a way to do true displacement mapping –
actuallly changing the profile of a mesh. Well, in the hands of a good IPAS
prograrmer that could be possible now that R4 gives them access to the
Z-Buffer. For example, Digimation's new LenzEFX package effects glows around
objects based upon the Z-Buffer – allowing you to exapand the glow as far as
you wish from the surface of the mesh.
– Phil
<true displacement map> Phil,
Nothing would please me more! Its no fun to put a bump map on some
object, and then have to look at a totally smooth edge. It ruins the illusion.
Since 3D Studio gave up trying to output RIB files, we have no way to do
displacement texture maps.
The Displace ipas is more like a toy compared to Renderman's
displacement maps which can wrap around the sides of any object.
Boy, I wish I had taken more programming. But, when would I have the
time to animate? Do you know anybody who can write a RIB spec file from a 3DS
file?
Sanford
Hey Phil,
I loved your z-buffer/bump map trick! I have used it for the displace.ipas but
not a bump.
Glenn Zephyr
Phil,
>> PERFECT tool for creating bump maps that relate to geometry, or an equally
valuable method for creating a masking selection <<
cool stuff, indeed 🙂 I'm going to try it out.
In addition to Phil's excellent technique for making bump-maps, the z-buffer
gives you a depth mask that you can use for compositing, so you can do your own
atmosphere-like effects. David Stinnett has this method down cold, so if he's
around, he could explain it for ya.
– G
Gary,
>> In addition to Phil's excellent technique for making bump-maps, the z-buffer
gives you a depth mask that you can use for compositing <<
that sounds _very_ useful. David Stinnett explains the manual method of this in
the "3d Studio Special Effects" book.
This stuff sounds great, Gary.
I hope DavidS jumps in and elaborates a little for everyone…
David?
-Alan
>>I hope DavidS jumps in and elaborates a little for everyone…
What, and spoil the suprise? Ok, time for a shameless plug… All the
details are in chapter 12 of "3D Studio special effects" <g>
Using the Z-buffer as a mask in video post, an object can be made to
fade into the background or layer behind it. I think the best results would
come from using a matte rendered with a white matte material and distance
cueing, instead of the true Z-buffer image as derived from the Seez IPAS. (see
my note to Gary).
Sorry, I can't really go into much detail now, but I do go into extreme
detail on this method in the book, so anyone interested should definately have
a look.
David
Thanks, David…
-Alan
Hi Gary,
Is it me or is the resulting Z-Buffer image non-antialiased? I did a test
render with the IPAS (Thanks very much for it BTW (G)) using balls.3ds and
found the edges jaggy. Have I missed something.
Thanks. Glenn Zephyr.
I can understand your confusion, but it isn't you. There isn't supposed to be
any antialiasing in a z-buffer.
Consider this. In the z-buffer, a pixel can have any number of surfaces inside
of it, but only the nearest surface's distance is recorded. How would
antialiasing be possible? You could certainly have a finer-resolution z-buffer
than 8-bits (since the z-buffer info is stored as a floating-point number), but
you'd have to have an IXP that wrote it out in higher bit-depth (24, for
example) and then an application that could use that extra info.
– G
<<Consider this. In the z-buffer, a pixel can have any number of surfaces
inside of it, but only the nearest surface's distance is recorded. How
would antialiasing be possible?>>
Doop! Of corse you gotta realise I had my zany swirling animator's bowtie on
when I asked that stupid question.
Thanks for the clarification Gary.
Glenn Zephyr.
If you want "anti-aliased" Z-buffer values, you just interpolate between the
depths between adjacent pixels. It's as good as most anti-aliasing…
That would certainly be straightforward to do, in both an IXP or the upcoming
IXP scripting language from KUB.
– G
>>atmosphere-like effects. David Stinnett has this method down cold, so if
he's around….
Hi Gary,
I'm still checking in when I can (which isn't near as often as
I would like). I DL'ed the Z-buffer IPAS and it seems it will -not-
work for doing the comp effects you mentioned. For a matte (mask) to
work properly, it really HAS to be anti-aliased, or else you end up
with artifacts around the edges of the objects you are trying to
composite, resulting in a bad looking image (doing a comp using an
anti-aliased image with a non anti-aliased alpha channel just doesn't
work). Aside from that problem, Is there any way to control what
color values are used in the z-buffered image? I only played with it
a bit, but it seemed (in a single object scene) that no matter how
far away from the camera the object was, the closest parts of the
object were still pure white. shouldn't the object fade out as it
gets further from the camera? (in absolute space, not just from the
start and end of the object). Unless there was control over that,
trying to, for example, make an object dissapear into the clouds
wouldn't work, because the object would never fade to black.
Using the good ol' fashoned white matte material and distance
cueing still seems like the best option for making a depth matte for
use with compositing. (at this moment, anyway)
Good point. What you really need for z-buffer compositing effects is
an IXP that does some filtering around the objects.
Here's what's actually going on in SEEZ. SEEZ takes the 'zmin' and
'zmax' values from the FrameParm structure, then normalizes the
values between the z minimum and z maximum to range from 255-0.
That's why SEEZ causes the nearest part of the objects in the scene
to be bright white. If the code is altered with some arbitrary
near/far values, the objects will get dimmer as they recede. (Tom
wrote SEEZ this way so that he could mess around with random dot
stereograms.)
To summarize, each pixel's Z value reflects the distance from the
camera to the nearest object fragment in that pixel. If the view is
not a camera, then the Z value in the pixel is not the distance from
the viewer (since the view is orthographic, there is no viewpoint)
but the distance from the point being looked at. In orthographic
views, Z values can be negative.
True, this can cause aliasing to occur if simple compositing is done,
and won't work well for transparent objects, but with some filtering,
it can work very effectively. This is what the folks at Digimation
are probably doing to get their depth-of-field zbuffer-based routine,
and it's also why I put the source code to SEEZ in the zip file… so
other developers could take the concepts and run with them (a la
Digimation).
Thanks for the info on Seez and the Z-buffer. It's good to know that
programmers can use the data and change it to suit their needs. I can't wait
for some of these new routines to start popping up.
David
I'm _really_ looking forward to the new depth-of-field IXP.
– G
The depth-of-field Z focus from the Lenzfx package should be available in
Decemeber. I finished most of the work for that a few weeks back and it looks
great. You can focus in on any part of a scene, have the camera AUTO-FOCUS to
its target, or track focus on an object (or dummy object) as it moves. Z focus
also lets you set the F stop or depth of blur for the camera so you can define
how quickly objects go out of focus based on distance from the focal point. It
all adds great photorealism to renderings.
Aaron
Auto-focus? You're making me drool.
Reaching for a kleenex,
– G
Me too, but I hear it is very time consuming to process. I also hope
the price is reasonable. I just found out the price of Rayman…. $1000! I
guess I won't be getting that one.
David
The rendering times for the Z focus are dependant on how blurry the image is,
and which of the two different blur algorithms is used, but they are pretty
quick. Most of my test renderings are under 10-15 seconds. The longest I ever
had was still under one minute (on a Pentimum 90).
The price of Lenzfx is $295. Which includes the Z-focus, lens flare, aura and
starlight effects.
Aaron
Thanks for the info.
David
Thanks for the message posting !
I would not have seen this in the library for quite a while.
Bruce N. Goren