General Category > Ongoing Anim8or Development
Multi-Threaded Rendering
AlecJames:
I don't know my threads from my cores :-[ :)
Steve:
AlecJames: A core is a complete set of hardware registers, etc. and can run any program. They execute in parallel and independent from each other. So a 4 core CPU can continuously execute 4 programs at the same time. If it is executing more, then all but 4 are paused at any given time, and the OS swaps them in and out as necessary to make it appear that they are all always running.
A thread is a stream of instructions being executed by the CPU, i.e. software. You can run many, many threads at once. Windows normally has dozens and dozens of them active. But at any one moment in time, there can only be as many executing as there are cores.
When Anim8or is rendering with the ART ray tracer, it uses as many threads as there are cores.
Steve:
Raxx: Are you using ambient occlusion? I haven't tried any examples with the new fast AA.
I changed the fast AA heuristics. It should make soft shadows better and faster, among other things. Here's how it works for N samples/pixel:
1. A small number of samples, sqrt(N), is made. If all of the following criteria are satisfied then those are averaged for the final value:
a) all samples are of the same material, including the closest sample in the 4 adjacent pixels,
b) the min Z and max Z differ by less that 5%, including the closest sample in the 4 adjacent pixels,
c) each light is either visible but all samples, or not visible, including the closest sample in the 4 adjacent pixels,
d) the average normal from this pixel and the 4 adjacent pixels are within 30 degrees,
The previous fast AA heuristic used color contrast between the samples and did not use materials or visibility of lights.
You can see what criteria are used with the environment variable int ShowFastAA.
1 - Green is fast AA, black is full evaluation,
2 - Red is large delta Z, gray is fast AA, black is other full evaluation,
3 - Yellow is different lights visible,
4 - Cyan is divergent normals,
5 - Magenta is multiple materials,
6 - Orange is reflective material (currently disabled),
7 - Blue is large color contrast (currently disabled),
8 - Violet is multiple materials, not counting adjacent pixels' nearest samples.
I attached renders of a room with 4 soft shadow local lights that show how this works.
AlecJames:
Steve: When I saw Raxx had said "Quad core, 8 threads", I wondered why because I always thought that I could have 1000s threads running on as many CPU cores that I saw in the task manager performance tab. Why 8 threads?
I found that CPU threads relates to hyper threading where a single CPU core uses 2 (hyper) threads to create 2 virtual cores. They context switch when one thread is idle waiting on some resource. I guess you don't get 2x performance but its better that 1x. (I found a really good description this morning but can't find it now :( )
Since there are virtual cores they appear in task manager as separate cores (so I though I had 8 cores but I've got 4 x 2 hyper-threaded cores). I must have seen the "hyperthreading" term loads of times over the years and just assumed it was some marketing term :)
Steve:
It is possible to achieve a 8x throughput improvement with a quad code, 8 threaded Intel CPU. Somewhat simplifying, each thread only is allocated every other cycle. So if 1 thread takes 1000 cycles of CPU use and finishes in 2000 cycles clock-time, then 2 threads can run on the same core and finish in 2001 cycles clock-time. So Raxx's CPU could run 8x faster that a single thread render.
There are other resources that limit the performance: memory bandwidth, cache size, etc., so in practice the actual result is less than the theoretical maximum. Changing the "chunk" size in Anim8or changes how memory and the cache are accessed so, depending on the details of the scene, the optimal size can vary greatly.
I'm also working on other ways to limit the memory requirements.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version