Jump to content

alwaysSelectAsActiveMesh check


Hersir
 Share

Recommended Posts

Hi,

have some question regarding `alwaysSelectAsActiveMesh`.

was experimenting with `alwaysSelectAsActiveMesh` and saw that in `_evaluateActiveMeshes` there is check for active meshes:

if (mesh.alwaysSelectAsActiveMesh || mesh.isVisible && mesh.visibility > 0 && ((mesh.layerMask & this.activeCamera.layerMask) !== 0) && mesh.isInFrustum(this._frustumPlanes)) ...

Any reason why `isVisible` and `visibility ` is not checked before `alwaysSelectAsActiveMesh` ? 

Like this:

if (mesh.isVisible && mesh.visibility > 0 && (mesh.alwaysSelectAsActiveMesh || ((mesh.layerMask & this.activeCamera.layerMask) !== 0 && mesh.isInFrustum(this._frustumPlanes))) ...

It have some specific semantics ? As for me if mesh is not visible it should not be rendered

Link to comment
Share on other sites

@Deltakosh saw that this was merged, tried it,  all looked good but saw issues with visibility change,  for meshes were alwaysSelectAsActiveMesh is true, they dont react to visibility change until some child mesh is added to them. Could it be caused by this change or its related to freezeActiveMeshes from scene ?

Link to comment
Share on other sites

if you freezeActiveMeshes then they are no more evaluated and thus they stay in their current rendering bucket. Which means that if they were flagged with full visibility (opaque) they will stay opaque.

If you want to change visibility or alpha for meshes, you have to unfreeze / freeze :)

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