article thumbnail

How to make a neon effect in a shader?

Cocos

Hello, you may want to change the uv0 settings from the shader code. So 0 means the far left side of the sprite and 1 represents the far right side of the sprite. In the example they show on the manual, they made it so that the effect changes along the x-axis from the uv0.x It is important to know that the uv0.x

Shaders 52
article thumbnail

Tutorial: Cocos Shader Series - Use a Noise Map to Make a Dissolve Texture

Cocos

Blockquote const sprite = this.getComponent(Sprite); const mat = sprite.customMaterial; mat.setProperty(‘dissolveThreshold’, 0.5); Version 3.6.x, x, I using this code but it not bring Property affect to shader Ok, this work if turn of Packable in main Sprite inspector

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

[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. The above is the part of the custom post-processing shader.

Sprite 52
article thumbnail

Can someone provide a working shader code for cocos2dx 4?

Cocos

Hello, before refering me to the tests or explaining in the theory what a shader is and how code it, can someone actually share a simple working code to apply to a sprite? I have been researching for a week now through old threads and tutorials all over the internet and the code has completly change in cocos2dx 4.0,

Shaders 40
article thumbnail

Sprite Outline Shader in Unity

Febucci

In this “Unity Sprite Outline” tutorial we’ll discover how to create both a “Sprite Innerline” and a “Outer Sprite Outline”. Simply, the Inner Sprite Outline shader is drawn “inside” the sprite, while “Outer” is the opposite. Inner Sprite Outline HLSL. Outer Sprite Outline HLSL. Amplify Shader.

Sprite 52
article thumbnail

How to get an array of pixel colors from an image?

Cocos

I installed extensions in VS C (Cocos Effect, Shader languages support for VS Code) my next thought was to get into the shader to try working with the texture there, but I ran into difficulties: 1.) I want to achieve the effect - “so that the pixels, like water, fill the empty mouth of the river.”

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