Jump to content

doNotAdd for Textures


3Dlove
 Share

Recommended Posts

Hi guys =D

 

With Material, we can create a Materail and don't add it to scene.materials due to that :

 

new BABYLON.Material(name, scene, doNotAdd)

the 3rd arg is used for that.

 

 

Is it possible to do the same with textures (and scene.textures) ?

the same with StandardMaterial and MultiMaterial ?

the same with StandardMaterial.clone(name) ?

 

Thank you ;)

Link to comment
Share on other sites

I don't understand RaananW :

there are these code lines here :

 if (!doNotAdd) {               scene.materials.push(this);            }

Good question :

I've notice that sometimes I create and use Textures and they are in the array "scene.textures" ; and sometimes they don't ;

whereas they are showed at screen (I don't why they aren't in the array),

I ask this question because it take may be less RAM memory if the texture isn't in this array.

 

I think dad72 has right : it is added to the array in the unique aim to access it later ;)

Link to comment
Share on other sites

What I meant was that this parameter is not used by any class that extends the material class. The material class is never used directly. Much like an abstract class. Check the constructor of the extended classes, they never call the full constructor of the material class.

JavaScript uses references when storing objects in arrays, so no ram will be saved as well...

Link to comment
Share on other sites

  • 1 month later...

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