0
\$\begingroup\$

please see the below image. I made a model in Blender that has eye meshes with UV mapped Pupils. But trying to import all this into Unity is causing tons of weird visual errors...

The pupil png has a Transparent background but that background shows up as Black in Unity. Googling says to fix it by choosing 'Transparent' shader but all the ones I try end up cutting out the Eye mesh beneath it.

enter image description here

Any help appreciated.

\$\endgroup\$
7
  • \$\begingroup\$ What do you expect to see in the transparent region, if not transparency (ie. absence of a drawn mesh)? \$\endgroup\$
    – DMGregory
    Jun 5, 2020 at 16:07
  • \$\begingroup\$ Hm, how would I get it to retain a white eyeball underneath but still have a pupil? When I don't use a 'Transparency' shader it shows up with a black background over the eyeballs (2nd image in My screenshot). \$\endgroup\$
    – Teli
    Jun 5, 2020 at 16:57
  • \$\begingroup\$ Then you don't need transparency at all, just paint the background of your texture white. By putting transparency there, you're telling the engine "I either want to show nothingness here, or I'm doing something fancy with this in my shader". If what you mean is "I want to show white here" then just literally put white there, and there's no extra interpretation needed. \$\endgroup\$
    – DMGregory
    Jun 5, 2020 at 16:57
  • \$\begingroup\$ Thanks! Putting a white background on the PNG solved it. I did not expect the 'stretch' functionality of image edges and am pleasantly surprised. Do you know why that streak shows up (as seen in Middle screenshot image)? It's still showing up when the background is White, but is showing as a black streak instead! \$\endgroup\$
    – Teli
    Jun 5, 2020 at 18:41
  • \$\begingroup\$ Because your texture doesn't contain extra pixels past its edge. All the program can read are the pixels in your texture, and the pixels on that edge of your texture are black, not white. If you want to show white on that edge of the texture, paint white pixels along that edge. \$\endgroup\$
    – DMGregory
    Jun 5, 2020 at 18:45

1 Answer 1

1
\$\begingroup\$

Problem is SOLVED - It is as simple as making the background color of the Texture png be the color you want the material's 'background color' to be.

In my case: Instead of (a) having a transparent Pupil png over an Eye and hoping the Eye behind would remain white, you are supposed to (b) simply make the Edges of the pupil png white.

Then upload that png into Unity, assign it to the Eye Material Albedo, and set the Png settings in Unity to 'Clamp'. 'Clamp' will stretch the edges of the Texture PNG without deforming the center of your image! :)

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .