Hi everyone!
Quick question; I am trying to reduce the texture sampler amounts in my mega shader. Currently I have 4 textures in there and I plan to reduce them to one, hoping to gain mobile phone performance by doing this. At least I do get the texturesampler bind calls pretty frequently!
But the actual question; what is the best way to use the same texture sampler multiple times in node material editor, since I need to offset the uv:s when merging four textures into one texture?
Thanks in advance for all the help you can give me 
Further elaboration, I created a NME for this, which you can look here:
Babylon.js Node Material Editor
I have a palette texture I am using in my game, and then also other textures to bring in some detail or add some “moving cloud” effect. In the NME there is only the palette with detail to illustrate the problem in a simple way.
This creates two new textureSamplers, and I do not know if this is any better than the previous version with multiple different textures that were not a single texture like that one in the example NME. This is why I’m asking how to basically have one texture that is inserted to the shader and then the sectors are mapped.
All this is to make the mobile gods pleased and give me better fps
If you have any suggestions, I would gladly hear them! Or if this even helps with mobile perf…
Does it really matter if there are 4 texture samplers, if they use the same texture?
To reuse the same sample you can use the source property of the Texture node and connect it to ImageSource:
1 Like
Perfect thank you again Delta!

1 Like
If someone else stumbles here, and you have a similar situation to me… I suggest you keep your pallette texture separate, and then for details and other shader effects, try to combine them into one texture and use rgb channels for individual effects! I managed to take a big chunk of rendering time away with this trick. For my case, I have two main textures now that are loaded; the pallette texture and my “effect” texture, that are inserted to the shader. Previously I had 4 separate texture slots…
1 Like