article thumbnail

How to get an array of pixel colors from an image?

Cocos

I’m trying to make an effect of pixels appearing with transparency and sequence (first the “darkest” then the rest of the pixels). I want to achieve the effect - “so that the pixels, like water, fill the empty mouth of the river.” But I couldn’t get the array of pixel colors.

Pixel 52
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. First, we get the uv of the surrounding pixel through the offset uv.

Sprite 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

Black screen on old devices cocos 2.4.11

Cocos

Also, take a look at the sprite data of the images that are showing up black… are any of them abnormally large? not file size large, but actual pixel size… if you have anything over 2k, I’d highly recommend making it smaller and testing. )

Pixel 52
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.

Pixel 52
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. This is consistent with how most image file formats store pixel data, and with how most graphics APIs work (including DirectX, Vulkan, Metal, WebGPU, but not OpenGL).

Shaders 98
article thumbnail

[Share] 2D Post-Processing & Lighting Framework

Cocos

The most commonly used method involves rendering the camera to a RenderTexture (RT) and then displaying it on a Sprite. Analysis of 2D Post-Processing Solutions Cocos Creator currently lacks built-in support for post-processing in the 2D render phase, requiring developers to explore various approaches to achieve the rendering goals.

Render 52
article thumbnail

Full Unity 2D Game Tutorial 2019 – Making Mini Map Mask

Game Development

To do that we will edit the spaceship sprite by clicking on it in the project window. Then set the pixels per unit to 64 and click apply to update the sprites. Full Unity 2D Game Tutorial 2019 – Mini Map Render Texture. In order to do that we first need to make a render texture. Mini Map Mask. Mini Map Mask Border.

Texture 52