Remove Shaders Remove Sprite Remove Texture
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

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. If your previous development experience is based on OpenGL, you may find that the texture on your grid is vertically flipped. to make the color in bottom darker.

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

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

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. Read more about “Texture’s Texel Size” here. Inner Sprite Outline HLSL.

Sprite 52
article thumbnail

How to create waves in shader?

Cocos

I have a sprite (a regular line) and I wanted to apply a wave effect to it. It looks like a wave, but it goes beyond the texture area. I tried to normalize by passing the dimensions of the sprite (line) to the shader like this mat.setProperty("iRsolutetion", new Vec2(1.0 / this.node.getComponent(UITransform).contentSize.width,

Shaders 52
article thumbnail

Shader display problem

Cocos

On a smaller texture, the distortion is greater than on a larger texture. The HelloWorld texture has a size of 196 X 270. One shader is used, only the sprite texture changes. I scaled it up in the graphics editor to 400 x 554 and the distortion is barely noticeable.

Shaders 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