Isosurface object speedup patch - examples and comparison
Here you can find some examples and render times comparing the new improved root solver with the old one as well as the different techniques available with this patch.
I made three test scenes for testing the improvements under different circumstances:
- scene 1 uses a simple sphere function displaced by a pattern function. This is a quite typical use of the isosurface shape with moderate gradients and a fairly fast function.
- scene 2 uses the IsoCSG library to create an isosurface version of the POV-Ray logo. The function is much slower than in scene 1 but still has a fairly low gradient.
- scene 3 is the most problematic scene, it contains a isosurface landscape with high and strongly varying gradients.
Here are these scenes and their characteristics when rendered with conventional techniques:
scene 1 | scene 2 | scene 3 |
---|---|---|
Parse Time: 0 seconds Render Time:46 seconds Function VM calls: 15193402 maximum gradient: 5.449 max_gradient: 5.5 memory use: 268835 |
Parse Time: 0 seconds Render Time: 103 seconds Function VM calls: 4373970 maximum gradient: 2.940 max_gradient: 3 memory use: 318535 |
Parse Time: 0 seconds Render Time: 314 seconds Function VM calls: 24724961 maximum gradient: 29.3 max_gradient: 30 memory use: 219290 |
Render times and statistics
Here is a collection of test scene statistics with various parameters. The following values are listed in the table:
- method: bounding tree building method
- grid: grid size limit for bounding tree, two values mean distance function based grid size.
- node count: number of nodes actually generated
- parse time: time for building the tree (seconds)
- render time: time for render (seconds)
- VM calls: calls to function VM as reported by POV-Ray
- memory use: peak memory use of the render (bytes)
- notes: additional parameters
scene | method | grid | node count | parse time | render time | VM calls | memory use | notes |
---|---|---|---|---|---|---|---|---|
1 | - | - | - | 0 | 46 | 15193402 | 268835 | - |
1 | 1 | 0.5 | 12755 | 1 | 43 | 12798314 | 1344377 | - |
1 | 1 | 0.25 | 47563 | 4 | 36 | 11222915 | 4326025 | - |
1 | 1 | 0.125 | 183248 | 17 | 31 | 13176001 | 15993037 | - |
1 | 2 | 0.5 | 3623 | 1 | 24 | 7334342 | 573789 | - |
1 | 2 | 0.25 | 15106 | 4 | 22 | 7486221 | 1536865 | - |
1 | 2 | 0.125 | 61404 | 14 | 20 | 10194003 | 5408217 | - |
1 | 3 | 0.5 | 3305 | 0 | 22 | 6734601 | 550237 | - |
1 | 3 | 0.25 | 13830 | 1 | 21 | 6268434 | 1439973 | - |
1 | 3 | 0.125 | 56419 | 5 | 19 | 6633537 | 5042401 | - |
2 | - | - | - | 0 | 103 | 4373970 | 318535 | - |
2 | 1 | 0.3 | 5879 | 5 | 80 | 3653993 | 825126 | - |
2 | 1 | 0.15 | 21969 | 14 | 64 | 3398851 | 2237558 | - |
2 | 1 | 0.075 | 85654 | 50 | 52 | 4556268 | 7836638 | - |
2 | 1 | 0.3 | 5879 | 5 | 67 | 3092629 | 824279 | max_gradient adaptive 1.5 |
2 | 1 | 0.15 | 21969 | 14 | 56 | 3089209 | 2236711 | max_gradient adaptive 1.5 |
2 | 1 | 0.075 | 85654 | 50 | 48 | 4358232 | 7835791 | max_gradient adaptive 1.5 |
2 | 2 | 0.3 | 1839 | 5 | 45 | 2180026 | 472259 | - |
2 | 2 | 0.15 | 8198 | 14 | 41 | 2405605 | 1001839 | - |
3 | - | - | - | 0 | 314 | 24724961 | 219290 | - |
3 | 1 | 0.3 | 21503 | 60 | 263 | 26311529 | 2044994 | - |
3 | 1 | 0.15 | 182783 | 478 | 310 | 69464840 | 15967298 | - |
3 | 2 | 0.3 | 6395 | 60 | 137 | 16366239 | 766518 | - |
3 | 2 | 0.15 | 29381 | 478 | 96 | 53040271 | 2695243 | - |
3 | 2 | 0.3 | 6395 | 59 | 65 | 10686130 | 766632 | max_gradient adaptive 2.5 |
3 | 2 | 0.15 | 29381 | 478 | 55 | 49787783 | 2695356 | max_gradient adaptive 2.5 |
3 | 3 | 0.3 | 6118 | 3 | 117 | 9330644 | 747036 | - |
3 | 3 | 0.15 | 27381 | 12 | 87 | 7689365 | 2552256 | - |
3 | 3 | 0.075 | 124388 | 52 | 65 | 8972801 | 10637276 | - |
3 | 3 | 0.3 | 6118 | 2 | 58 | 4641019 | 747152 | max_gradient adaptive 2.5 |
3 | 3 | 0.15 | 27381 | 11 | 53 | 4925509 | 2552372 | max_gradient adaptive 2.5 |
3 | 3 | 0.075 | 124388 | 51 | 46 | 7371277 | 10637276 | max_gradient adaptive 2.5 |
3 | 3 | 0.03 / 0.1 | 5273 | 2 | 93 | 7325551 | 658025 | distance function based grid |
3 | 3 | 0.015 / 0.05 | 24552 | 9 | 75 | 6466212 | 2220561 | distance function based grid |
1 | - | - | - | 0 | 46 | 15193402 | 268835 | - |
Result differences
The bad side of the whole thing: the results are usually not identical. The scenes' appearance with the original unmodified root solver can be found above.
With method 1
there are only minor differences
compared to the original results, with the other methods results can quite strongly
differ. With method 2
these differences are less
significant with fine grids while method 3
can show
artefacts at any grid size.
method 1 | method 2 | method 3 |
---|---|---|
For scene 2 method 3
does not work at all
because of the shape of the isosurface. Method 2 leads to problems at larger grid size limits:
method 1 | method 2, grid 0.15 | method 2, grid 0.3 |
---|---|---|
In scene 3 there are differences are very hard to avoid because of the detailed structure of the surface. method 1
also works very well but hardly makes a difference in render time and results in very slow parsing.
method 1, grid 0.15 | method 2, grid 0.15 | method 3, grid 0.15 |
---|---|---|