I’m probably doing it wrong or missing an option. I create a viewport and render that to a texture. Then I take the texture and attach it to the guiNode.
When I attach the texture to the guiNode, all the areas where nothing was rendered to is BLACK, instead of blank so that area can be transparent.
What am I missing to render to a texture so that the background is not black, it is blank.
Let me know if this helps, explain what I’m asking for.
Kevin
Even test example “TestRenderToTexture” doesn’t render with alpha on the texture. The background is solid in the example also.
I’ve not locate an example that actually shows the framebuffer using Alpha values for area not rendered too. Even though the background color is set to 0,0,0,0
Are you sure you geometry is setup for transparency? Have you tried setting a prerendered texture with known good alpha to see if it also has the problem?
For the portion of the code I can see, I didn’t spot any immediate issues. If the above suggestion doesn’t yield any new evidence then you may want to create a single class test case that illustrates the issue.
If it’s helpful, here is some code that generates textures with alpha that I used to automatically generate a tree’s texture atlas:
The solution is that Texture sets the Format type to ‘BGR8’ by default. Also, not an easy way to change it through the construction of the texture class.
SO, after creating everything. Need to get the texture back out of it, because it doesn’t care how you defined the texture above. it over write the format to ‘BGR8’ even thought you selected RGBA8.
So if you get the texture back out of the FrameBufferTextureTarget and then set the “Format” back to RGBA8.
Then is works, Alpha mode is active. Just the default FrameBufferTextureTarget is HARD CODED to not support Alpha. You have to change it.
I would assume this is a bug in 3.4.
You code works because that was for <= 3.3 version. 3.4 that changed it to use FrameBufferTextureTarget and it was changed to no ALPHA.