2
$\begingroup$

enter image description hereLets say we have 1024x1024 PNG texture called Texture.png I Have multiple materials using the same texture, on import the textures were automaticly renamed to .001 .002 .003 etc. And Im out of GPU memory

Is Texture.png and Texture.001.png just a single texture in the GPU memory or they are occupiing new space with each instance?

EDIT: this works on console, but not in practice, images are still there...

import bpy

for img in bpy.data.images:
    print("%s" % img.name)
    if( ".0" in img.name):
        img.name=img.name[:-4]
        print("%s" % img.name)
$\endgroup$
2
  • 2
    $\begingroup$ they are occupying new space with each instance, you can also easily test it. $\endgroup$ Commented Jan 31, 2016 at 15:06
  • $\begingroup$ I tested it on a new scene, I duplicated one texture to other 24 instances, but I can still render the scene on GPU... $\endgroup$
    – r3aktormk
    Commented Jan 31, 2016 at 15:09

1 Answer 1

1
$\begingroup$

They are not the same. If I understand you correctly they are imported as different pngs and in that case they have to be loaded to gpu memory to be used. Why don't you reload one copy in node editor for all materials using this texture?

I set up a test scene with 3 cubes. Different materials for each but in the first screenshot the same texture used in the image texture node for each material. In the second screenshot there are copies of the same texture loaded and gpu memory load goes up...

Same texture in 3 different materials. enter image description here

Different Textures (Copies) in each material. enter image description here

Here is a screenshot of my node setup. Only one of the three different textures is in us. The other two are marked with no user by a 0 in front.

enter image description here

$\endgroup$
4
  • $\begingroup$ Ill try again, I uploaded screenshot of the problem... $\endgroup$
    – r3aktormk
    Commented Jan 31, 2016 at 15:27
  • 1
    $\begingroup$ I added an new image. In my first setup, there are 3 images loaded, but only the first ist actually used. The two others won't be loaded to cycles as it is indicated by the 0 in front of the texture. In your screenshot it seems to me that all textures are used as separate textures... And that is the problem in my opinion. How many different materials are applied to your modell? $\endgroup$
    – maegmaeg
    Commented Jan 31, 2016 at 15:38
  • 1
    $\begingroup$ Many different materials are using the same texture, because on import, blender assigned them as .001 .002 .003 etc. Now im making a script to delete the last 4 letters if there is a [.] in the name, and use the original texture. $\endgroup$
    – r3aktormk
    Commented Jan 31, 2016 at 16:00
  • 1
    $\begingroup$ And there is the problem. In every material the texture is loaded again and this needs a lot of ram... $\endgroup$
    – maegmaeg
    Commented Jan 31, 2016 at 16:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .