PDA

View Full Version : BSP - a question about rendering performance.


torebjerkan
12-26-2006, 05:43 PM
I assume this is the kind of topic that can get very involved. If I wanted to I could probably plow through volumes about setting up efficient BSP algorithms. But that wouldn't be very efficient when all I want to achieve is to make pretty pictues in the least amount of time.

I have a basic understanding of how these trees work. I want to know the philosophy behind how BSP settings either improve or worsen rendering performance. I assume it is because I can tell Mental Ray for Maya exactly when to stop dividing (the space) any further that decreases rendering times? Will Maya obey my BSP settings no matter what the scene contains? What if MR really needs to divide the space further? Is MR intelligent enough to override my settings(automatically)? Hmm..no I think not..and that's probably the whole point. I guess that's why BSP diagnostics are provided as a guide instead. Obviously increasing either leaf depth or leaf size is going to increase memory usage and speed up rendering time. May be the lesson here is that terrible settings can waste a lot of memory. In short, how does good BSP settings speed up render times? There should be a simple answer to this, I hope.

techmage
12-26-2006, 09:53 PM
Mental ray shoots a ray out, it traces this ray (ie raytracing). When tracing a ray the renderer must test collision of that ray with surfaces. This basically involves having a massive list of triangles and constantly comparing the ray's position to every single triangle in that list over and over again. You can imagine how slow that would be to test collision on every triangle in a scene if the scene has millions of triangles. So BSP exists to help mental ray choose which triangles to use in collision testing with a ray. BSP divides the scene based on geometric complexity and it subdivides the scene and creates a tree of iterations, how deep the tree goes is set by BSP depth. So then when mental ray shoots out a ray it doesn't need to collision test every triangle, it only needs to collision test the triangles that are in the BSP division the ray is in.

joit
12-27-2006, 03:10 PM
although mental ray decides which part of the picture can be rendered with scanline and which part really needs raytracing, it is a good idea to turn off raytracing if you don't need it. if there are no reflections, refractions or final gathering points in the foreground or any lens shaders in the camera you can just turn off raytracing off and save a whole lot of time.

mestela
12-27-2006, 04:34 PM
there's a great summary for tweaking mr bsp settings from softimage.

http://www.softimage.com/products/pro_ren/pdfs/XSI_rendering_lajoie.pdf

read pages 24-26, tells you all you need.

on a more visual bent, this tutorial explains how to use the diagnostics mode to see if you're rendering efficiently. you get a red-to-blue 'thermocam' render displaying bsp settings. grossly simplifying, red is using too much memory, blue is using too much cpu, you want a range of mid-tones.

http://www.lamrug.org/resources/chardiags.html

my retarded non-programmer take on bsp settings is this: you can tell mr the maximum number of times to subdivide each chunk, and how big a chunk can be before mr tries to render it. if a chunk is too large to fit in memory you'll start paging and probably crash. If the chunks are too small, mr spends all its time subdividing unecessarily, and you're wasting time and cpu. You're aiming for a comfortable amount of triangles that mr can keep in memory at once, without spending ages dicing the scene.

google for 'mental diagnostic bsp', lots of info out there.

LehaS
12-27-2006, 09:14 PM
although mental ray decides which part of the picture can be rendered with scanline and which part really needs raytracing, it is a good idea to turn off raytracing if you don't need it. if there are no reflections, refractions or final gathering points in the foreground or any lens shaders in the camera you can just turn off raytracing off and save a whole lot of time.

No need for that ...as far as i know Mental Ray by default sends its 1st ray using Scanline algorithm and switching to Raytrace ONLY when it meets Reflections or Transparency..

joit
12-28-2006, 09:27 AM
sorry for my short answer above...
first, all objects are projected onto the camera arperture and rendered with scanline. then, if there are parts, that need raytracing, they are rendered with raytracing. what I think makes sense is to turn off raytracing by hand if objects that need raytracing are in the background or otherwise hardly visible cause the extra cost of raytracing won't be visible.

CGTalk Moderation
12-28-2006, 09:27 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.