Keslinger Posted July 7, 2017 Share Posted July 7, 2017 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! Quote Link to comment Share on other sites More sharing options...
JohnK Posted July 10, 2017 Share Posted July 10, 2017 I know nothing about this but IMHO it must be difficult otherwise someone would have done the code so that the light from a spotlight would be blocked by a mesh but as you can see it is not. http://www.babylonjs-playground.com/#20OAV9#31 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.