- Home /
masking geo with a full screen texture
I'm trying to make an effect where I have a full screen circle gradient that would mask out a layer to be able to see through it.
ex: I have trees on one layer rendered by it's own camera. That layer also has a plane with a screen-space shader on it which I would like to use to mask out those trees to be able to see through them at the center. For whatever reason I can't get this to work. To give you a visual - imagine using a vignette as a mask for a layer's transparency.
is this at all possible? could it have anything to do with trying to mask out transparency with a deferred render?
http://forum.unity3d.com/threads/144581-full-screen-texture-mask-to-see-through-a-layer-how
do you need just something like this?
http://answers.unity3d.com/questions/267000/depth-mask-with-blending-edge.html
just explain what should be shown where mask covers image?
does two images you want lerp between are rendered by simgle camera?
can all object of one of theese two layers have one shader? if yes, you can use little custoized shader that will render with mask based on screen position
unfortunately, it's a lot more than simply lerping two images. I'm trying to basically have all the trees in my game not render around the player so that we can see the player at all times.
yes i see that it's a lot more the two images. that's why i asked about one shader for whole part of scene
hmmm... one thing I was thinking about is having a custom shader for all the trees that also include a "mask" input... which goes along with what you're saying (if I understand correctly). $$anonymous$$aybe the way to treat this is not by making the trees out as a group, but individually, while all using the same screen-space texture multiplied into the alpha. I hope this doesn't give me crazy overdraw issues.
I'll give that a go. And keep you posted.
Thanks!
Answer by stiltskin · Jul 21, 2012 at 08:28 PM
hmmm. this seem pretty close actually. That sample shader didn't seem to work though. here's a thread that I put up so that you can see an example:
http://forum.unity3d.com/threads/144581-full-screen-texture-mask-to-see-through-a-layer-how
Answer by stiltskin · Jul 21, 2012 at 08:28 PM
that seems pretty close. I added a url to a thread I started with some images to better explain. I tried the sample shader included but it didn't seem to work.
Your answer
Follow this Question
Related Questions
Everything above the player to be semi-transparent 1 Answer
How do I get my camera to render 2 culling masks in scripts? 2 Answers
mask one gameObject mesh by another mesh vertex transparency 1 Answer
Shadercode for alphatesting and transparency at the same time 0 Answers
Is it possible to change an animator layer mask through script? 0 Answers