Remove Code Remove Shaders Remove Sprite
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
article thumbnail

Stacking Shaders: Problem with 'new EffectAsset' in code

Cocos

I am trying to create a 'CustomMaterial' to stack 2 shader effects. Maybe someone has a better way/idea to solve the problem of only having one CCEffect on one Node/Sprite/etc…? When I do effectAsset: new EffectAsset I get an error, because of the type mismatch. Thanks, tL.

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

Stacking Shaders: Problem with 'new EffectAsset' in code

Cocos

I am trying to create a 'CustomMaterial' to stack 2 shader effects. Maybe someone has a better way/idea to solve the problem of only having one CCEffect on one Node/Sprite/etc…? When I do effectAsset: new EffectAsset I get an error, because of the type mismatch. Thanks, tL.

Shaders 52
article thumbnail

Stacking Shaders: Problem with 'new EffectAsset' in code

Cocos

I am trying to create a 'CustomMaterial' to stack 2 shader effects. Maybe someone has a better way/idea to solve the problem of only having one CCEffect on one Node/Sprite/etc…? When I do effectAsset: new EffectAsset I get an error, because of the type mismatch. Thanks, tL.

Shaders 52
article thumbnail

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

Cocos

Thank you so much for telling me how to find that component, but it’s too bad it’s not related to the original problem, which is the shader. ;-( It’s simply an error log caused by a missing asset in some component. Is there a difference between applying the material to the sprite and the label?

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

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