Transparent diffuse shader clipping

Ash Blue
New Member
Registered: 2017-04-28
Posts: 8

Topic

Anything painted behind the transparent area of a tile set with `Rotorz/Tileset/Transparent Diffuse` is getting a weird black overlay. I've fixed this in the past by using `Sprites/Diffuse` instead. But now choosing `Sprites/Diffuse` paints all of the tiles pitch black. Is there a way to fix `Rotorz/Tileset/Transparent Diffuse` so it doesn't have the nasty looking transparency issue? On version 5.6.0f3.

Example of the issue:
https://www.dropbox.com/s/rtl2gqqj5f8ty … 2.png?dl=0

Lea Hayes
Rotorz Limited
From: United Kingdom
Registered: 2014-03-04
Posts: 638

Response 1

Hmmm, could it be one of the settings on the texture importer itself? I understand that Unity have made some changes to the way that textures are imported; maybe it's just one of those new settings that needs to be tweaked.

Failing that, could you provide an example texture along with the meta file so that I can reproduce the issue here.

Many thanks

Ash Blue
New Member
Registered: 2017-04-28
Posts: 8

Response 2

Here is the texture I'm using with the corresponding meta file as a unitypackage. Let me know if you need anything else.

https://www.dropbox.com/s/hkdalpuqzinf4 … ckage?dl=0

Lea Hayes
Rotorz Limited
From: United Kingdom
Registered: 2014-03-04
Posts: 638

Response 3

The shader "Rotorz/Tileset/Transparent Diffuse" was originally based on the "Sprite Diffuse" shader that ships with Unity but they seem to have changed the implementation recently. The following adjustment seems to resolve the issue (brings forward the change Unity made to their shader):

1. Open the file "{your-project}/Assets/Rotorz/Tile System/Shaders/Tileset-TransparentDiffuse.shader" with your favorite code editor.

2. Change line #33 from:

#pragma surface surf Lambert vertex:vert

To:

#pragma surface surf Lambert vertex:vert nofog nolightmap nodynlightmap keepalpha noinstancing

Thank you for reporting this issue.

Ash Blue
New Member
Registered: 2017-04-28
Posts: 8

Response 4

Thanks for the fast response. Saved me a few hours hunting through shader code :D