2D Toolkit Forum
2D Toolkit => Support => Topic started by: russianryebread on February 13, 2015, 10:03:56 pm
-
Hello,
I am really new to Unity, I just started hacking around with it about a month ago, so forgive me if this is a silly question. In the project that I am helping on, I noticed a faint grey border around some of the PNG images, which in looking through the forums here, I found out that it was a bilinear interpolation artifact: Post: http://2dtoolkit.com/forum/index.php/topic,323.msg1373.html#msg1373
I programmatically set the PremulVertexColor shader for those images, and the issue was resolved in the Unity player, but when I built for the iPhone, and ran it on my device, the images were all pink, which I understand happens when the shader is not found.
Here is my code to set the shader, let me know if you need more code or information:
obj = (GameObject)Instantiate(slidePrefab);
obj.transform.parent = prevSlideObj.transform;
obj.transform.position = new Vector3(prevSlideObj.transform.position.x, slideImagePosY, -3f);
obj.renderer.material.shader = Shader.Find("tk2d/PremulVertexColor");
obj.name = "Image";
ScaleSlideSprite(obj.GetComponent<tk2dSprite>());
Am I doing something wrong?
Thanks in advance!
-Ryan
-
If nothing in your project uses the shader it wont be included in the build - you might need to put it into the resources folder for it to work.
* by it, I mean the shader.