Results 1 to 7 of 7
  1. #1

    Limit on number of image textures in Cycles

    Quick question : is there a limit on the number of image textures Cycles can handle ? I'm trying to render a script-generated scene of 20,000 objects all with unique materials and image textures. However it seems that only the first 1,000 imported objects render correctly. The rest show up as uniform pink. If I move a pink object to another layer and render only that layer, it renders correctly. Similarly if I import it to another .blend it renders fine. I searched for this issue but could only find some very old references, mostly about the GPU but I am using the CPU.

    I suppose I could get around this with alpha-over composition but it would not be straightforward as I'm planning to have the camera move around quite a bit. Although the scene's got a lot of materials and objects it renders very fast since the materials are just shadeless and transparent, so apart from this one show-stopper it's working well. Unfortunately I can't use the BI engine as I want to render spherical stereo for a VR headset.

    Thanks !
    Rhysy.Net - a nice facetious website dedicated to the art of Rhysy - now works in all browsers ! Hurrah !
    Physicists of the Caribbean - follow my pointless adventures in a blog



  2. #2
    Member SterlingRoth's Avatar
    Join Date
    Mar 2006
    Location
    Portland, OR
    Posts
    1,922
    Yes, and it looks like you've found it.

    You could pack textures into atlases, but that could be time consuming for 20000 objects.

    what kind of objects are you working with?



  3. #3
    I remember this was changed not long ago
    not certain but max = 1000 I think !

    check the release notes

    happy cl
    Nice 3D models = 25 % K.I.S.S + 25 % common sense + 25 % Inspiration + 25 % Knowledge
    Win 10 64 bits / Thanks and a Happy 2.77 with Cycles



  4. #4
    Dang. There's not really any easy workaround in this case. They are all unique images of different sizes, so it wouldn't be straightforward to combine them or generate UV maps for each object. Plus each mesh needs to be a separate object to track the camera.

    I really wish spherical stereo worked for the internal render engine !
    Rhysy.Net - a nice facetious website dedicated to the art of Rhysy - now works in all browsers ! Hurrah !
    Physicists of the Caribbean - follow my pointless adventures in a blog



  5. #5
    Member Secrop's Avatar
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    1,750
    you could try to do what SterlingRoth suggests, using python... It may take some minutes, but will work..

    or grab a copy of blender source, and change the values in the intern\cycles\util\util_texture.h
    (I don't know if this will produce some domino effect, but you say the textures are small so there should be no problem)



  6. #6
    I'm not sure how I'd go about a Python-based solution. I guess the idea would be to combine the image files into a few large images, then use UV mapping to select the appropriate section of the large image, so that only the correct section of the image is shown on each plane. The problem there is that each image is a different size, so it would be non-trivial to combine them and select the appropriate sections for the UV coordinates. Complicated...

    Altering the Blender source sounds like a potentially better option, but I have no experience of the code or compiling it. Hmmm....
    Rhysy.Net - a nice facetious website dedicated to the art of Rhysy - now works in all browsers ! Hurrah !
    Physicists of the Caribbean - follow my pointless adventures in a blog



  7. #7
    Member Secrop's Avatar
    Join Date
    Dec 2011
    Location
    Berlin
    Posts
    1,750
    Originally Posted by Rhysy 2 View Post
    Altering the Blender source sounds like a potentially better option, but I have no experience of the code or compiling it. Hmmm....
    compiling is not that difficult...
    just follow the steps here:https://wiki.blender.org/index.php/D...ilding_Blender

    for editing, you can set the following values to 2048:
    Code:
    /* CPU */
    #define TEX_NUM_FLOAT4_CPU        1024
    #define TEX_NUM_BYTE4_CPU        1024
    #define TEX_NUM_HALF4_CPU        1024
    #define TEX_NUM_FLOAT_CPU        1024
    #define TEX_NUM_BYTE_CPU        1024
    #define TEX_NUM_HALF_CPU        1024
    note: I haven't tried this, but if your system has enough RAM to load every image, this should work ok.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •