Either I'm confused, or it seems to me that you are picking colors from what's visible on the screen, instead of an invisible second screen.
What does it matter what color the background is, on the invisible second screen?
You draw each object:
- Draw with textures, lighting, anti-aliasing, whatever...
And if it's pick-able, you draw it on a secondary screen as well:
- Draw as a solid color matching it's object ID.
When you pick the color, you pick it from the secondary screen. Otherwise, your program wont be able to use lighting (which would mess up the pixel colors with shadows), or textures (which are all sorts of different colors), or shader effects, or transparency, or anything else.
Show differencesHistory of post edits
#1Servant of the Lord
Posted 15 April 2012 - 03:32 PM
Either I'm confused, or it seems to me that you are picking colors from what's visible on the screen, instead of an invisible second screen.
What does it matter what color the background is, on the invisible second screen?
You draw each object:
- Draw with textures, lighting, anti-aliasing, whatever...
And if it's pick-able, you draw it on a secondary screen as well:
- Draw as a solid color matching it's object ID.
When you pick the color, you pick it from the secondary screen. Otherwise, your program wont be able to use lighting (which would mess up the pixel colors with shadows), or textures (which are all sorts of different colors), or shader effects, or anything else.
What does it matter what color the background is, on the invisible second screen?
You draw each object:
- Draw with textures, lighting, anti-aliasing, whatever...
And if it's pick-able, you draw it on a secondary screen as well:
- Draw as a solid color matching it's object ID.
When you pick the color, you pick it from the secondary screen. Otherwise, your program wont be able to use lighting (which would mess up the pixel colors with shadows), or textures (which are all sorts of different colors), or shader effects, or anything else.