Hi all
I would like to know more about difference between materialPropertyblock and GPU instancing about reducing pass calls and batches
I would also like to know the answer to this question…
Which has the potential to be more optimized?
I know when it comes to dynamic batching vs GPU instancing, Instancing wins out, but what about MaterialPropertyBlocks vs GPU Instancing?
If it’s only a few instances, instancing has overhead that makes it not worth using.
Also unsure why you’re comparing instancing with PropertyBlocks, they’re not really equivalent.
not according to this thread https://discussions.unity.com/t/762383
Also just so I know we are on the same page here we are not talking about regular instancing, we are talking about GPU-instancing.
So basically literally writing HLSL code with fun shader modifications such as, #pragma multi_compile_instancing
and
UNITY_DEFINE_INSTANCED_PROP(float4, _Color)
etc ![]()
I am just saying that dynamic batching being slower than GPU instancing under all circumstances and platforms is simply not true.
GPU Instancing comes with overhead which depending on the platform and amount of instances, might be significant enough that it makes dynamic batching faster overall.
Optimizations are often content specific. Switching between the different batching systems in Unity is simple, thus I recommend to profile which of these methods performs best with your game. Much better to test first-hand than relying on opinions.
though our questions are not really related to dynamic batching, I dont mind derailing the discussion a bit.
I dont agree with your statement that i was claiming that GPU instancing is faster in all circumstances because i never said that. what my question is for and the problem im trying to solve here, i can say with 100% certainty that GPU instancing IS the more optimized rout to take. I am not concerned with solutions that Static Batching solves right now because it simply is not applicable to my problem.
You can get an idea for what my problem is here without going into to much detail:
Static batching is designed for larger unique meshes that will share the same material. … Instancing is great for a lot of the same mesh, and particularly awesome for being dynamic. As for dynamic batching, this also works with instancing, and the jury is out if it’s good to use with or not.
But basically I want to use GPU instancing in this case. But I can also use MPB for the same effect. What I want to know is is there a difference whether I use one or the other?
Thanks for the reply ![]()
Absolutely, but we would like to know what GPU instancing and MPB are doing behind the scenes first so we can make a better judgement on how to apply either option to our situations.
the Unity documentation tells us how to use either case and what they achieve, but it doesn’t seem to go into depth on the differences or how they run.
It doesn’t. Unity disables dynamic batching if instancing’s enabled on a shader.
Which is what? Reducing batches and setpass calls? Why did you bring up MaterialPropertyBlocks then?
I didn’t, I brought up Graphic Instancing. I want to find good resources on custom programming graphic instancing in HLSL code.