Selecting Area
Hi,
So, I'm working on a progressive refinement radiosity implementation. Evidently, I need to render a scene and find out what ratio of pixels is filled by a given object.
For example, ideally, given objects 1, 2, and 3 in a scene, if the scene were to be rendered, I'd like to know that:
-object1 would cover 11% of the screen's pixels
-object2 would cover 5% of the screen's pixels
-object3 would cover 0% of the screen's pixels
-therefore, 84% of the pixels would not covered
The obvious solution is to render the scene, read back the pixels, and then count them in software, but this seems inelegant and slow. Is there a better way? Perhaps using the selection or feedback buffers?
Thanks,
G
So, I'm working on a progressive refinement radiosity implementation. Evidently, I need to render a scene and find out what ratio of pixels is filled by a given object.
For example, ideally, given objects 1, 2, and 3 in a scene, if the scene were to be rendered, I'd like to know that:
-object1 would cover 11% of the screen's pixels
-object2 would cover 5% of the screen's pixels
-object3 would cover 0% of the screen's pixels
-therefore, 84% of the pixels would not covered
The obvious solution is to render the scene, read back the pixels, and then count them in software, but this seems inelegant and slow. Is there a better way? Perhaps using the selection or feedback buffers?
Thanks,
G
Exactly what I needed. Thanks!
Here's a good example: http://developer.download.nvidia.com/SDK/9.5/Samples/samples.html
Here's a good example: http://developer.download.nvidia.com/SDK/9.5/Samples/samples.html
Hi,
Hmmmm, seems the solution is slightly more complicated. I need to be able to test at least 560 different elements, and preferably around a million. glGetQueryivARB(...) is telling me I only have 32 to work with . . .
Second opinions?
Thanks,
G
Hmmmm, seems the solution is slightly more complicated. I need to be able to test at least 560 different elements, and preferably around a million. glGetQueryivARB(...) is telling me I only have 32 to work with . . .
Second opinions?
Thanks,
G
I'm now using glReadPixels and a RGB indexing system (256^3 possible indices). Seems to be working all right, I suppose. No other OpenGL way? Occlusion querying seemed so perfect . . .
Quote:Original post by GeometrianAFAIK, you can issue more than one query at once.
I need to be able to test at least 560 different elements, and preferably around a million. glGetQueryivARB(...) is telling me I only have 32 to work with . . .
In my opinion occlusion queries are not the way to go. The overhead to handle queries and potentielly destroying your renderpipeline by setting up thousands of queries. Then there's the problem of z-buffering. You need to render the scene first to the z-buffer else you will get incorrect results from your queries.
Use PBOs to speed up the read back of the buffer, then use multithreading (each thread get its own "secondary" array to avoid locking, see previous thread ) to utilize multiple cores while rendering the next patch to an secondary framebuffer.
Use PBOs to speed up the read back of the buffer, then use multithreading (each thread get its own "secondary" array to avoid locking, see previous thread ) to utilize multiple cores while rendering the next patch to an secondary framebuffer.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement