Hello everyone,
Hi,
Do you see the problem if you set color as:
lowp vec3 color = (color0) * lightMask.rgb;[/CODE]?
Can you explain what the purpose of the mask is? Would it be possible to bake everything into a single texture instead?
Thanks,
Joe
lowp vec3 color = (color0) * lightMask.rgb;
?
Can you explain what the purpose of the mask is? Would it be possible to bake everything into a single texture instead?
Thanks,
Joe
Hello,
#ifdef GL_ES// define default precision for float, vec, mat.precision highp float;#else#define lowp#define highp#define mediump#endifuniform sampler2D sampler2d;varying lowp vec4 varColor;varying mediump vec2 varTexCoord;void main(){lowp vec4 texColor = texture2D(sampler2d, varTexCoord);#ifdef ALPHA_TEST_ENABLEDif (texColor.a < 0.9)discard;#endif// gl_FragColor = texColor * varColor;gl_FragColor = texColor;}Today we’ve made one more test, without texture at all. So we’ve used checker shaderwithout texture fetches, picture is the same(noisy borders). So problem is in texture coordinates.Because we generate checkers according to texture coordinates.Also we’ve tried to reverse texture coordinates. Problem always appear on the part of thelandscape where texture coords are closer to 1.0.We had one more idea, we’ve investigated today. U,V can’t be interpolated linearly in screen space,so if renderer is scan line based, it should interpolate U/Z, V/Z.We assumed that probably it can depend on values we writing to our Frustum matrix(zNear, zFar range).Instead of zNear:1, zNear:5000 we’vetried zNear:1.0 zNear: 100.0. Again no results.
Any ideas from developers of the hardware? How to deal with these issues?
Hi,
Apologies for the slow reply.
The artefacts you’ve seen are likely an accumulative error caused by wrapping texture coordinates into high values. For example, if there was an error of 0.001 between a 0.0 to 1.0 range, then using a value of 100.0 for a texture coordinate would mean this accumulated error would be 0.1. This is an unavoidedable situation where the varyings will eventually be impacted by the hardware’s maximum varying precision and is common to all GPUs.
One way of solving this problem is to handle the wrapping yourself to ensure all texture coordinates used are within the 0.0-1.0 range. The most efficient way of doing this would be to use a mod() operation on all of your texture coordinate data before it’s uploaded to GL, but for testing purposes you could also do the mod() in your vertex shader before you assign a value to the varying.
Let us know if this doesn’t resolve the issue for you.
Regards,
Joe