Download

Async Dynamic Texture Update

Hello guys. Im working on fog of war (made by tutorial), but updating texture ‘eats’ too much fps, so i wanted to make updating async, but when i use Graph Task System - i get crash with updating textures - Assertion Failed - IsInGameThread().
Any ideas?

When I tried to read texture data once per Tick it was way too slow, because of the locking and probably streaming required in the background.

I ended up caching the entire texture data in my class as array. Maybe you can do the same - read the texture once and update the data in your own array.
When required (e.g. when enough data has changed) you can write the whole texture at once in the game thread.