Jump to content
  • Advertisement

C# Make geometry disappear in front of player if he gets too close? (VR)

Recommended Posts

I'm developing a game in Unity for the HTC Vive where I need to make 3D geometry disappear in front of the player if he gets too close so there isn't a weird moment where he is in front of a wall and then suddenly looking inside it. A transition of sorts.

But I also don't want the whole wall/object to disappear, rather just the part the player is moving through...

" rel="external">This is basically what I want to do, but in a different context. Does anyone have any idea how it's done?

Share this post

Link to post
Share on other sites

That game seems like it's probably using a shader that's reading depth (and possibly also incorporating distance from center of camera as well) and blending between (normal texture -> magical sparkly texture -> fully transparent) at different depth (or distance) thresholds.

Edited by Nypyren

Share this post

Link to post
Share on other sites

It seems like what we did in a prototype for our grass renderer. The grass faded out starting at certain distance to create a smooth vegetation effect using a simple shader and <PlayerPosition> to <VertexPosition> calculation. The result was clamped into certain range and then appended to the alpha channel.

Nypyren mentioned, this seems like a texture blend so the same approach as with out grass renderer would need just a little update to the textures color channel.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!