Project Pixworld
By : Madis-Julius Tamberg
The idea of this project is to create a shader in Unity to render everything pixelated, to turn 3d projects into a pixel art game. With it creating materials such as grass to simulate the effect of having grass. Materials like skin that are shiny. Possibly even light simulation.
The main effect is to reduce the need of creating textures for each thing, and have just materials on the 3d objects with paint on them, and the rendering pipeline creates the pixelated art style effect.
https://docs.google.com/document/d/17igFwhMzOzL2ai-DWYYIQisKiq0O6v0T9r9yNUH-AMs/edit?usp=sharing
Milestone 1 (10.03)
- Set up a simple 3D scene with basic object to test out future features on. (1h)
- A simple 3D scene was made, all with cubes, there are different items in there, a fence, dirt, grass, garden plot and an oven.
- Create the shader that pixelates the render. (5h)
- Decide if will be done via post-processing or each materials with its material simulation will have their own unlit or painted pixelated shader. Nothing too fancy, just to pixelate the view.
- Decided for pixelation to work on materials, i made a basic base for materials, that pixelates the object based on the parameters given to it. Ill attach images.
//How many pixels per world unit in unity. float3 pixelres = float3(_ScreenParams.x * 4, _ScreenParams.y * 4, _ScreenParams.y * 4); float3 resolution = float3(_ScreenParams.x, _ScreenParams.y, _ScreenParams.y); //Calculating the pixel size. float3 pixelsize = resolution / pixelres; float3 pixuv = worldPos3D / pixelsize; //Pixelizes it - snaps all values to the lowest pixel in that range. float3 pixelatedUV = floor(pixuv) * pixelsize / resolution; //im not sure yet if i need to normalize the uv to 0-1 range. maybe.
- Think and create a list of possible materials to add.(1h)
Material | Description |
Grass | Material that has a texture slot that will make a grasslike/moss like surface, the texture will will give the shape of the grass leaves |
Dirt | Material that has a texture slot that repeats, making the dirt look like there are pebbles in there and so, maybe give the pebbles volume |
Wood | Wood, straight forward like wooden planks, visible crevices (not just painted) |
Bricks | Like a brick wall, given a texture, will procedurally generate bricks on the said object |
Clay | Like dirt but different. |
Rocks | Simple, maybe use vertex fragment to generate a randomish rock based on location. |
https://imgur.com/a/work-E8H5BmQ Attach:image.jpg Δ
Milestone 2 (24.03)
- Research about unity's shaders, how lighting, fog, coordinates work. (2-3h)
- Implement a way to take in a black and white texture, and use it to give the object a texture.(5h)
- Experiment with vertex shader, to make everything based on the size of the pixel. Currently if object length % pixel size != 0, then there will be a leftover smaller pixel.(4h) (BONUS TASK)
Final bulid / Video