Hi… I’ve been implementing a Maya-like interface where a user can create simple objects, like spheres, cubes, & planes, and can also import OBJ meshes… From here the user can scale, rotate, and translate the objects as desired and then can render the scene out with my own raytracer implemented along with the openGL scene interface… I was wondering if I can somehow get some information from the openGL depth buffer that could be used to speed up my rendering times (especially for large OBJ meshes)… I know that I can get the depth information for each pixel from the depth buffer, but is there someway to also find out which object (or face, when using OBJ meshes) in the scene the depth buffer value refers to? I mean, if I see that the depth buffer for a particular pixel contains a valid z-value, indicating that an object/face/polygon exists at that point, could I also easily find out which object/face/polygon is in the foreground at that pixel? I could use such info to really speed up my rendering times…
Thanks a bunch… and I hope this made sense…