Future of instancing and multithreading question

What is intention for CPU/GPU instancing in Blender 3+?
Unity is developing DOTS ( multithreaded Data-Oriented Technology Stack) which has nice performance results.
Can something like that be written for Python in Blender?

Right now, they are working on Vulkan support which likely won’t have a huge performance impact through. Other than that, I am not aware of plans to improve the performance in that area.

No, I don’t think so. DOTS is a pretty huge project and just one part of it is (almost) a custom compiler. That’s far beyond the reach of a project like Blender.
What comes closest might be the Everything Nodes project, if it gets heavily optimized, though that’s quite a stretch.
Keep in mind that the requirements for a game engine and Blender are still quite different. Getting high performance scripting in Blender would be nice to have, but it is for sure not as critical as in a game engine.

It’s also for particles and many instance objects.
I think instancing could improve in Blender. DOTS in Unity allow to run heavy instanced city on mobile CPU. https://www.youtube.com/watch?v=KgcU2HBOXAw
For Blender this could improve viewport with many particles. Maybe in future after Blender 3, Python DOTS system will get to live.

Blender is already using instancing as far as I know and the Everything Nodes project should give more fine grained control (hopefully without too much of a performance penalty).

I have been using DOTS. Instancing is just a tiny portion of it. The core is the data oriented design along with a new way to implement parallel code execution, which requires a customized compiler. Again, this is way beyond what can be achieved by the Blender developers!

Hmmm… Blender devs are perfectly capable of doing customized compillers, after all, Cycles nodes themselves are based on compiller tech. (Both CPU and OpenCL variants).

The problem is time, and developer availability: They have their plates full for quite some time, and considering DOTS was developed over around 3 years, the possibilities of doing this for 3.x (and probably even 4.x) are pretty much zero at this point.

Of course, if the devs of Unreal or Unity were to donate the code and several Hours/Man to incorporate this into Blender, it could benefit everyone, but i think is more probably that hell freezes rather that this happens, given that game studios tend to be greedy, and in some cases, downright evil, and probably Unreal’s owner doesn’t like the idea of giving tech for free… or almost free.

There’s also the possibility that some independent developer want to contribute with something like this. Sculpt module was orphaned until Pablo Dobarro appeared and upgraded it, so at least, there’s some hope. Not much, given the graphics and data pipeline in Blender is being overhauled right now, but then again, who knows?

1 Like

Nevertheless, such exotica is far more important to a real-time game engine than it is to a system like Blender.

The burst compiler is meant to speed up C# code execution. Considering how Blender’s internals is are written in C/C++, said optimizations wouldn’t be applicable. The data oriented design however, could offer decent speed ups if implemented.

1 Like

Unity’s internals are also C/C++. Though with the Burst compiler and DOTS, they bring more components to C#.

So burst compiler and data-oriented design should be remade within Python in order to rework Blender API?

As of now, I don’t think that would be a good investment for Blender. They are simply not in a position to develop high end compiler technologies for multiple platforms. So, the (Burst) compiler portion would need to exist first. I believe this is going to appear earlier or later. However, I doubt it is going to be a good match for Python.
From my point of view, the correct approach is to wait until compilers exist which are capable of that. And once that is the case, a rework of the whole API (or initially another API) might be considered. But even the compiler part is years away.

Edit: To make it very clear: I think DOTS is amazing. It is incredible that this sort of performance can be achieved with (a subset of) C#. Unfortunately, for a project like Blender, it is out of reach at this point. However, if this kind of technique gets adapted/established, it would be an incredible opportunity for Blender.

Using numba and numpy have been discussed on this forum previously. Numba can be very fast (It beat C and only slightly slower than Rust and Cython on a (probably unrepresentative) image processing test I did https://github.com/paddywwoof/atkinson) Numba also has support for GPU computing. But I think the entity/component structure is very game engine specific and Blender has decided that it’s definitely not going to be a game engine.

1 Like