Hi to all
I am a newbie to computer graphics so please excuse my ignorance. I have a 3D
mesh of a scanned object, and I have images taken from heaps of known
positions. I am currently doing a simple texture mapping procedure which
results in a simple vrml file.
Currently the texture mapping process is simply: for each facet
- finds list of images (ie camera postions) where facet is facing camera (ie
backface culling)
- filters the list of images to keep the ones where the angle between
camera and facet's normal is less than a given threshold.
For now the winner image is simply the one that is most normal to the facet.
For most facets, the results are acceptable, but I need to develop this
further, since some facets are mapped to incorrect images due to
occlusuion. Now I need to test for visibility (occlusion
culling). I have been doing some reasearch and seems like z-buffer is
the way to go (ie the most common) (please correct me if that's
wrong). But I am not sure I fully understand it. It seems like
for each image
for each pixel
find depth of closest 3D point (on a facet)
But I am sort of lost how does that help in texture mapping. In the end
of my visibility filter, I want for each facet, a list of images where
the whole facet is visible, I will then chose the winner based on some
other future defined criteris.
I would appreciate any help in clarifying how having a z buffer for each
image will help in deciding whether a facet is fully visible in that
image.
By the way I am using C++ to write my code
Thanks
Nawar
Visibility test for texture mapping
Started by Nawar, Jan 30 2009 01:19 AM
3 replies to this topic
#1
Posted 30 January 2009 - 01:19 AM
#2
Posted 30 January 2009 - 01:27 PM
You can use the Z-buffer to check, after you have rendered all the faces, if the face is fully visible or not.
After you have rendered all the faces, go back and check the pixels for each face that you rendered the first time. The depth buffer contains the distance to the nearest face for that pixel. If another face is in front of the one you drew, the distance value will be less, as it will be the distance to the nearer face.
Another way is to render each face with an unique colour, but still using a separate Z-buffer to do polygon sorting. Then go back and see which pixels for the polygon are still the same colour as when you rendered them. If any pixels are a different colour, the face is occluded.
After you have rendered all the faces, go back and check the pixels for each face that you rendered the first time. The depth buffer contains the distance to the nearest face for that pixel. If another face is in front of the one you drew, the distance value will be less, as it will be the distance to the nearer face.
Another way is to render each face with an unique colour, but still using a separate Z-buffer to do polygon sorting. Then go back and see which pixels for the polygon are still the same colour as when you rendered them. If any pixels are a different colour, the face is occluded.
#3
Posted 02 February 2009 - 07:58 PM
Thanks hovermonkey for your reply, but I still can't see how to use the z-buffer for texture mapping. All my work is done offline. For each facet, I have a list of possible images that they can map on (list was obtained after doing some filtering such as backface culling etc). I need now to build another filter, which removes images that the face might be occluded. So I need some test to tell me whether a facet is fully visible on a specifc image. The aim is that for each facet in the end I have a winner image which it will map to. I just then write a vrml file to view.
I s Z-buffer not the suitable thing for me, should I be looking into ray tracing instead???
I s Z-buffer not the suitable thing for me, should I be looking into ray tracing instead???
#4
Posted 11 February 2009 - 12:51 AM
I would really appreciate any help or ideas in this matter.
All i want is to find out what images a facet is visible in. To make life simpler, I don't want to consider partial occlusion for now, ie a facet is either fully visible or not. I also just want to use C++ language ie no openGl etc..
If I do go for ray tracing, the issue I have is finding intersections between the rays from the camera and the facet verticies with the mesh might still give incorrect answers. So is it common practice to test many other points on the facet (ie sample the facet)????
Thanks
All i want is to find out what images a facet is visible in. To make life simpler, I don't want to consider partial occlusion for now, ie a facet is either fully visible or not. I also just want to use C++ language ie no openGl etc..
If I do go for ray tracing, the issue I have is finding intersections between the rays from the camera and the facet verticies with the mesh might still give incorrect answers. So is it common practice to test many other points on the facet (ie sample the facet)????
Thanks
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











