The FullScreenQuad class was generating garbage on every frame, it's now fixed.
More importantly, this PR optimizes material usage. Every time you do a material.SetXXX(string, value); it will internally compute a hash for the name and do a lookup. Considering the amount of uniforms sent on every frame in this asset... It can quickly become expensive on slower CPUs. So no need to do it on every frame, it should only be done once and reused :)
Every little bit helps... Uniforms should be tightly packed together (e.g. put 4 float in a float4) to optimize this even more but for now that'll do.
The
FullScreenQuad
class was generating garbage on every frame, it's now fixed.More importantly, this PR optimizes material usage. Every time you do a
material.SetXXX(string, value);
it will internally compute a hash for the name and do a lookup. Considering the amount of uniforms sent on every frame in this asset... It can quickly become expensive on slower CPUs. So no need to do it on every frame, it should only be done once and reused :)Every little bit helps... Uniforms should be tightly packed together (e.g. put 4
float
in afloat4
) to optimize this even more but for now that'll do.