depthmap
Blitz3D Forums/Blitz3D Programming/depthmap
would it be possible to render a 2d depthmap from a
mesh in 3d space? The reason for this being to read the pixels from the 2d depthmap.
Perfectly possible just do a bunch of line picks at the meshs you want to create the depthmap with, and move your linepicks in a grid the size of the image you want to create. Job done.
Perhaps if you manually set the vertex colour of each vertex to a shade of grey depending on how far away from the camera it is? You'd need to turn off lighting and render full bright.
great input, thanks a lot
Use black fog, with a white model?
sswift, could you elaborate a bit on the black fog, white
model?
That's fiendish thinking Mr. Sswift 8D
fuzzy:
Fog is distance based. The farther away your model is, the more it will be fogged.
If you set the near fog value to be in front of your object, and the far fog value to be in back of it, and you set the object to be fullbright and white, then the pixels in the object's polygons will be darker the farther away from the camera they are.
Fog is linear as well, so if the color ends up being grey than you are halfway between the near and far fog planes.
The limitation of this is that if you are in 32bit color mode, you will only get 256 different levels of distance. You could however render several passes and improve the accuracy but how that works is for you to figure out. :-)
Fog may not give you a perfect depth map though. It may work like goraud shading, so the depth would be interpolated between the vertices, which might not result in true depth. But if you do not need a highly precise depth map it may be good enough.
well, I'll start boiling the brain on that
thanks a lot