mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[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:
parent
ad8f19632a
commit
ea452616b4
@ -61,7 +61,7 @@ namespace {
|
|||||||
\n #ifdef GL_ES\n
|
\n #ifdef GL_ES\n
|
||||||
varying lowp vec4 v_light;
|
varying lowp vec4 v_light;
|
||||||
varying lowp vec4 v_dark;
|
varying lowp vec4 v_dark;
|
||||||
varying mediump vec2 v_texCoord;
|
varying highp vec2 v_texCoord;
|
||||||
\n #else \n
|
\n #else \n
|
||||||
varying vec4 v_light;
|
varying vec4 v_light;
|
||||||
varying vec4 v_dark;
|
varying vec4 v_dark;
|
||||||
@ -78,12 +78,12 @@ namespace {
|
|||||||
|
|
||||||
const char *TWO_COLOR_TINT_FRAGMENT_SHADER = STRINGIFY(
|
const char *TWO_COLOR_TINT_FRAGMENT_SHADER = STRINGIFY(
|
||||||
\n #ifdef GL_ES\n
|
\n #ifdef GL_ES\n
|
||||||
precision lowp float;
|
precision mediump float;
|
||||||
\n #endif \n
|
\n #endif \n
|
||||||
uniform sampler2D u_texture;
|
uniform sampler2D u_texture;
|
||||||
varying vec4 v_light;
|
varying vec4 v_light;
|
||||||
varying vec4 v_dark;
|
varying vec4 v_dark;
|
||||||
varying vec2 v_texCoord;
|
varying highp vec2 v_texCoord;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 texColor = texture2D(u_texture, v_texCoord);
|
vec4 texColor = texture2D(u_texture, v_texCoord);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user