Shader texture size issues

hi,
I modified the builtin-2d-sprite shader to multiply the color of another texture to the already existing fragment color.

vec4 o2 = vec4(1,1,1,1);
#if USE_TEXTURE
  CCTexture(gradientTexture, v_uv0, o2);
#endif
o *= o2;

basically I added gradientTexture in the properties, declared it as a uniform sampler 2D, and used the above code in the fragment shader.
now, when the ui texture is large(100+ X 100+) pixels, this shader works no matter what the size of gadientTexture. but if the original ui texture is small in size the sprite disappears.
with labels, the story is different. the label shows up only when the gradient texture is large in size and when the gradient texture is small the label completely disappears.
by the way, in the scene view, the correct(expected) results show each time. it is just the simulator where the above problems occur.
thanks!
P.S. Maybe the CCTexture function has a size limit for textures…but why then was it showing up properly in the scene view?

It may be that the uv recorded by SpriteFrame is not updated, can you provide a simple demo of this?

I don’t know if the problem exactly same but there is a trick when you’re working with shaders in Cocos Creator. Dynamic atlas feature changes all uv values in shader code. Here is one of my tutorials about that subject, it may help.