article thumbnail

Get pixel color of an image

Cocos

You can pass your render texture to Camera as a targetTexture. Or even use special custom layers for nodes that should be visible by camera with render texture target. You can use second camera for it.

Pixel 40
article thumbnail

Label Plus – An SDF-based BMFont generation and rendering plug-in is here!

Cocos

SDFs make specific textures that give a pixel a value for the distance corresponding to the boundaries of the image. So using the SDF we discussed allows the fonts to be filled in with the correct pixels, no matter the size, with the help of the SDF shader information. To fix this, the use of SDFs are used.

Render 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

Shooting raycast through canvas

Cocos

I am rendering the game through RenderTexture for pixelated effect and when it’s enabled, I can’t shoot through it. Canvas Disabled and Target Texture not set (click for more details) Canvas Enabled and Target Texture set (click for more details) Project files: 5.3 MB file on MEGA

Pixel 52
article thumbnail

[Tutorial]Outer Stroke Effect for 2D Sprites

Cocos

Principle Since it’s an outer stroke, it doesn’t occupy the pixels of the original image to draw the edges. Remember the previous article, where we used the image’s Alpha to find edges, determining whether there were pixels with Alpha of 0 around the image. First, we get the uv of the surrounding pixel through the offset uv.

Sprite 52
article thumbnail

[Share] 2D Post-Processing & Lighting Framework

Cocos

Post-processing effects, are used for further processing of rendered results to achieve various advanced and special effects. 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

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

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

Game Development

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. Our Camera is still working like a normal camera, we want it to render its view to an image instead of to us the player. In order to do that we first need to make a render texture.

Texture 52