Semi transparent Object behind walls?

I want to make an object to appear semi transparent when it is behind walls so that the camera would still be able to render it but in less solid form. Does this have to do with shaders or raycast? I not sure on the right keyword to search for the problem or even where to start. Hopefully someone could point me to the right direction. Thank you.

more ▼

asked Aug 08, 2011 at 09:39 AM

avatar image

130 23 21 21

This might be a stupid thing to ask, but I can't help my curiosity - Why is the object visible in the first place, if it's behind a wall? Is the wall itself transparent?

Aug 08, 2011 at 09:48 AM CHPedersen

I want it to be visible because the object is some sort of guidance to the player so that the player knows the location of the object wherever they are. The object is solid if the camera looks directly at the object and the camera would render it semi transparent when behind walls (will render through walls).

Aug 09, 2011 at 03:45 AM Sixakoo_
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Shaders. Basically, you need to render the object with two shaders: the normal material and one with an inverted Z test (as well as whatever glowing rim lit transparent whatever effect). Keywords:

 ztest greater shader

Try to make something with the Strumpy Shader Editor, or modify an existing shader source. This is a good simple intro to Shaders. You'll find they're quite fun.

more ▼

answered Aug 08, 2011 at 09:52 AM

avatar image

7.8k 68 103 116

Thanks for the answer, will try it!

Aug 09, 2011 at 04:08 AM Sixakoo_

Note that to render with two materials, you can just give it two materials in the MeshRenderer.

Aug 09, 2011 at 11:22 AM Waz
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Aug 08, 2011 at 09:39 AM

Seen: 2907 times

Last Updated: Aug 09, 2011 at 11:23 AM