generate depth map from 3d objects?

gutsblow's picture

Hello,

Can anyone tell me how to generate depth map with/without gl tools? The stock composition is not working in snow leopard!

cwright's picture
Re: generate depth map from 3d objects?

There's no way to do it without GLTools -- you can fake it by rendering in a Render In Image, using Fog to simulate depth, but otherwise there's no way to get depth information.

With GLTools, the read pixels patch may way in SL, or it might not -- I've honestly not had time to check :/

gtoledo3's picture
Re: generate depth map from 3d objects?

The color buffer was working, last I checked, and the depth wasn't (no sample composition, as it doesn't seem necessary... this is just evident from use over multiple qtz's). I haven't checked to see if the old sizing bug went away/is still there, or what.

gutsblow's picture
Re: generate depth map from 3d objects?

Yes, the depth wasn't working!

gtoledo3's picture
Re: generate depth map from 3d objects?

Sorry, gutsblow. I wasn't being oblivious to your original question and statement, my comment was more to Chris about the extent of Read Pixels being broken or not in SL. You were totally clear; I wasn't trying to be exasperating :)

vade's picture
Re: generate depth map from 3d objects?

You can sort of do this with a GLSL shader and output an image based on the gl_FragDepth, no?

cwright's picture
Re: generate depth map from 3d objects?

no -- gl_FragDepth is an output, not an input (like gl_FragColor, you write to it in the fragment shader). -- try setting it to 0.1 in the fragment shader, and watch depth testing magically stop working :)

You can use gl_FragCoord though (.z is the depth).

vade's picture
Re: generate depth map from 3d objects?

Ah, thats the one I was thinking of. gl_FragCoord.z :)

gutsblow's picture
Re: generate depth map from 3d objects?

Is it possible for a sample composition because I really don't know anything about glsl.

gutsblow's picture
Re: generate depth map from 3d objects?

Hey, no I was just acknowledging what you said..