Alpha Rendering for Scenewindows?
by Mike Lilligreen · in Torque Game Builder · 02/18/2006 (5:09 pm) · 4 replies
How are alpha levels handled for GUI objects? I know if I was simply displaying a bitmap I could set the alpha directly in the .png. I thought maybe a custom profile would also work but adding a 4th value to fillColor ("255 255 255 100" for example) doesn't seem to do anything. Basically I am rendering a second scene window on top of my main sceneWindow2D, both using the same scenegraph, and would like the second window to be partially transparent. Is this currently possible?
About the author
#2
02/19/2006 (3:05 am)
Yes, after typing out my first post last night, the thought occured to me to use 2 scenegraphs and simply control the alpha via all the scene objects within it. But since I wanted the second scene window to mirror the contents of the first, with the difference of it being a "live" close up camera of certain objects. Having 2 scenewindows and 2 scenegraphs displaying the exact same contents in each just seemed a bit overboard, I guess I could try it out and see what sort of performance hit occurs. Thanks.
#3
02/19/2006 (8:12 am)
I see what you are trying to do now. OK, so I can't tell you exactly how to accomplish this, but now that TGB is based on Torque 1.4, it is possible. You can render a GUI control into a bitmap and then render that bitmap with it's own alpha. I've seen a resource around for doing this. Unfortunately, I think the resource is posted to TGE owners, so if you only own T2D, you won't be able to see it. The underlying support is called a DynamicTexture and the GuiEffectCanvas control implements it. What I can't tell you right now if how to get a t2dSceneWindow control to render into a texture to then alpha render on a effect canvas... but I believe it's possible.
#4
The original idea came from World of Warcraft, where the character portraits in the UI dynamicaly update if you change your helm for example. It was neat getting the same sort of result with additional scenewindows with the same scenegraph, but I was hoping there might be tucked away some sort of GUIControl function like setBlending() for SceneObjects that made it easy to change the alpha.
02/19/2006 (9:03 am)
From what little I could find by searching that isnt locked behind TGE stuff, it seems like rendering a dynamic texture is pretty preformance intensive in itself. I've gone back anyway and rethought my GUI layout/features and what I want to accomplish with it and will probably drop the additional camera views on scene objects for simple static bitmaps. The original idea came from World of Warcraft, where the character portraits in the UI dynamicaly update if you change your helm for example. It was neat getting the same sort of result with additional scenewindows with the same scenegraph, but I was hoping there might be tucked away some sort of GUIControl function like setBlending() for SceneObjects that made it easy to change the alpha.
Torque Owner Jason Cahill
Default Studio Name