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

Started by
2 comments, last by Shaarigan 6 years, 7 months ago

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?
Advertisement

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.

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.

This topic is closed to new replies.

Advertisement