Jump to content

test for partial occlusion


dbawel
 Share

Recommended Posts

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 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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))

Link to comment
Share on other sites

@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

Link to comment
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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...