Remove Alpha Remove Shaders 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

Shader Problem in IOS

Cocos

I have a question related to shaders. I created a game in which I added a shader; it works fine in web mobile and Android, but in iOS it gives an error during rendering. How to solve this issue version-3.8.2 17:49:37 [ERROR]: [ERROR] file /Applications/Cocos/Creator/3.8.2/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm:

Shaders 40
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

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 Problem in IOS

Cocos

There is also two more custom shader // Copyright (c) 2017-2020 Xiamen Yaji Software Co., pos = inTransform * pos; //cc_matViewProj * #endif uv0 = a_texCoord; #if SAMPLE_FROM_RT CC_HANDLE_RT_SAMPLE_FLIP(uv0); #endif color = a_color; vec2 singleStepOffset = vec2(3.0/4096.0,

Shaders 40
article thumbnail

Shader display problem

Cocos

// Copyright (c) 2017-2020 Xiamen Yaji Software Co., 1.0], editor: {type: color} } endColor: { value: [1.0, o.r = o.g = o.b = gray; #endif #if USE_HORIZONTAL o.rgb *= mix(startColor, endColor, vec4(uv0.x)).rgb; rgb; #endif #if USE_VERTICAL o.rgb *= mix(startColor, endColor, vec4(uv0.y)).rgb; 1.0], editor: {type: color} } endColor: { value: [1.0,

Shaders 52
article thumbnail

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

Cocos

intensity); } }% // In typescript this. . // Effect (Fragment Shader) CCProgram fs %{ precision highp float; #include <alpha-test> #include <texture> #include <cc-global> in vec4 v_color; #if USE_TEXTURE in vec2 v_uv0; uniform sampler2D texture; #endif uniform Constant{ vec2 iResolution; }; void main () { vec2 p = -.5

Sprite 52