How to render only Parts of the Minimap?
I got an Labyrinthgame. Everytime the user comes to an dead end there is a little Object he can pick up to unlock a part of the minimap. In the beginning there is no minimap only when he picks up the first part. I tried using Blocks to block the view of the minimap camera and disabling them when the user picks up a map piece but I don´t want to have such an ugly black minimap where only a part is visible.
Using a screenshot from the Minimap and apply textures onto the blocks also won´t work because the color of the minimap should change when the user comes close to the end.
Answer by RafaelSchrenk · Jan 07, 2017 at 04:21 PM
Okay, solved the problem by using Depth Masks on the blocks that prevent the sight.
For everyone who want to do something like that do that:
Assets -> create Shader
Delete everything and enter following code:
Shader "DepthMask"
{
SubShader
{
Tags {"Queue" = "Geometry-1" }
Lighting Off
Pass
{
ZWrite On
ZTest LEqual
ColorMask 0
}
}
}
apply to a material and use that material on the blocks which should prevent sight.
Your answer
Follow this Question
Related Questions
Camera and fog 0 Answers
Can Cinemachine Virtual Cameras have their own culling masks? 1 Answer
[SOLVED]Why my culling mask don't work? 1 Answer
Can you still hit the collider of an object that's been culled via a camera's culling mask? 1 Answer
Best way to run a switchable 1st to 3rd person camera system? 1 Answer