Make all instances of the 3D models share the same texture?

Godot Version

4.3

Question

I have created a Node3D scene with a .glb file as its child node to be a 3D model test character. The .glb file has .png files in the FileSystem. In the debug room scene, I have tried spawning multiple instances of this.

But one thing I noticed that in the Debugger is that Video Mem and Buffer Mem usage keep on going up the more I spawn the test character. It seems each time I instantiated the character, the textures get loaded repeatedly into the Video Memory. Is my understanding correct?

How can I make it so all of these instances of the same 3D model share the same textures?

Make sure the material resource is not marked “local to scene” and save it to disk, that way you can assign it to multiple meshes while sharing the texture/material once.

1 Like

if that is correct you have to save the material to a file.

noooo
you have to take the glb file, create inherited scene, and save a scene.
you can skip a step, create inherited scene, and then copy the model and paste it, if there is no skeleton or animations.
using a glb file in your scene directly will cause problems.

1 Like

@jesusemora @gertkeno

I have tried saving to files already, and that process some more .res files with respect to the .png textures. The animations also got their own res files as well.

When I run the game though, it seems spawning more instances of the scene still increase video RAM usage.

During the re-import of glb , “local to scene” are not enabled.

Or am I misunderstanding something here?

EDIT: I will need to study more on Video Mem, Texture Mem, Buffer Mem and their relationship. For my case, Texture Mem did not increase on more instances being created so I believe the models are sharing the same texture already.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.