Skip to content

trie94/pixelate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixelate Shaders in Unity

This is a sample Unity project that contains pixelate and selective pixelate shaders.

Pixelate Shader

pixelate

This is a simple shader in which it pixelates the entire scene. Simply attach the Pixelate script on to the Camera. Since this pixelates the entire scene, you can use any material/ shader to the game objects in the scene. Refer to pixelate scene for details.

Selective Pixelate Shader

selective pixelate

This pixelates only the target objects that have Pixelate Target script attached. You will not be able to see the pixelated objects until you enter the play mode. Command buffer is used to achieve this effect.

Here is how it works: we first get a clean background texture without the target objects drawn. To achieve this, target objects have an invisible shader attached to begin with. Once we get the background texture, it's time to draw the target objects with materials that we want to render with, and save it to the PixelatedTexture in the PixelateComposite shader. Now we have two textures, one without target objects, the other that only has target objects. Finally, in the PixelateComposite shader, we pixelate the texture that has the target objects, and combine it with the background texture. Refer to selectivePixelated scene for more details.

Reference

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published