ZBrushCentral

Stereoscopic depth

hey folks

One of the aspects of ZBrush that interests me the most is the fact that by their very nature they have depth information embedded in them. Has anyone yet tried taking this and using it to offset an image to left and right stereo views? or am I the only one here who’s enough of a nerd to come up with that idea?

At the moment I’m working on writing a little utility that will take an image and a corresponding depth map (as a greyscale image - easily obtained from ZB, I believe) and use them to create an interlaced stereoscopic image for viewing with shutterglasses or one of those 3D monitors for the folks who can afford that stuff :slight_smile:

Anyways, yeah, I was really just wondering if anyone’s tried any of this stuff already, and if so, what the outcome was

No but I think it could make some great images. Please post if you come up with something. :wink:

There was this thread (and link therein).

Your utility sounds interesting. Is it planned as a zscript or a standalone programme?

No, you say?

Nothing personal, but you’ve been here two months – any number of things might have happened before that. Like, say, the exploration of ZBrush as a means of generating stereoscopic 3D images. :smiley:

As for seperation into stereo pairs (for viewing through LCD glasses or a hand-held stereoscope), Photoshop actually does this very nicely - if you have that program, there’s little need to build a new utility. Just use the “displace” filter, and you’re good to go…

This approach does have many limits, and will never look entirely “right”. Effectively, you’re embossing depth onto a flat plane.

A simple example… Consider the following image: We’re outside, looking through a window at a family’s Thanksgiving dinner. Dad’s at the head of the table, carving a turkey. Behind him, his family waits patiently for the feast to begin…

You’d expect to see good depth in this image, but the entire indoor scene will appear completely flat, because our grayscale image had to take the window itself into consideration.

What you really want is the same scene rendered twice from slightly different positions (to represent the viewers eyes). But since we are looking at a 2.5D canvas rather than true 3D space, there’s no simple camera object to manipulate. To do this in ZBrush would mean uprooting all of your markers to offset the tools themselves. Still possible, but you may have to give up some of your 2.5D brushes to pull it off…

A word on interlacing: Don’t. Just put the right and left view next to each other in the same image, save that as a JPG, and then rename your JPG to have the JPS extension. There are plenty of browser plugins and free programs which will then interlace that for you on the fly, or convert it to any number of other display formats.

An interlaced image will only display at that resolution, on a limited number of devices. This other way grants you much more flexibility, and compatibility with more users.

Whoops, sorry… should’ve had a better look around

The photoshop method works well for creating red/blue anaglyphs, but I’m not skilled enough with it to create an interlace - at any rate, it’d certainly be a longer workflow, and my utility is fairly trivial - load source image, load depth map, set a few parameters (leading eye, depth scaling, etc) and off it goes. It’s a stand alone program in C++ - though so far all I have is a very quick prototype I whipped up last night. Had a very interesting time painting depth onto an image live in stereoscopic 3D - I don’t think Zbrush has much to fear from my little app, but wouldn’t it be awesome if ZB did support stereo natively… :smiley:

Incidentally, there are a whole bunch of different stereoscopic formats - I’ve seen both SIRDS and anaglyphs come up in the linked threads, so just a quick rundown:

SIRD - Single Image Random Dot Stereogram, a.k.a “magic eye” - needs no special equipment, but loses basically all texture/colour information from image, retaining only depth.

Parallel/Crosseye - side by side images, much like SIRDS, but retains all image information. Hard to view for most people and limited in size

Anaglyph - probably the best well known, red/blue (or sometimes other colours) - needs special (but cheap and easy to get) glasses, but loses colour information from image (although with care most can be retained)

Interlace - the approach I’m taking. Requires special LCD glasses connected to your computer which are cheaply avaliable these days (~£30). Halfs vertical image resolution but retains all other information and is very easy to write viewing software for

Page flip - also uses LCD glasses but synchronises alternate l/r frames with “shutters”. Retains all image information, but at the cost of halfing the refresh rate. Headache-o-rama on anything less than 100Hz

Pulfrich, etc - okay, now you’re getting beyond the scope of this post :stuck_out_tongue:

Anyways, now I just need to get good enough with ZBrush to make something worth viewing with depth :slight_smile:

You typed that as I was updating my last post.

Anyway, no. The photoshop method I speak of has nothing to do with anaglyph glasses. It produces a left and right eye view which can then be converted to anaglyph by messing with the channels, or they can be interlaced together if that’s what you prefer. But prior to that, your views are seperate and complete.

That’s what’s desired. A left and right image to be done with what one will. Or a whole series of images for lenticular interlacing (which leads into a whole other program – interlacing at that point is not so simple as one would hope).

Going straight to interlaced from the outset is just going limit their usefulness.

This isn’t a serious project or anything - just a little utility I’m coding to play around with the idea. Naturally I’d include seperate l/r image export, as once you have the stereo pair in that format you can twist them around any way you like. I know there are plenty of utilities that already do this stuff, but I’ve got a few ideas I’d like to try out for myself

As for creating a perfect image - well, no, you never will this way. There are many limitations to this approach, not least of which is due to the horizontal offset of your eyes/camera, you should be able to see the surface texture on one side of an object protruding almost straight forwards - information which isn’t going to exist in your original image…

… but then, that isn’t really the point, is it? If you want super realistic stereo, then you’d do it by modelling your entire scene in 3D and rendering from two viewpoints - or better yet, just take up (real) sculpting :slight_smile:

What I’m after here is something that while not perfect, is certainly close enough - and more importantly makes use of the rapid workflow and awesome power of ZBrush. Basically, my thinking is just that ZBrush produced images already natively have depth information in them, which is pretty cool… and given that it can be seen with so little work, why not?

I’m not talking about conversion utilities so much as end-user image viewers. why lock your file into any one format when the user can instantly translate into whatever they need without having to think about it?

Other than that, we’re agreed on all points. And with you including L/R image export, I welcome and look forward to your utility!

It’s a great idea, for creating content for products like the ones from “Looking glass factory”.