Todo :
Render a model on our HUD,
but instead of rendering all these tiny polygons,
we want to optimize and render these polygons to a texture and then use this texture as a single polygon overlay.This works fine if the entire rendered texture has either blank pixels or opaque pixels,
but when we have pixels with alpha values between 0 and 1, we get a problem.E.g. say we just have a a red (1,0,0) polygon in our model with alpha at 0.5.
If we render this to a texture using normal blending (SRC_ALPHA, 1-SRC_ALPHA) we end up with a dark red colour ( 0.5,0,0 ) and alpha at 0.5.
When this is then used as a texture, it's much darker than is should be, basically because the red polygon has blended with the base "black" of the texture.
No matter what background this is then displayed over, it's wrong.
What we need is for the texture to have full red (1,0,0) colour and alpha of 0.5, but this then gets much more complicated when we render multiple alpha blended polygons over each other.
Is there a way to achieve this ?
Maybe with a different screen blend mode ?
This needs to be done with the GPU whilst rendering to a texture.
Using OpenGLES 2.0.
Please suggest.
Thanks
Shaun