armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

• 0

Question

Hello, so i wrote a shader that act like the legacy shader/decal but contains 3 texture :

So here with say to our shader, "hey, i have for u 3 textures", Now let put 3rd texture on top of 2nd , and both an top of 1st

Ok, nice, very nice, but what its wrong, there's no texture on my cube :(. I have everything setup correctly. If its there any good souls that will help me again :D, please :), i'm tring to figure it out from yesterday, but maybe im not that smart, im giving up. No errors tho.

Edited by bgs2k

Recommended Posts

• 0

The problem was unity, i reinstalled it and work perfecly fine. No clue what happend tho.

Share on other sites

• 0

Looks like your alpha math is off. From what it looks like, the issue is * (1 - t.a). If t.a is 1, then your alpha is multiplying it by 0, thus not showing any pixels

Share on other sites
• 0

here i calculate the final color between 2 point

if  t.a = 0 then final color is : color 1 * (1-0) + color 2 * 0 => color1;

if  t.a = 1 then final color is : color 1 * (1-1) + color 2 * 1 => color2;

if t.a = anywhere between then final color is : color 1 * (1-x) + color 2 * x => new color 3

it doesnt matter if i have a zero i will still have a color, but i tried using half4 and then lerp ( color1, color2, based on color2.a) that basically does the same thing, but didnt work at all. btw i just looked on the build in shader that unity provide us on site, decal work with main texture = fixed4, decal texture = half4, and then recalculate main with lerp, so ..., i dont thing that mathematical is a problem