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

[CC 3.7.3] Shader Error?

Cocos

I’m just learning how a shader works. So, I just copied from the built-in sprite effect file to mine. Now, back to the issue, I think, only “cc_matWorld” is used from #include <builtin/uniforms/cc-local> If I commented both of these lines, there were no error. But, everything stopped working as intended.

Shaders 40
article thumbnail

Shader on IOS error

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 error - Attribute a_uv0 is missing, add a dummy data for it. 17:39:35 [ERROR]: [ERROR] file /Applications/CocosCreator/Creator/3.8.0/CocosCreator.app/Contents/Resources/resources/3d/engine/native/cocos/renderer/gfx-metal/MTLCommandBuffer.mm:

Shaders 40
article thumbnail

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

Cocos

Hello, so my issue is such, I have made a shader that causes a UV distortion in the fragment shader, to simulate “flame-like” effects at the edges. There are two variants of these shaders, one where the distortion is dependent on cc_time[0] i.e the time elapsed in seconds when a game is running. 1.0 - newUV.x), min(newUV.y,

Shaders 40
article thumbnail

D2 log 074 – New level format

Catnip Games

I export the rendered terrain from Blender as a RGBA image but with alpha value set to depth. The custom terrain shader uses the z-channel to draw water in lower areas of the level. The graphics backend rewrite took a while. However, the situation is now good. Interactive elements will be placed using the in-game editor.

Terrain 52
article thumbnail

Making shaders more accessible

Mircosoft Game Dev

About shaders. For most game developers, shaders are this scary monster that presents itself with such a complexity that it seems out of reach. In reality, shaders are quite simple by default and just get more complex the more you add to them. Our sprite is 32x32 pixels in size, and it must be drawn at some position.

Shaders 52