[cocos2dx] Fix UV precision in two-color tint shader for Android GPUs.

Use highp for texture coordinate varyings and mediump default precision
in the fragment shader. On Android GPUs, mediump/lowp don't have enough
precision for large atlas textures, causing visible jitter in sequence
animations.
This commit is contained in:
Mario Zechner 2026-02-16 09:52:48 +01:00
parent ad8f19632a
commit ea452616b4

View File

@ -61,7 +61,7 @@ namespace {
\n #ifdef GL_ES\n
varying lowp vec4 v_light;
varying lowp vec4 v_dark;
varying mediump vec2 v_texCoord;
varying highp vec2 v_texCoord;
\n #else \n
varying vec4 v_light;
varying vec4 v_dark;
@ -78,12 +78,12 @@ namespace {
const char *TWO_COLOR_TINT_FRAGMENT_SHADER = STRINGIFY(
\n #ifdef GL_ES\n
precision lowp float;
precision mediump float;
\n #endif \n
uniform sampler2D u_texture;
varying vec4 v_light;
varying vec4 v_dark;
varying vec2 v_texCoord;
varying highp vec2 v_texCoord;
void main() {
vec4 texColor = texture2D(u_texture, v_texCoord);