Render Textures
How to Pixelate a 3D Game and Make Minimaps or Ingame Camera Systems
Object of Choice: Render Texture
If you like to make a Minimap, a Camera showing on a screen what it is filming right now, or like in my case, make a game look like it's a Pixel Game you can use Render Textures and multiple Cameras for that purpose.
1. Right click in your Projectfolder -> Create -> "RenderTexture"
You will get a Black Square in your folder which you can rename (MinimapRender, Pixel Render etc).
When you click on it you have now the option to set up some Properties:
Most important are the Size and Filtermode.
Size: you can set up the RENDER Size here. If you set it below your actuall size, for example "320:144" the Image will get Pixalated (like in my Game) - if you want a Higher resolution, set the Size to a Screensize like "1920:1080" and it will look like a Game Rendert in the same Resolution.
Filtermode: if you want to have a Vector or Smooth Rendering set the Filtermode to Billiniar. I went for "point" because this Option will set the Pixels without bluring them out in the Renderprocess.
2. Setup the Camera -> click your Camera in the GameScene -> and set the Target Texture with your new Render Texture.
Now everything the camera records will be shown on the Render Texture instead of the Gameview.
In the culling mask you can now setup which Layers should be renderd by this Cam. If you want to make a Minimap, make Minimap Icons hover above your Charakters and set the Culling mask in the MINIMAP CAM as true. and in the GAME CAM (where you see the Play running) as false. Now you can t see the Icons in the Game, but only on the Minimap Cam and hence on the RenderTexture.
3. Create a Canvas with a RAW IMAGE
If you like to make a Minimap you can set a RawImage with any size you like, and put the Render Texture as Texture into it. Now you will see on the UI what is recorded by the Cam that is targeting your RenderTexture. Set your MiniMap Cam as Child of the Player situtated above the PlayerObject to move it along with him and also change it from Perspektiv to Orthogonal.
If you want to create a Pixalated Game like mine, create a new Canvas, with only the Raw Image.
Set the Canvas sorting order to -1 so it is renderd below your UI.
Now add the Raw Image and set the Anchor by pressing ALT and the right bottom Anchor (blue big Crossing arrows).
Your Raw Image should fill all of the Screen now.
Next set your RenderTexture under Texture.
You may encounter a Problem with Unity telling you that there is no Cam in the Scene. You can simlpy workaround this by adding a Camera with a Cullingmask: Nothing. so it will render Nothing but it is in the Scene.
Please don t forgett to remove "Audio Listener" Components from each additional Camera if you add new into your scene.
I hope this was helpfull and I wish you alot of fun with your new Minimap or Pixel game.
Get [GameJam]Encounter on AZ-2
[GameJam]Encounter on AZ-2
Status | In development |
Author | Thetra00 |
Genre | Strategy, Survival |
Tags | Sci-fi, Space, Tower Defense |
More posts
- After Submission ThoughtsJun 25, 2023
- Day 3 Finishing StuffJun 24, 2023
- Day 2 at the JamJun 24, 2023
- Starting a new 3D GameJun 24, 2023
Leave a comment
Log in with itch.io to leave a comment.