Texture wrapping problem

Started by ap, March 23, 2015, 08:58:39 AM

Previous topic - Next topic

ap

Hello

I'm generating a 3D object of a trail, manually generated from vertices and triangles (using the Object3D constructor using vertices array, indices array and uvs array).

The trail is something like a "thick" line (each segment is constructed from two triangles).
I'm trying to map a texture along the trail by something like this:

uvs[iv++] = tot_dist;    // u plus (right)
uvs[iv++] = 0;      // v plus (right)
uvs[iv++] = tot_dist;    // u minus (left)
uvs[iv++] = 1;      // v minus (left)

for each two points of a segment, where tot_dist is the total distance of the trail up to that point.

I am getting a weird result, where at the beginning of the trail, the texture looks great, and as I "walk" through the trail, the texture starts looking "noisy" and VERY "pixelated".
I tried variations of mipmap and filtering - on and off, with no help.

Any guess what might be the problem?

Thanks
AP

EgonOlsen

That's caused by inaccuracies in mobile GPUs. The effect varies from awful (NVidia Tegra 3) over "a little better" (Mali) to almost perfect (Adreno). There's nothing you can do about it except for not doing it this way...

ap

Thanks for your answer.
Any suggestions of other ways for doing something like that? (other than breaking the trail to many objects with "less" wrapping of textures...)

EgonOlsen

I used to do something similar in Alien Runner. I used two objects which wrapped. Once the first object wasn't visible anymore, i moved it back to the top of the road.