I’ve read in Nvidia’s GPU Gems Vol 1 that texture atlasing can be used to increase performance. I see this being obviously the case when used to consolidate materials in order to reduce drawcalls. But I have 2 questions about other uses.
Is there any performance benefit to having an objects multiple material maps (diffuse, normal, specular, emmissive etc.) combined onto a single texture or am I just doing weird stuff for no practical reason?
I have some meshes that use the same normal / specular maps but have different diffuse maps. I was hoping I could share the same material for these meshes and just set a unique uniform per object somehow. According to WestLangley in several posts over at SO, the only way to do this is by cloning the material which would share a reference to the shader program. Does this play nicely with
material.onBeforeCompilesince the program’s shader code is modified prior to compilation?
This demo utilizes both mentioned techniques.
I’m running a fairly decent PC, so I personally cannot see much of a difference performance-wise.