Jump to content

Heist game vision clipping?

Recommended Posts

Hey, all.

This isn't about Babylon specifically, so perhaps it belongs in a different forum.  I am doing this with Babylon, so maybe it belongs here :)  Let me know and I'll move it.  Actually, if someone knows the correct term for this, it would make my Google search much easier. apparently "you know, that thing that heist games use where it clips the view of guards or cameras" isn't a valid search term.

I'm trying to create a 'vision arc'.  I've attached a doodle (top down) that shows what I'm talking about.  Our guard (blue dot) can't see past walls (black).  I'm trying to create a visual representation of his view area (green). I'm thinking about this a couple of different ways, but none of them are really making me happy.  How do I go about creating this? I know it's been done before on Heist games that show you where the guard/camera can see.

1)  A shader, much like a spotlight shader, but from the guard's PoV?

2)   DepthRenderer (from the guard's perspective) and pass that texture to a fragment shader that uses it to figure out what to discard?

3) A whole bunch of raycasts and generate a mesh from where they hit things (or ray length)?

Any help would be appreciated!



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...