Fastest rendering of 2D world with lots of changes to screen every frame?

If you have a texture, let’s say 1024 * 1024, and your constantly changing pixels (getpixel setpixel apply) because on almost every update there are changes to draw - what’s the most optimal technique to render that efficiently?

I looked into something involving render texture, and in not sure how that applies in this situation because that seems more for rendering a cameras view? What I’ve been trying is just having a quad with a camera, both setup to be full screen, but find the performance too sluggish for mobile use, which I have little optimization elsewhere, but bottleneck seems to be in apply() of textures rapidly… Who has suggestions? Must be better ways to handle this stuff? Any experts on 2D pixel level changes rapidly updating in unity? :slight_smile:

A proper answer for this problem is to use smaller textures tiled to represent the overall texture, and only update (Apply() after setpixels) any tiles which have been changed. I ended up writing my own editor script which does this slicing and re-assigning automatically for me - saving me tons of effort and time, then I had to write methods that consider the “cells” of each section of the overall image and grabs pixels from there, and sets pixels from there. Good luck anybody trying to take this on!

PS Do not even think about trying to using little 1x1 quads as your representation of your world - works horribly.

It sounds like you want tilemaps like terraria or something… i believe 2Dtoolkit has a tilemap part to their plugin and it’s pretty fleshed out and optimized. Maybe that’s what you’re looking for.

This question became a discussion, consider using Unity Forums which is a great place to discuss ideas. Adding this answer to remove it from the Unanswered view and give more relevance to other questions requiring attention. Thanks for your comprehension, Unity Support.