I have this working except that what I'm finding is that when you render a gui element to a texture it doesn't give the exact same result as rendering to the framebuffer.
I've tested them side by side using an image file that I generated by writing the texture.
I've looked through all the code and there doesn't seem to be a problem and it's very subtle so has anyone else noticed this and is it a known issue (either with opengl, irrlicht or drivers) or is there something I'm missing?
I've tested the filtering and I'm pretty sure it's not that besides I'm not doing any resizing.
I think it's mainly an issue with the alpha. Could it be that render target textures don't use the same precision as normal textures even if their color formats are the same?
Using render to texture to draw a 3d gui
Re: Using render to texture to draw a 3d gui
Ignore as I've fixed this.
For anyone who is interested to know you need to use glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) when drawing the texture on the billboard back to screen.
However that still doesn't explain why the actual rendered texture is different than the source texture so does anyone knows why? Or maybe I don't want to know.
For anyone who is interested to know you need to use glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) when drawing the texture on the billboard back to screen.
However that still doesn't explain why the actual rendered texture is different than the source texture so does anyone knows why? Or maybe I don't want to know.
Re: Using render to texture to draw a 3d gui
Are you saying that you are comparing an image A with an image B obtained by rendering A as a texture on a billboard and converting it to an image?
Re: Using render to texture to draw a 3d gui
I'd bet the image was exactly the same if you dump it directly by using createImage from the RTT. Having double-alpha effects is common, and just means you need to be careful in how you draw your texture to the screen.
Re: Using render to texture to draw a 3d gui
mongoose - yea that's what I'm doing.
btw - Using the pre-multiplied doesn't work right either although it is better. Another solution is to render it twice which again is better but not quite the same.
btw - Using the pre-multiplied doesn't work right either although it is better. Another solution is to render it twice which again is better but not quite the same.