Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Oakshiro on August 05, 2013, 05:59:52 AM

Title: UITexture blend looks messy
Post by: Oakshiro on August 05, 2013, 05:59:52 AM
Hi there,

I have a UITexture which is being downloaded from internet (Facebook picture), and should be displayed behind a round "hole" in a png sprite.
I activated the "Depth pass" option, and the UITexture has a Unlit/transparent colored material, but semitransparent pixels look quite messy...

(http://s23.postimg.org/9s0u6fjrr/mark.png)

I understand you cannot load a url inside a sprite so UITexture should be the correct way to do it, but how should I manage the alpha blend to make it look right?

Thanks!
Oakshiro
Title: Re: UITexture blend looks messy
Post by: ArenMook on August 05, 2013, 08:03:39 AM
Don't use depth pass. People keep mis-using that option, so I actually flat out removed it from inspector in 2.6.4.

Instead use a custom shader that would blend your target texture (main texture) with a mask texture. This way you will get soft edges.
Title: Re: UITexture blend looks messy
Post by: Oakshiro on August 21, 2013, 06:20:55 AM
Ok, I'll try to deactivate depth pass.. but I have no idea of how to properly create a shader...
Maybe I am trying to do something strange, but the idea is to load a image from the internet and put it as a sprite, behind the round one.

If you could point me out how to do it in one way or another it would save my day!
thanks

Oakshiro
Title: Re: UITexture blend looks messy
Post by: ArenMook on August 21, 2013, 10:13:24 AM
As I said... look into masks. The idea is that you will have a material that has 2 textures on it. First texture is going to be your downloaded texture. Second texture is going to be the circle mask. Blend the two in the shader, and you will get the effect you're looking for.

This isn't an NGUI question at all. It's a "shader basics" question.
Title: Re: UITexture blend looks messy
Post by: Oakshiro on August 23, 2013, 07:06:55 AM
Ok, then I'll search for a suitable shader on the internet.
thanks!