For those that are curious: it is actually possible to have both GPU Instancing and unique material properties - with the exception of textures. But floats, colors and vectors can actually be unique to each renderer without using multiple materials. In Shader Graph you will need to declare material properties as 'hybrid per instance'. In hand-written shaders, apply the 'PerRendererData' attribute to the material property. Next, use a MaterialPropertyBlock to apply a per-renderer 'override' of material properties. You only need to do this every time a variable changes and thus you want the look to update. If you are using Entities, see the MaterialProperty attribute, which lets you change properties on instanced entities with multi-threading via Jobs.
1 month ago | 2
Gah, I remember this one driving me nuts the first time I was working with materials
1 month ago | 3
To clarify: this isn't related just to GPU instancing; whenever you change the properties of a Renderer.material, it creates a new instance of that material.
1 month ago | 4
bro c'mon man i been failing like 3 in a row. I wanna see the full bible of these questions.
2 weeks ago | 0
Modifying sharedMaterial will change the appearance of all objects using this material, and change material settings that are stored in the project too. I think better to use MaterialPropertyBlock
1 month ago | 1
for getting and setting material properties ? or just setting ?
1 month ago | 0
git-amend
Unity Certification Quiz:
When it comes to GPU instancing, what is the risk of accessing `Renderer.material` from script in Unity?
1 month ago | [YT] | 77