5 ms·
Yeah, this is the classic trick known as "picking": https://www.opengl.org/archives/resources/faq/technical/selection.htm https://www.opengl.org/archives/resour
by Jasper_ 8y ago
Yeah, this is the classic trick known as "picking": https://www.opengl.org/archives/resources/faq/technical/selection.htm https://www.opengl.org/archives/resources/faq/technical/sele...
It's what developers went to after the even more classic GL_SELECT render mode was removed.
It's not suitable to happen every frame because the CPU stall waiting on the frame to render is unacceptable. Most engines will do a CPU raycast into the scene. I don't know why that you say it wouldn't be pixel-perfect, because it should be. The math will work out.
- vvanders 8y ago> The math will work out. When you're dealing with GPUs you're never dealing with just the math. Various vendors make shortcuts in the name of performance so there's a good chance your raycast code doesn't match 100%. Seen this a lot with "golden image" tests, one vendor's rendered scene has bunch of inconsistencies with another vendor's(or different driver version) causing sporadic test failures.
- corysama 8y agoBonus: In my case the atoms used sprite-imposters to fake drawing a zillion tiny spheres.
- Jasper_ 8y agoUsually those tricks show up during texturing or because of float/half imprecision in the pixel shaders. Rasterization of should be the same across all hardware, mandated by the D3D spec, and a very well-tested thing in the D3D compliance suite [0]. If not, you would see various seams in applications. [0] https://docs.microsoft.com/en-us/windows-hardware/drivers/display/point--line--and-triangle-filling-requirements https://docs.microsoft.com/en-us/windows-hardware/drivers/di...