Hello Guest

Author Topic: Using PremulVertexColor shader on iOS  (Read 2917 times)

russianryebread

  • Newbie
  • *
  • Posts: 1
    • View Profile
Using PremulVertexColor shader on iOS
« 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:

Code: [Select]
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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Using PremulVertexColor shader on iOS
« Reply #1 on: February 13, 2015, 11:53:13 pm »
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.