1
\$\begingroup\$

Platform: Android OpenGL ES 2.0

I'm drawing a texture on to a square using OpenGL ES2.0. The texture scrolls infinitely in vertical direction.

The rendering quality drops very rapidly after a few frames and the texture quality is deteriorated.

Screenshot #1 Initial image

Screenshot #2 After a few frames

How to correct this issue?

\$\endgroup\$
1
  • \$\begingroup\$ How are you rendering the texture onto the square (I assume a quad)? How are you scrolling the texture? \$\endgroup\$ Dec 23 '14 at 12:49
0
\$\begingroup\$

Dose not increment UV coordinates unconditionally, but reset them after sometime.

UV coordinates (even if you use integer coordinates) are converted into floating point inside GPU registers and so are subject to typical loss of precision of floating points.

Instead of doing

U+=deltaU;
V+=deltaV;

do

U+=deltaU;
while(U>1.0f)
    U-=1.f;

V+=deltaV;
while(V>1.0f)
    V-=1.f;

(this assumes you are using standard UV so coordinates between 0 and 1.. if not just replace 1.0f with your MAXUV values

\$\endgroup\$

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