andreasala98 / NM4PIG

Numerical Methods for Photorealistic Image Generation
MIT License
2 stars 1 forks source link

Demo is slow #11

Closed andreasala98 closed 3 years ago

andreasala98 commented 3 years ago

I noticed Demo mode is quite slow when rendering images with the PathTracer... Why don't we try to implement Trace.ImageTracer.fireAllRays in parallel? This should boost our code speed while maintaining the correct result.

TommasoArmadillo commented 3 years ago

Great idea @andreasala98. In C# this is very simple to implement since the language naturally implements parallelization. In System.Threading.Tasks there is the method Parallel.For(int from, int to, Action<T>) that executes in parallel the code for different values of the index. We could parallelize the outer loop, i.e. the one for rows