Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: KlingOne on November 21, 2016, 05:38:35 AM

Title: UITexture with RenderTexture transparency problem.
Post by: KlingOne on November 21, 2016, 05:38:35 AM
Hi,

in my game I have a camera which is pointed at the characters face and renders into a RenderTexture.
When I try to display that RenderTexture in NGUI via a UITexture I get a weird transparency issue (see screenshot).

(http://[https://trello-attachments.s3.amazonaws.com/57714735934b6e220417481f/5832cbf3a51349b59a8a0f0f/a6805cdedabbc615fe699d03aafe9a59/RenderingError.jpg/img]

The RenderTexture itself looks fine, so it may have something todo with how ngui renders textures?

[img]https://trello-attachments.s3.amazonaws.com/57714735934b6e220417481f/5832cbf3a51349b59a8a0f0f/17ee093c092ad75e0611a89f11f5d85f/RenderTexture.PNG)

One thing to note is that this only happens if the camera is using the forward renderer. Deferred rendering works fine but unfortunatelly isn't an option in WebGL.

Anybody any ideas what may be causing this?

Thx in advance

Title: Re: UITexture with RenderTexture transparency problem.
Post by: KlingOne on November 21, 2016, 05:42:25 AM
Somehow the pictures do not display in the original message and I could not finde an edit button.
So I'm posting them seperatly.
Sry.

Problem:
(https://trello-attachments.s3.amazonaws.com/57714735934b6e220417481f/5832cbf3a51349b59a8a0f0f/a6805cdedabbc615fe699d03aafe9a59/RenderingError.jpg)

RenderTexture seems fine:
(https://trello-attachments.s3.amazonaws.com/57714735934b6e220417481f/5832cbf3a51349b59a8a0f0f/17ee093c092ad75e0611a89f11f5d85f/RenderTexture.PNG)
Title: Re: UITexture with RenderTexture transparency problem.
Post by: ArenMook on November 27, 2016, 04:01:10 PM
That's your shader. Check your rendered texture's alpha channel, then modify whatever shader is used by the face to output alpha of 1, not 0.