Jump to content

Should I use Occlusion Queries


BlackMojito
 Share

Recommended Posts

Hi Guys,

I need to render very large architecture models. But in one certain frame,  most of the objects in the scene are not visible. It seems that Occlusion Query can help a lot on such models. Because I have no experience on it. Could you please tell me if it is a good choice?

Thanks

Link to comment
Share on other sites

Hello, unfortunately occlusion queries are only available on webgl2

If you don't have a lot of meshes, you can just let Babylon.js deals with it as we have a complete frustum culling in place.

If you know which objects are not visible you can also manually call mesh.setEnabled(false)

in 3.2, we will introduce the notion of Containers that can be used to turn on/off large number of meshes

Link to comment
Share on other sites

6 hours ago, Deltakosh said:

Hello, unfortunately occlusion queries are only available on webgl2

If you don't have a lot of meshes, you can just let Babylon.js deals with it as we have a complete frustum culling in place.

If you know which objects are not visible you can also manually call mesh.setEnabled(false)

in 3.2, we will introduce the notion of Containers that can be used to turn on/off large number of meshes

That's interesting. What is the millstone for 3.2? :lol:

Link to comment
Share on other sites

  • 4 weeks later...
On 1/8/2018 at 5:26 PM, Deltakosh said:

Hello, unfortunately occlusion queries are only available on webgl2

If you don't have a lot of meshes, you can just let Babylon.js deals with it as we have a complete frustum culling in place.

If you know which objects are not visible you can also manually call mesh.setEnabled(false)

in 3.2, we will introduce the notion of Containers that can be used to turn on/off large number of meshes

I want to comment on this topic  before I forgot about it.  Can I ask how this might be implemented? A "Container" referenced in a Mesh, or Mesh in a "Container" dictionary?

This can very good for large scenes from Blender.  The Layer construct within Blender can support up to 20 "Containers".  The "Only selected Layers" boolean property could be replaced with a dropdown of:

  • All Layers
  • Selected Layers only
  • Layers as containers (or whatever they are called)

This could lead to the building really big sets from a single .blend for all the static structures meshes without all the javascript code to control things.  I must admit that .ktx compressed textures have been a big disappointment, but when they are also mixed into the workflow along with the hidden "Force baking" checkbox, things could really scale up. 

.ktx only really shines with 4K textures.  A 4k textures (with minmaps) only takes up 5mb gpu ram.  Without compression 4k takes up 65 mb ram.  A work flow which exports containers might work like:

  1. For each Layer, manually select all <A> meshes, and merge <ctrl-J>
  2. Click 'Force Baking' on each merged mesh & set size to 4K.
  3. Export, remembering not to save .blend, so further edits possible.
  4. Run batch script to generate compressed formats required.
Link to comment
Share on other sites

4 hours ago, Deltakosh said:

Here is the container doc: http://doc.babylonjs.com/how_to/how_to_use_assetcontainer

A container is a virtual group that can add / remove meshes in one call. 

Thanks! It is really useful for me to implement progressive rendering when the model is too big. I will read the source code too.

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