McManning / Coherence

Blender viewport renderer using the Unity Engine
MIT License
30 stars 0 forks source link

Add smarter change detection for bpy.type.Image syncing #22

Open McManning opened 3 years ago

McManning commented 3 years ago

Enhancement to #6 - right now syncing a bpy.type.Image to Unity happens under the following conditions:

  1. Whenever a SpaceImageEditor redraws (via draw_handler_add) and the draw tool is active
  2. Whenever the SpaceView3D redraws and the PAINT_TEXTURE tool is active

Unfortunately, 2 happens way too often - space is setup to redraw at 30-60 FPS to keep up with Unity viewport renders, the frequency for updating the texture has its own throttle but it's constantly running (thus doing a bunch of memcpys) and isn't running reactive to changes at all - unlike the SpaceImageEditor.

It's fine for smaller textures (1024x1024) but once you scale up you start to feel it chug.