x


Custom shader turns pink when built

Anybody know why this would happen? I have a simple Diffuse Outline shader that I found on the unity forums, and I'm swapping out the shader when I have a target selected, so the selected target has an outline. It works fine in the editor- but as soon as it's built, the shader stops working- instead of an outline around the target, the target turns pink- as if it's missing its diffuse texture.

Any idea what would cause this? I thought when you built binaries, it pulled in any needed resources.. if that's the case, it should be a 1:1 representation of what I get in the editor, but that's not the case. Any help on this would be appreciated!

more ▼

asked Jun 05 '11 at 10:35 PM

testure gravatar image

testure
4.2k 20 25 48

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Okay, so I finally got around to looking into this problem again- and it turned out to be something really simple. I was changing the shader via script, and the shader wasn't in my Resources folder like I thought it was. Moving the shader to resources fixed it, obviously :)

more ▼

answered Jul 21 '11 at 06:31 PM

testure gravatar image

testure
4.2k 20 25 48

(comments are locked)
10|3000 characters needed characters left

In theory it should work as you described. You get pink shader when it's unabled to find shader or compile it. Check log after running your build and see if there are any indications what went wrong with your shader.

more ▼

answered Jun 07 '11 at 08:58 AM

Paulius Liekis gravatar image

Paulius Liekis
7.3k 16 24 45

there are no indications in the log that anything went wrong at all.. just the typical non platform assembly notifications that say "(this message is harmless)"

Jun 07 '11 at 02:13 PM testure
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1671
x658
x56
x20

asked: Jun 05 '11 at 10:35 PM

Seen: 1611 times

Last Updated: Jul 21 '11 at 06:31 PM