3
\$\begingroup\$

All of my quads appear correctly textured on the Unity3D editor, a Motorola Xoom Android tablet, and on an iPad 2:

enter image description here

But on our Samsung Galaxy Mini 2 smartphone they kinda look like this:

enter image description here

I wrote a debug shader that outputs the texture coordinates U and V to the R and G channels respectively, and results were consistent:

enter image description here

What could be causing this difference between devices?

\$\endgroup\$

1 Answer 1

2
\$\begingroup\$

Found the problem. Apparently I needed to assign a vertex color to each vertex of the quad, even when the shader was not using that information. In other words:

var colors = new[] {
    Color.white,
    Color.white,
    Color.white,
    Color.white
};
mesh.colors = colors;

Assigning these colors solved the UV problem, although I'm not sure why it did.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Yep, I've had a similar problem with libgdx batch sprites (on all devices). If I didn't asign any color at all to vertices, some quads would display texture normally, some not. \$\endgroup\$ Feb 28, 2013 at 15:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .