dbawel Posted June 27, 2018 Share Posted June 27, 2018 Hello, Can anyone explain how to use the info below? I can place multiple bounding boxes on an object to easily test for partial occlusion, as well as other methods which are more code intensive; but does this feature really exist? Quote ... Improved building process: We now run a full visual validation test for each pull .... Documentation (deltakosh); Added support for WebGL Occlusion queries. ..... now has optional count as well as offset to allow partial updates (benaadams) ... I may be misunderstanding the above, but got to the release notes and it sounds like what I need. Otherwise, I'm open to any reasonable approach Thank you, DB Quote Link to comment Share on other sites More sharing options...
dbawel Posted June 27, 2018 Author Share Posted June 27, 2018 Got it! PG scene with simple camera navigation... http://www.babylonjs-playground.com/#T1XT59 DB Quote Link to comment Share on other sites More sharing options...
dbawel Posted June 27, 2018 Author Share Posted June 27, 2018 No, not yet... How do I test for partial occlusion, not fully occluded. Face culling? Using camera Frustum? @Deltakosh? Who might I ask? Thanks, DB Quote Link to comment Share on other sites More sharing options...
Guest Posted June 28, 2018 Share Posted June 28, 2018 Ouch partial occlusion is really a complex task... it requires either image analysis, or ray casting. Perhaps if you consider only the bounding sphere? You can them project them and compare the distance? Quote Link to comment Share on other sites More sharing options...
dbawel Posted June 28, 2018 Author Share Posted June 28, 2018 @Deltakosh I initially presented your approaches (and built several scenes) to the company that requires partial occlusion for a specific project, and as I expected, it's not what their client needs. The real task is to not render the mesh if it's even slightly occluded. I can potentially modify a few fragment shaders I've found on GitHub, but this is quite a task for me; as well as working within their schedule and budget. How might I use the vertex buffer or faces... or perhaps normals, so that I can set a tolerance which will not render the entire object based on the # of one or more of these attributes of an object which is partially occluded? This is the simplest method I can think of, and I was hoping someone on the forum might provide some experience in which method(s) might be best to approach this. Otherwise, it appears that currently I'm looking at a very complex shader implementation. I'm really looking forward to WebGL 2, as I believe these features will be much simpler to implement. I've been using some of these features for a few months, and would love to jump into a time capsule and develop with all the future tools. But here's where we start, and I'm happy to build it if no one else is in need of this currently or has interest. But if you do a braod search, this is something that is used in many renderers, and the need definitely exists. Thanks DK, DB Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted June 28, 2018 Share Posted June 28, 2018 DK is right, that is tough.... Umm go with the bounding box and you will have to cast at least 4 rays to the closest 4 corners. If one of the rays collides any other mesh the target mesh is partially occluded. But that's kinda hacky. Quote Link to comment Share on other sites More sharing options...
dbawel Posted June 28, 2018 Author Share Posted June 28, 2018 @Pryme8 Hey, answer your phone sometime... anyway, that doesn't really work that well... explored it already. The only other solution which appears simple to me, is to parent simple meshed (planes) to the edges of the geometry. Then I have enough info to make the mesh invisible once the 'small' place child is registered as occluded. But I'm looking for a more elegant solution. Come on dude, you can do better than that. I still love ya my Brother, DB Quote Link to comment Share on other sites More sharing options...
Nabroski Posted June 28, 2018 Share Posted June 28, 2018 Sounds interesting. In case of a "not very complicated" 3D babylonjs scene like the playground you shared, a way of image analysis could be to set up two cameras e.g facing opposite to each other, or one of them is tracking a specific object. With this setup you would obtain two informations about the scene, you can test against. Like a trivial test for color in each camera view, if a sphere would be 100% red for one camera you could set up a threshold how much red the second camera is be able to receive. (Some creative input (untested)) dbawel 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted June 28, 2018 Share Posted June 28, 2018 5 minutes ago, dbawel said: @Pryme8 Hey, answer your phone sometime... I cant answer it during normal business hours unfortunately. Quote Link to comment Share on other sites More sharing options...
dbawel Posted June 28, 2018 Author Share Posted June 28, 2018 @Pryme8 I don't want to turn this topic into something different, so I'll quote the last post. However, what are you now? CIA, NSA, etc... 11 minutes ago, Nabroski said: Sounds interesting. In case of a "not very complicated" 3D babylonjs scene like the playground you shared, a way of image analysis could be to set up two cameras e.g facing opposite to each other, or one of them is tracking a specific object. With this setup you would obtain two informations about the scene, you can test against. Like a trivial test for color in each camera view, if a sphere would be 100% red for one camera you could set up a threshold how much red the second camera is be able to receive. (Some creative input (untested)) Anyway, @Nabroski just posted a potential simple solution. Thanks. DB Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted June 28, 2018 Share Posted June 28, 2018 If I told you I’d have to kill you ❤️. Jk .... not kidding... kidding, maybe dbawel and GameMonetize 1 1 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.