We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Reduce Shaders

Home Forums General Questions Reduce Shaders

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #44621


    I’ve got quite a heavy application and trying to optimize everything as much as possible. The batchGeometry feature already helped a lot, but I still wondering if there is more I can do.

    I looked quite extensive into the docs with all the optimization parts, and still wondering about the shader stuff. I’ve got many objects which got a very simple material, with just a diffuse texture. So I would say 80% of my application got the same material which just differs by the used diffuse texture. This point in the docs attracted my interest:

    If you have similar materials that only differ by textures, you can use only one material and load/swap its textures at run time. For this, you can use the replace texture puzzle or do it with JavaScript. This not only will optimize the number of shaders but also will reduce the number of images loaded at application startup.

    I was now wondering how that approach whould look like in the real world. Whould I have to create just on material in 3dsMax which is applied to all objects and then replaceTexture on runtime for every single object with the proper one? Wouldnt I need to copy the material first for every object, because its instanced and used for all objects?

    Is the batchGeometry option already doing that stuff automatically? Would be great if someone of the devs could shed some light on that situation :rose:


    I thinks using one shader for multiple object by replacing it’s texture with puzzles possible only if this materials displayed at the same moment only in one of it;s object otherwise it will replace texture on all your object. Reducing amount of shaders depends on shaders and application, in one application you may just join all models with the same materials or use batching in another you can replace textues with vertex color or bake few textures into one texture or reuse textures or combine then by RGB channel and so on. All depends on a scene and it’s content.

    Co-founder and lead graphics specialist at Soft8Soft.


    In that particular scene all of that objects are displayed at the same time. So I could only use replaceTexture when doing a copy of the material for every single object. Which makes the approach, exporting with only one material for all the objects, obsolete.

    But I don’t get what would be the real world approach for the quote I referenced in my first post from the documentation. Only thing I could see is that the images arent loaded on startup.

    • This reply was modified 2 weeks ago by web.

    If you have material that replaced by another material but the only difference they have is texture, but they have the same structure than you can use replace texture instead of creating multimple amount of texture and replace one by another.

    Co-founder and lead graphics specialist at Soft8Soft.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.