Remove Alpha Remove Code Remove Sprite
article thumbnail

[Tutorial]Outer Stroke Effect for 2D Sprites

Cocos

Original: [link] Author: BitByBit Outer Stroke Effect for 2D Sprites Continuing from the previous article Inner Stroke Effect for 2D Sprites Introduction In the last article, we introduced the method of inner stroke and also discussed its pros and cons. aExtend is the expanded Alpha. Here, we take the opposite approach.

Sprite 52
article thumbnail

Cocos creator (2.4.13) Effect Material is not centered at the Sprite Node

Cocos

height)); I am considered myself as a beginner of GLSL shader coding and would be appreciated if anyone would explain to me and show me how to fix this. However the effect position is not changed at all. The goal is to make my effect able to follow the position of my node. float dist = length(p); float radius = ((cc_time.x) ) * 0.3;

Sprite 52
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Sprite Object Shape question

Cocos

I had tried the mask method already with no luck… but you mentioning it here pushed me to go try it some more… actually, I still had no luck using the graphic stencil… but the graphic ellipse did the trick perfectly! You saved me so much time!

Sprite 40
article thumbnail

Shader doesn't work on brower, or run it in the editor

Cocos

y * sin(rad); o.rgb *= mix(startColor.rgb, endColor.rgb, smoothstep(edge1, edge2, diagCoord)); o *= color; ALPHA_TEST(o); return o; } }% [topic] When I use above codes, the shaders I apply to the sprite work fine when I’m in the editor, or when I run it in an emulator. 1.0], editor: {type: color} } endColor: { value: [1.0,

Shaders 40
article thumbnail

Shader doesn't work on brower, or run it int the editor

Cocos

y * sin(rad); o.rgb *= mix(startColor.rgb, endColor.rgb, smoothstep(edge1, edge2, diagCoord)); o *= color; ALPHA_TEST(o); return o; } }% [topic] When I use above codes, the shaders I apply to the sprite work fine when I’m in the editor, or when I run it in an emulator. 1.0], editor: {type: color} } endColor: { value: [1.0,

Shaders 40
article thumbnail

Shader Help required (UV distortion with cc_time[0])

Cocos

1.0 - newUV.x), min(newUV.y, 1.0 - newUV.y)); // Calculate the flame distortion amount based on the distance from the edge float distortionAmount = flameIntensity * (1.0 - smoothstep(0.0,

Shaders 40
article thumbnail

Making shaders more accessible

Mircosoft Game Dev

To explain the idea of how shaders work, let's consider a very simple shader for drawing a sprite to the screen. Our sprite is 32x32 pixels in size, and it must be drawn at some position. The following OpenGL code sends the sprite to the shader for drawing: OpenGL Commands. Vertex Program. Multiply by 2. Substract (1, 1).

Shaders 52