기술 자료

Unity Engine


User Manual

Script Reference

Unity Engine


Access properties in combined meshes

Use MaterialPropertyBlocks to change properties of combined meshes without breaking batching.
읽는 시간 1분최근 업데이트: 22일 전

중요
The Built-In Render Pipeline is deprecated and will be made obsolete in a future release.
It remains supported, including bug fixes and maintenance, through the full Unity 6.7 LTS lifecycle.
In the Built-in Render Pipeline, you can use a MaterialPropertyBlock to change material properties without breaking draw call batching. The CPU still needs to make some render-state changes, but using a
MaterialPropertyBlock
is faster than using multiple materials.
If your project uses a Scriptable Render Pipeline, don't use a
MaterialPropertyBlock
because they remove SRP Batcher compatibility for the material. Use different materials for the different properties instead.
경고
When you access shared material properties from a C# script, make sure to use Renderer.sharedMaterial and not Renderer.material.
Renderer.material
creates a copy of the material and assigns the copy back to the Renderer. This stops Unity from batching the draw calls for that Renderer.

Additional resources