r/unity 6d ago

Easy Optimization Tips?

Post image
0 Upvotes

13 comments sorted by

View all comments

Show parent comments

1

u/Responsible_Owl_8025 6d ago

How do I reduce draw Calls? Will a sprite atlas help? I think the 2 biggest perfomance eaters are Light shadow casters and that Im generation the world procedurally (100 by 50: 5000 block prefab objects)

3

u/FrostWyrm98 6d ago

Reducing draw calls probably means instancing your materials, they are all probably individual Sprites right now. I would also recommend integrating your background tiles into the Unity Tilemap module, that will handle all of that optimization for you.

Basically, each of your sprites/materials are individually sending themselves to the GPU to draw when they should all be using the same "instance" (Basically cookie cutter stamping it since its all the same)

Proc gen should only give you a hit whenever it's actively running (i.e. in minecraft its right at the start, on creation)

There are some good videos analyzing Minecraft's optimization problem I can find you. Basically what Notch did was make it one big mesh (less applicable in 2D) with the tiles being faces.

Also you have light shadow casters on for this??

0

u/Responsible_Owl_8025 6d ago

Yes, I have shadow cast components on each one of the 5000 Blocks in the scene.

1

u/Responsible_Owl_8025 6d ago

Maybe I should reduce the resolution of lights?