gl function for "returning" a polygon point surface colour?
#1 Members - Reputation: 142
Posted 07 January 2013 - 10:38 AM
Thanks in advance
PLEASE i hope someone can help on this... I'm kind-of stuck. many thanks
#2 Crossbones+ - Reputation: 5345
Posted 09 January 2013 - 11:09 PM
Why don’t you just read the bitmap data at that point? A box filter is also trivial to implement if you need to account for blending of colors.
There is a way of hacking it out of OpenGL ES but it is too terribly slow, extremely hackish, and even more complex to actually implement, so I would not be doing you a service by explaining it.
L. Spiro
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums
#3 Members - Reputation: 142
Posted 10 January 2013 - 12:24 AM
#4 Moderators - Reputation: 8538
Posted 10 January 2013 - 01:25 PM
OpenGL is generally an output-only system.
Reading back from it is almost always so slow that it isn't worth the effort.
If your app is already pushing performance limits then L Spiro's suggestion is going to be the best. You're looking at 30-50 lines of code and it probably won't tank performance.
If you have cycles to spare I can think of several ways to do it, including the naive technique of just rendering to a texture and grabbing the pixel.
#5 Crossbones+ - Reputation: 5345
Posted 10 January 2013 - 01:41 PM
continues to reference to the unstretched bitmap.So does OpenGL ES.
The point is that OpenGL ES does a few matrix transforms and then possibly (optionally) some interpolations to get the final color.
All of these things are things you can do on your own in software, again by reading directly from the texture. You make it seem as if OpenGL ES references something other than the original texture.
As frob and I mentioned, it can be hacked together via only OpenGL ES commands, but not only is that such a ridiculous hack, it also makes no benefit to your understanding of what is happening inside the OpenGL ES pipeline.
I am not saying that understanding everything inside the OpenGL ES pipeline is super-important, but in this case it is not only better for your overall understanding, but also simpler, faster, and easier to implement.
L. Spiro
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums
#6 Members - Reputation: 142
Posted 10 January 2013 - 02:55 PM
If you have cycles to spare I can think of several ways to do it, including the naive technique of just rendering to a texture and grabbing the pixel.At this stage solution has priory over performance, so i am very much ready to try your solution. One can still learn alot even if its hack code. Many thanks
Wud appreciate if you could post the solution (or link if its too large), thanks
Edited by run_g, 10 January 2013 - 07:03 PM.
#7 Crossbones+ - Reputation: 5345
Posted 13 January 2013 - 01:24 PM
L. Spiro
I spent most of my life learning the courage it takes to go out and get what I want. Now that I have it, I am not sure exactly what it is that I want. - L. Spiro 2013
L. Spiro Engine: http://lspiroengine.com
L. Spiro Engine Forums: http://lspiroengine.com/forums






