Path tracing in Honeybee in the future?

Hi Mostapha, I would like to ask if honeybee will implement path tracking for daylight simulations in the future, like ClimateStudio does. : )
The improved simulation speed is really impressive!

https://www.solemma.com/climatestudio/speed

1 Like

Hi @AufAlpen, as you can imagine this is something that we are being asked for frequently besides Accelerad. We are watching this project closely as a possible option:

raytraverse (1.1.2) — raytraverse 1.1.2 documentation

This is already happening in Honeybee[+]. The only thing is that the results do not get reported after each “pass”. Regarding this:

Nobody has used the Brute Force approach to do annual simulations, probably ever. The 2.2 hours it takes with Daysim is because Daysim uses ambient caching algorithms that try to ensure that the entire geometry is within a certain level of accuracy (this would probably take a couple of 1000 words to explain properly).
If you compare an -ab 7 -ad 4096 simulation between Honeybee[+] and Daysim, you’d notice that the difference in speed is considerable. So, while the above figure and plot are correct, they are also a clever piece of marketing.

Having said all of the above, I do agree with you that having the ability to report results on the fly after every pass would be a nice feature to have. @mostapha (wink wink!)

1 Like

PS: Here is a little basis for comparison:


The difference between the results with -ab 3 -ad 100000 (82.30s) and -ab 4 -ad 20000 (187s) isn’t much. So if the user had the ability to see this in real time probably they will stop the simulation at some point…

@mostapha I can imagine that. Path tracing makes it possible to perform some daylight simulations efficiently even with just a laptop, which was hard to imagine before. Will this raytraverse help to make a significant improvement? Expect to see the end effect. : )

@sarith Thanks for sharing your opinion and images! To be honest, I haven’t tested HB+ for image-based simulations, only for grid-based ones. Do you mean the image-based simulations in HB+ already use path tracing or a similar method?
I see that ClimateStudo can use only “1” for -ad with path tracking, which only tracks a single path per ray based on the probability function of the reflected direction of the ray. Reading the article “Probability function of reflected ray direction”, I can imagine that you guys have the possibility to implement this in Honeybee as well. : )

If one were to “flush” the output values after every single bounce of an individual ray, you’d pretty much be able to replicate this functionality (of seeing results progressively). Right now in HB[+], and by default in Radiance, the results are not written out after every bounce. So, we only get to see the results of a (for example) -ab 5 simulation at the end of -ab 5 and not after bounce 1, 2 ,3 and 4. To do this, one would have to intercept the output after each bounce while maintaining the same value in the cache memory also. This applies for image and illuminance based simulations. I shared the image example because it was readily available.

Solemma has some really smart people working for them, so they have obviously figured out a way to do this (or something similar) while also enabling multi-threading on Windows systems (which again, by default is not possible with Radiance). I assume getting something like this up and running in Honeybee will be a fair amount of work. So, as I said before, it will be a “nice feature to have”.

Thank you for getting this discussion started by the way! I can recall at least a few features in the Ladybug ecosystem having their genesis in such discussions.

@sarith I understand it differently, but you are an expert, I could be wrong. My understanding and guess is that the results are not output after each bounce, but after each pass, and the emitted rays of each pass actually end the 5 bounces (e.g. -ad 5). If a sensor point emits 64 rays per pass, on the 100th pass it is somehow equivalent to -ad 6400. The big difference is that when a ray hits a surface, it does not produce another 6400 rays, but only tracks one path with the probability function. Each pass actually figurs out the daylight coefficient (if we are talking about an annual simulation) and then calculates hourly illuminances and DA, which can be done quickly with C++, that’s why climateStudio can display results in real time. Each pass makes a quick and rough prediction, but the results are always updated weighted in the next pass. After a certain number of passes, the results are converged, which means they are pretty close to the correct values. As I said, this is just my understanding and my guess. Please correct it if I say something wrong. I don’t want to mislead others…

Actually what you stated makes perfect sense. Much of what you mentioned (weighting, calculation of coefficients etc) actually is/can-be done by rcontrib directly.

Regarding this specifically:

I know how to assign the probability function, but wasn’t aware that one could track a single path.

Secondly, the thing that I don’t understand is that how it is possible to get away with low levels of ambient divisions for pure Monte Carlo simulations. John Mardaljevic had a funny and insightful slide in his Ambient Calculations tutorial (see slide #2). The difference between that approach (with ambient caching) and the current approach is that there is no more “hunting” going on anymore. One needs to specify a high value for initial sampling (through -ad ) so that the entire geometry is accounted for.

Anyway, these are some interesting points to ponder and learn about :grinning: ! I am only seven-ish years into my Radiance journey, while there are people who have been working with it since the mid 80s and 90s.

@sarith I appreciate your explanation! As a regular user of the Ladybug tools, I am happy about any improvement of the tools by your team! : )