Quantcast
Channel: Questions in topic: "renderqueue"
Viewing all articles
Browse latest Browse all 161

How do I create an invisible mask that hides the 2nd closest object behind it?

$
0
0
Let's say we're in 2D view and there are 3 objects that have different z position values and partially overlap each other: InvisibleMask, ObjectA, and ObjectB. InvisibleMask is closest to the camera, then ObjectA, and then ObjectB. If I want to use InvisibleMask to only hide ObjectB where InivisibleMask overlaps ObjectB and not hide ObjectA at all, I can set the renderqueue of ObjectB to be higher than that of InvisibleMask while setting the renderqueue of ObjectA to be equal to or less than that of InvisibleMask. However, by doing so, ObjectB will appear in front of ObjectA where InvisibleMask does not overlap ObjectB, even though ObjectA is really in front of ObjectB. ObjectB now has a higher renderqueue than ObjectA, but I don't understand why this would cause ObjectB to appear in front of ObjectA when ObjectB, which also has a higher renderqueue than InvisibleMask, does not appear in front of InvisibleMask. InvisibleMask has to be closest to the camera for reasons, so given this constraint, is what I'm trying to do even possible? It seems that I have to somehow give the same renderqueue to both ObjectA and ObjectB except for where InvisibleMask overlaps ObjectB.

Viewing all articles
Browse latest Browse all 161

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>