Jump to content

Observed inactive meshes take just as much CPU as when active


JCPalmer
 Share

Recommended Posts

@fenomas:

1. I want to keep it as a function because it implies some drawbacks that the user has to understand. So I prefer having a explicit function there

 

Well, or setStatic(boolean), or even just freeze() / unfreeze(), etc. My aim was to obviate the question Jerome asked. The fact that meshes keep a cached world matrix is an implementation detail, and it's better if the user can intuit what APIs do without knowing how the implementation works, was my thinking.

 

 

 

Oh.. not sure why, but my scenes blew up if I froze stuff without waiting one frame. Once this API is in the playground I'll send you a repro.

 

 

3. Billboards need to have a new worldmatrix per frame. Because they are facing the camera

 

I understand that, just wondering if any other optimization is possible. (Though it now occurs to me that it'll still be a good optimization to freeze billboard meshes if they're far from the camera, and unfreeze them if they get close!)

Link to comment
Share on other sites

Here are the results of setting isEnabled(false) when showing the Dock panel & suspending Main panel, for my worse case Menu (Look & Feel / 894 meshes) :

 

IsEnabled        selection Potential FPS

--------------                 --------------  ---------------------

   true             90 ms       11

  false             19 ms       41

 

Meshes merged too  3.5 ms      145     (156 meshes)

 

Pretty convincing.  After implementing freeze, the Main panel when actually visible, should get some of that improvement in mesh selection time.

 

I think that the lines of unfreeze are in the wrong order though, since the computeWorldMatrix(true) call does nothing:

public unfreezeWorldMatrix() {    this.computeWorldMatrix(true);    this._isWorldMatrixFrozen = false;}

Think there should be a way to tell if a mesh is frozen.  This would allow code that perhaps animated it, to get the value, unfreeze it, & set it back to what it was.  Like POV ;) .

 

BTW,  my implementation of freeze in Dialog will be to override the methods, to do the children as well.

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