Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - russianryebread

Pages: [1]
1
Support / 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

Pages: [1]