- Home /
How to optimise lighting in an endless runner?
Hi, Apologies for the vague question. How would you go about optimising lighting in an endless runner for mobile? For games with levels, I've previously baked the static objects and used probes for the player that moves. How would you go about an open endless runner with randomly placed obstacles at runtime? But the majority of these obstacles won't move on the tile they are placed on (Except for collectibles which will spin/rotate) Thanks
If the objects are static, then when spawning the object, you can set it to static through GameObject.isStatic = true;
.
If the objects are dynamic - as long as they share the same materials - you can enable GPU instancing on the material (at the bottom of the inspector of the material), which will essentially batch objects together that share the same material and therefore will reduce draw calls.
I don't know if my answer is specific to lighting or rendering in general but I've found these solutions boost my frame rate by a significant amount. Also, try disabling/destroying objects that you've already passed or aren't in view (if you haven't already). This would reduce the need to perform lighting calculations on unnecessary objects. @HBishop
Hi, Thanks for the reply. I hadn't thought of some of these so thank you. I'll give them a try.