Topmost Objects

I tryed to use the color buffer to store names rather than colors to search them later and know the topmost objects appeared. The problem is the object names are always be changed. I have stopped lighting, dithering, stippling without any gain? Can any body help me?

You should ask this in the developer (beginner) section of this board.