Offscreen Texture Alpha (User Error)
Posted: 12 Mar 2019, 15:10
**update** This was caused by user error.
I have asked so many questions here about Noesis and I feel bad for asking another question. :|
Today I am working with setting a rectangle fill to an offscreen rendered texture (Unity). The texture contains alpha.
The behavior seems to be that alpha is only partially respected -- i.e. if it's 100% alpha ("transparent") it works in the Noesis control but partial alpha appears black.
Here is the render target texture:

And here is a rectangle with a background set to the same render target texture. You can see that alpha partially works.

Here is the code I'm using which shows construction of the Noesis texture.
Does anyone have any thoughts on what could possibly cause this behavior? I have not ruled out Unity -- just not sure if this has been seen before. Thank you!
I have asked so many questions here about Noesis and I feel bad for asking another question. :|
Today I am working with setting a rectangle fill to an offscreen rendered texture (Unity). The texture contains alpha.
The behavior seems to be that alpha is only partially respected -- i.e. if it's 100% alpha ("transparent") it works in the Noesis control but partial alpha appears black.
Here is the render target texture:

And here is a rectangle with a background set to the same render target texture. You can see that alpha partially works.

Here is the code I'm using which shows construction of the Noesis texture.
Code: Select all
private void InitializeComponent()
{
GUI.LoadComponent(this, "Assets/User Interface/Controls/Render Control/RenderControl.xaml");
FrameworkElement root = this.Content as FrameworkElement;
_RenderRectangle = root.FindName("_RenderRectangle") as Rectangle;
_OffscreenCameraGameObject = this.FindInactiveGameObject("Offscreen Camera");
_Camera = _OffscreenCameraGameObject.GetComponent<Camera>();
// create render texture
_RenderTexture = new RenderTexture((int)_Dimensions.x, (int)_Dimensions.y, 1, RenderTextureFormat.Default);
RenderTexture.active = _RenderTexture;
// create Noesis texture
_RenderTexture.Create();
NoesisTexture noesisTexture = NoesisTexture.WrapTexture(_RenderTexture, _RenderTexture.GetNativeTexturePtr(),
_RenderTexture.width, _RenderTexture.height, 1);
// create brush to store render texture and assign it to the rectangle
_RenderRectangle.Fill = new ImageBrush()
{
ImageSource = new TextureSource(noesisTexture),
Stretch = Stretch.None,
Opacity = 1.0f
};
}