Remove Alpha Remove Sprite Remove Texture
article thumbnail

How to convert a Shadertoy shader for Cocos Creator 3.8.6 (Web build)?

Cocos

to pass the uniform to the material like this: @ccclass("WormHole") export class WormHole extends Component { material: Material = null; onLoad() { this.material = this.getComponent(Sprite).sharedMaterial; Then create a sprite and assign the material just created to it. Finally I added the component to the Sprite. float ap = 1.0;

article thumbnail

Issue with masking a render Texture

Cocos

Hello all, I have a shader that takes the alpha value of one texture and applies to a sprite frame. I prefer to go this way so that I can have a gradient fade to transparency… the mask component uses the stencil buffer and isn’t set up to use alpha blending and therefore cannot utilize the gradient of alpha values.

Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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. aExtend is the expanded Alpha. Here, we take the opposite approach.

article thumbnail

Issue with masking a render Texture

Cocos

Hello all, I have a shader that takes the alpha value of one texture and applies to a sprite frame. I prefer to go this way so that I can have a gradient fade to transparency… the mask component uses the stencil buffer and isn’t set up to use alpha blending and therefore cannot utilize the gradient of alpha values.

article thumbnail

Cocos creator (2.4.13) Effect Material is not centered at the Sprite Node

Cocos

5 + ((gl_FragCoord.xy)/ iResolution.xy); p.x *= iResolution.x / iResolution.y; float dist = length(p); float radius = ((cc_time.x) ) * 0.3; float intensity = smoothstep(radius, radius + 0.15, dist); gl_FragColor = vec4(1.,1.,1.,intensity); intensity); } }% // In typescript this.

article thumbnail

Cocos Creator 3.7.1 Black edges on images

Cocos

The black border is due to the fact that in the WebGL program, when drawing, the texture object’s Filter is set to gl.Linear (linear filtering), when a semi-transparent pixel is sampled adjacent to a fully transparent pixel during pixel interpolation (e.g.,(0.1)).0, 0) of this kind) produces black or white pixels. png.zip (8.6 zip (636.5

article thumbnail

D2 log 074 – New level format

Catnip Games

Everything is just one big texture. I export the rendered terrain from Blender as a RGBA image but with alpha value set to depth. This gives me freedom in level design and saves work making tiles… tileable. This gives me freedom in level design and saves work making tiles… tileable. So it’s RGBZ.