Remove Code Remove Shaders Remove Texture
article thumbnail

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

Cocos

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

Shaders 98
article thumbnail

Does the shader have a built-in function to get the texture size?

Cocos

Assuming you’re using the latest versions of GLSL, you can get texture size with the “textureSize()” Example code here… uniform sampler2D myTexture; // Uniform for the texture void main() { //Note: if you don’t specify a LOD, glsl will default to 0 automatically ivec2 texSize = textureSize(myTexture, 0); // Get size of the texture at LOD 0 int width (..)

Texture 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

Cocos Creator 3.8 Post-Process Shader Writing (2/2) Advanced

Cocos

Preface In the last article , Kylin shared how to add your own post-effect Shader in the custom render pipeline in Cocos Creator 3.8. However, based on the BlitScreen solution, we can only write the simplest post-effect Shader. Today Kylin will use Gaussian blur to demonstrate how to write a multi-pass post-effect shader.

Shaders 98
article thumbnail

Stacking Shaders: Problem with 'new EffectAsset' in code

Cocos

Can’t write up everything I rewritten in code. Also other error stuff after this and errors after the other errors Took me too long. Extremely tired now.

Code 52
article thumbnail

Stacking Shaders: Problem with 'new EffectAsset' in code

Cocos

Can’t write up everything I rewritten in code. Also other error stuff after this and errors after the other errors Took me too long. Extremely tired now.

Code 52
article thumbnail

Creating a See-Through | X-Ray Effect In Unity – Shader Tutorial

Awesome Tuts

If you’re a complete beginner who never coded a single game in Unity, start with the tutorial in the link below: Getting Started With Unity And C# If however, you know how to create basic games in Unity on your own, then you can follow this tutorial to implement this effect in your game. What Is a Shader?

Shaders 90
article thumbnail

Error in Custom Vertical Gradient Shader: "Can not find vertex attribute: a_texCoord"

Cocos

1.0), color, gradient); // Output the final fragment color gl_FragColor = texColor * gradientColor; } }% Can someone help me with this issue? 1.0), color, gradient); // Output the final fragment color gl_FragColor = texColor * gradientColor; } }% Can someone help me with this issue?

Shaders 40