How do you make a transparent volume you can go inside
I am trying to make a colored volume, for example a cube or cylinder with a red hue, where the player can "see" through it and walk through it.
I started by making a cylinder and applying a transparent texture and removing the collider. From outside the volume everything looks good. However once the camera is inside, the cylinder disappears.
This makes sense because the textures are on the outside. I could turn culling off on my texture to see the sides of it again, or I could create an inside out cylinder and apply textures to see the sides. But what I really want is to have an "underwater" type effect where everything is tinted red while in the volume.
This seems similar to a player going from the ground and entering the water. So there may be times the camera is hall inside and half outside.
I am very new to unity. Any help you can provide on directs to take would be much appreciated.
Try to use the cylinder collider as a trigger, if the player is inside the volume show the underwater effect
Answer by seth_slax · Mar 25, 2016 at 02:58 AM
I would say there's likely a shader out there that renders both sides of geometry faces (with transparency), but a hacky solution I can think of is to use one of the shaders from here: http://docs.unity3d.com/Manual/SL-CullAndDepth.html
Have your cylinder with the transparent texture as you have already, duplicate it, make it slightly smaller in scale and apply a flipped-normals, transparent texture on the inner cylinder. Since both are only one-sided, I can't see the transparency overlap being a problem.
Your answer
Follow this Question
Related Questions
Water shader change 0 Answers
Transparency using Scene Color node not layering multiple transparent objects over each other 0 Answers
Transparency without additive blending 1 Answer
Underwater effect 2 Answers
How can I animate Low-poly Water? 1 Answer