iphone - OpenGL ES 2.0 texture distortion on large geometry GL_REPEAT -
opengl es 2.0 has serious precision issues texture sampling - i've seen topics similar problem, haven't seen real solution "distorted opengl es 2.0 texture" problem yet.
this not related texture's image format or opengl color buffers, seems it's precision error. don't know causes precision fail - doesn't seem it's size of geometry causes distortion, because scaling vertex position passed the vertex shader not solve issue.
here examples of texture distortion:
distorted texture (on opengl es 2.0): http://i47.tinypic.com/3322h6d.png
what texture looks (also on opengl es 2.0): http://i49.tinypic.com/b4jc6c.png
the texture issue limited small scale geometry on opengl es 2.0, otherwise texture sampling appears normal, grainy effect gradually worsens further vertex data origin of xyz(0,0,0)
these texture issues not occur on desktop opengl (works fine under windows xp, windows 7, , mac os x)
i've seen problem occur on android, iphone, or webgl(which similar opengl es 2.0)
all textures power of 2 problem still occurs
-
scaling vertex data - values of vertex's x y z location in range of: -65536 +65536 floating point
- i realized large, tried dividing vertex positions 1024 shrink geometry , more accurate floating point precision, didn't fix or lessen texture distortion issue
scaling modelview or scaling projection matrix not help
-
changing texture filtering options not help
- disabling mipmapping, or using gl_nearest/gl_linear nothing
- enabling/disabling anisotropic nothing
- the banding effect still occurs when using gl_clamp
dividing texture coords passed vertex shader , multiplying them correct values in fragment shader, not work
precision highp sampler2d, highp float, highp int - in fragment or vertex shader didn't change (lowp/mediump did not work either)
i'm thinking problem has have been solved @ 1 point - seeing opengl es 2.0 -based games have been able render large-scale, highly detailed geometry
this usual texture atlas problem. there no setting limit linear interpolation in mid-texture. that's how hardware works.
you can work around issue using nearest filter texture lookup in fragment program calculates texture lookup modulo texture tile size , position , linear filtering manually.
Comments
Post a Comment