in each frame (as in frames per second) I render, I make a smaller version of it with just the objects that the user can select (and any selection-obstructing objects). In that buffer I render each object in a different color. When the user has mouseX and mouseY, I then look into that buffer what color corresponds with that position, and find the corresponding objects. I can t work with FBO so I just render this buffer to a texture, and rescale the texture orthogonally to the screen, and use glReadPixels to read a "hot area" around mouse cursor.. I know, not the most efficient but performance is ok for now.
现在我的问题是,这种带有“col物体”的缓冲存在一些准确性问题。 当然,我对所有照明和束缚器都置之不理,但我仍有一些手法。 显然,我确实需要无任何差异的有色谱。
请注意,我在此把所有彩色信息放在L_RED的未经签名的书中。 (目前,我最多拥有255个可选择物体)。
Are these caused by rescaling the texture? (I could replace this by looking up scaled coordinates int he small texture.), or do I need to disable some other flag to really get the colors that I want. Can this technique even be used reliably?