I’ve implemented real-time texture (splat map) painting in C++. However I’ve got a couple of issues.
The texture is 2048x2048 and performance on Android (Galaxy S5) was awful, but just fine on an iPad Mini 2. I fixed the issue on Android by specifying the region of the texture to update based on the area and brush size I painted with.
PaintRegion.SrcX = cellX - halfBrushSize;
PaintRegion.SrcY = cellY - halfBrushSize;
PaintRegion.DestX = cellX - halfBrushSize;
PaintRegion.DestY = cellY - halfBrushSize;
PaintRegion.Width = brushSize;
PaintRegion.Height = brushSize;
instead of what I found in a tutorial, which updates the entire texture at once…
FUpdateTextureRegion2D(0, 0, 0, 0, w, h);
Worked brilliantly on Android, 60fps while painting instead of dropping to 10fps. Then I tested it on iOS which handled it “ok” with the original implementation. But it’s all corrupted…
Here’s what it looks like on Android with setting the region based on brush size etc…
And this is what happens on iOS…
Is this a bug or does iOS not support specifying a specific region to update? I’ve disabled Metal on iOS so their bot running in ES2. (My problems with Metal are a whole other post!).
Thanks