- Home /
Custom Shader with Canvas Renderer limit draw calls.
Ok so I have the following issue:
I have a custom shader with a script that can make rounded corners on ui elements. These ui elements have an image and thus a canvas renderer. I want to be able to change the amount of pixels a cut off from a corner per object.
So this means I have 1 material but will need to create copies of it to be able to individually change them. This does work however now every single gameobject will use a seperate draw call instead of the one draw call you would have with a single material.
I found that you would be able to circumvent this with MaterialPropertyBlocks and GPU Instancing but this only works with normal renders and not the canvas renderer.
Is there any way to limit the draw calls using the same material while still being able to change each individual object using a canvas renderer?
Your answer
Follow this Question
Related Questions
Shader errors in Windows build ( renders black ) but not in Editor 2 Answers
How to render material under UI? 1 Answer
How can I have a transparent ring around a transparent planet? 0 Answers
Applying full screen image effects to UI only 2 Answers
How can I prevent the bloom camera effect from effecting UI text? 2 Answers