<div dir="ltr"><div>Hi Stefan!</div><div><br></div><div>Thanks for the comments, I really appreciate the feedback and suggestions.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>This we can eventually take a look at in a profiler. Maybe with some 
changes to the memory layout (morton order in tiles?) we can get a 
better cache utilisation from the tiled cache.</div></blockquote><div><br></div><div>I just tried out morton ordering tiles in the sparse grid, and the time savings are great! With the same sample image as the weekly report, render time dropped to 9:17, which is 0.94x the original speed. Morton ordering also requires less calculation to get the sparse voxel index, which definitely speeds up the render.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>This is something that eventually will need benchmarking. The old 
assumptions of memory vs speed tradeoffs and using lookup tables to save
 a few calculations don’t necessarily hold true any more with modern 
memory architectures, especially on GPUs. A memory lookup through a 
cache miss can take hundreds of cycles, while the processor can execute 
several additions or multiplications in a single cycle.<br></div></blockquote><div><br></div><div>This didn't occur to me, I guess I got stuck on the old thinking of multiplication/division being too expensive. I will try out both ways and compare the results once I have access to some graphics cards.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>You can also take a look at the work that Luca Rood has done for Tangent Animation in their branch:</div></div></blockquote><div><br></div><div>I haven't had the time until now but I'll definitely read up on this. Thanks for pointing me in the right direction :)</div><div><br></div><div>Best regards,</div><div>Geraldine<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 14, 2018 at 3:59 PM, Stefan Werner <span dir="ltr"><<a href="mailto:stewreo@gmail.com" target="_blank">stewreo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Hi Geraldine!<div><br></div><div>My comments are inlined.</div><div><div><span class=""><br><blockquote type="cite"><div>On 10. Jun 2018, at 18:04, Geraldine Chua <<a href="mailto:chua.gsk@gmail.com" target="_blank">chua.gsk@gmail.com</a>> wrote:</div><div><div dir="ltr"></div></div></blockquote><br><blockquote type="cite"><div><div dir="ltr"><div>Memory usage of 'color' (__tex_image_float4_000) reduced from 3.06M to 2.50M (18.3% reduction)</div><div>Memory usage of 'density' (__tex_image_float_003) reduced from 783.75K to 644.00K (17.8% reduction)<br>Memory usage of 'flame' (__tex_image_float_011) reduced from 783.75K to 292.00K (62.7% reduction)<br>Memory usage of 'temperature' (__tex_image_float_019) reduced from 783.75K to 290.00K (63.0% reduction)<br>Memory usage of 'velocity' (__tex_image_float4_008) increased from 3.06M to 3.06M, not using sparse grid. (0% reduction)<br></div></div></div></blockquote><div><br></div></span><div>That’s looking good! The amount of memory saved will heavily depend on how values are distributed in a volume, I think in many use cases we will see significant savings.</div><span class=""><div><br></div><blockquote type="cite"><div><div dir="ltr"><div>Render time increased from 8:46 to 10:07 (0.86x speed)<br></div></div></div></blockquote><div><br></div></span><div>This we can eventually take a look at in a profiler. Maybe with some changes to the memory layout (morton order in tiles?) we can get a better cache utilisation from the tiled cache.</div><span class=""><div><br></div><blockquote type="cite"><div><div dir="ltr"><div>While we could convert the offsets into cartesian coordinates, a more efficient method would be to simply store the coordinates of the first voxel in every tile. While this triples the size of <i>grid_info</i>, the lookup savings from not having to compute coordinates from the index should be worth it.<br></div></div></div></blockquote><div><br></div></span><div>This is something that eventually will need benchmarking. The old assumptions of memory vs speed tradeoffs and using lookup tables to save a few calculations don’t necessarily hold true any more with modern memory architectures, especially on GPUs. A memory lookup through a cache miss can take hundreds of cycles, while the processor can execute several additions or multiplications in a single cycle.</div><span class=""><div><br></div><blockquote type="cite"><div><div dir="ltr"><div>I think that beginning next week I can start working on creating the OpenVDB import function. An easy start would be adding a UI option for it, butI will have to read up some more on the background of the problem before I can say for certain what will need to be done for this feature.<br></div></div></div></blockquote><div><br></div></span><div>You can also take a look at the work that Luca Rood has done for Tangent Animation in their branch:</div><div><a href="https://github.com/tangent-animation/blender278/tree/openvdb_import" target="_blank">https://github.com/tangent-<wbr>animation/blender278/tree/<wbr>openvdb_import</a></div><div><br></div><div>Note that this code is still based on Blender 2.78, so it may take a little work to get it to run in master. There, OpenVDB import is done as a modifier.</div></div></div><div><br></div><div>Thanks for your work on this project so far! It’s great to see tiled memory for volumes being implemented, previously there was lots of memory wasted on empty bytes!</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Stefan</div></font></span></div><br>-- <br>
Soc-2018-dev mailing list<br>
<a href="mailto:Soc-2018-dev@blender.org">Soc-2018-dev@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/soc-2018-dev" rel="noreferrer" target="_blank">https://lists.blender.org/<wbr>mailman/listinfo/soc-2018-dev</a><br>
<br></blockquote></div><br></div>