article thumbnail

Sprite Shader Render out of bounds

Cocos

Good evening, I just finished writing my own custom shader to create 2D shadows on sprites, but I can’t find a way to increase the render area of ​​the sprite. The sprite size is 450x450, I created an atlas and used the trim option, this reduced the frame to 156x393. Is there a way to increase the render bounds?

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

article thumbnail

Cocos Shader Tutorial 1.0 - about UV

Cocos

The vertical axes of textures and picture pixels is shown above, when sampling textures in shaders, that is from top to bottom, which is top-right corner. Use UV in Shader Both 2D and 3D shaders in Cocos are obtained in the vertex shader (VS) and passed to the pixel shader (FS). x,waveFactor.y-uv0.y); x,waveFactor.y-uv0.y);

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

Default sprite shader alpha problem

Cocos

My sprite doesnt look right after given a material, I wanted to achieve a addtive like effect. heres what it looks like now! Im a new user and unfortunately I can only post one image. The source image has smooth alpha gradient. screenshot-20241218-160021|437x273 Im using cocos creator 3.8.3

Alpha 52
article thumbnail

Default sprite shader alpha problem

Cocos

My sprite doesnt look right after given a material, I wanted to achieve a addtive like effect. heres what it looks like now! Im a new user and unfortunately I can only post one image. The source image has smooth alpha gradient.screenshot-20241218-160021|437x273 Im using cocos creator 3.8.3

Alpha 52
article thumbnail

Default sprite shader alpha problem

Cocos

My sprite doesnt look right after given a material, I wanted to achieve a addtive like effect. heres what it looks like now! Im a new user and unfortunately I can only post one image. The source image has smooth alpha gradient.screenshot-20241218-160021|437x273 Im using cocos creator 3.8.3

Alpha 52