View Full Version : render diagnostic mode

01 January 2002, 07:51 PM
I have been doind a lot of rendering in XSI recently... And one thing is bothering me. When trying to optimise scenes for rendering, you have to set the depth and size of youre BSP tree... Using the diagnostic mode, you get a colored representation of youre scene. Whar I would like to know is the meaning of those colors. Please help me!!! hehehe

(the books and internet documentation only tell me that I will see a colored representation of the size and depth... That I can see... But they do not tell me what those colors mean...)

01 January 2002, 01:48 AM
Haven't tried these display modes myself, but in RENDERING WITH MENTAL RAY and PROGRAMMING MENTAL RAY it says,

diagnostic grid off|object|world|camera S
Draws a colored grid on all objects in the scene visualizing the specified coordinate space. The interval between lines is S units. This is useful for estimating size and distance between objects, and to visualize objects' local object space.

diagnostic photon off|density|irradiance N
When using photon maps, this mode replaces all material shaders in a scene with an internal shader that produces a false-color rendeing of photon density, or the average of the red, green, and blue irradiance components. N is the density (or irradiance) assigned to 100% red. High values fade to white. This mode is useful for tuning he number of photons in a photon map and setting the various
accuracy options.

diagnostic samples on|off
This mode replaces the rendered image with a grayscale image showing the number of samples taken for each pixel. A black pixel has no samples, while a white pixel has had the maximum number of samples contribute. This mode is useful for adjusting samples and contrast antialiasing options.

01 January 2002, 07:58 PM
Thanks man... Not a lot of help... But I'm sure i'll find it somewhere... If youre interrested I'll tell you when I find out exactly how it works... Till then, let's do some damage.


01 January 2002, 10:43 AM
Quite useful for tweaking the scene, specially the view sampling and the bsptree depth and leaf tests!!!

Is great they add this tools!!!


01 January 2002, 03:35 PM
Yes... I can see and understand it is a useful function... But they don't tell me how to interpret the data that is shown to me... do you know?

01 January 2002, 03:05 AM
What don't you get there? The photon map views are a bit more complicated - insofar as the features they diagnose are more complicated - but the sampling and space diagnostics are pretty straightforward I think.

Hope you don't think I'm being patronizing, but the idea - if I may try and explain further - is to help you balance performance and quality. Antialiasing is the primary method of controlling quality but, used naively, it can have a very negative impact on performance. Naive antialiasing increases image quality by "oversampling" (firing more than one ray per pixel) the scene. But number of samples is a very good predictor of performance as well (more samples = longer renders).

Adaptive antialiasing, controlled by the samples (Min Level and Max Level) and Contrast controls, is the method by which you optimize your antialiasing in order to reach an acceptable image quality and performance. The idea is to take samples only where they make a significant contribution to the final image; typically you would want fewer samples in areas containing little detail, and more samples where the image contains greater detail.

A good way of starting is to:
1. Begin with Contrast set at 0 for each RGBA (thus disabling adaptive features and insuring that 2^(2*MaxLevel) samples are taken per pixel).
2. Then choose the lowest value of Max Level which gives you acceptable image quality.
3. Set Min Level samples to Max Level - 2 (for example, if you had Max Level set at 1, you might choose -1 for Min Level).
4. Increase Contrast in small increments (say by steps of .1 for each RGBA simultaneously). Watch the results. WHen you start seeing noticeable degrading of the image, stop and go back one increment. Having to set the contrast too low (below 0.1 for example) usually indicates that you should raise MinLevel or MaxLevel, and then readjust Contrast.

The diagnostics for samples help by indicating where the most samples are being taken - lots of white pixels means that many of the pixels are reaching the maximum level of sampling (this suggests an inefficient antialiasing scheme). Lots of black or dark pixels suggest that many pixels are being sampled very little.

Can't help you with the photon stuff but I do think the descriptions of these features are pretty clear.

Hope this helps.


01 January 2002, 11:19 AM
If you would kindly refer to my first question... I was asking how to interpret the information given to me when I use the diagnostic mode to adjust BSP TREE values... And not antialiasing... I have been working with mental ray for a while now and know how the antialiasing works... My problem is that in Softimage, you could use the diagnostic mode to gen the values of depth and size of youre BSP TREE and then, by avreaging the lowest and the highest, you would get values that would benefit you greatly at rendering... you had to repeat the thing twice or thrice and you would end up with an amelioration of at least 50% time in youre render...

So... When you are using the diagnostic mode with the BSP TREE settings, you see a scheme of colors that represent something... I can read the manual and retype you exactly what you just wrote me about the antialiasing... And the Photon stuff, as you say, is also in there... If you don't have the 2.0 manuals... I'll be more than happy to write you the information about that... But my problem is that when it comes to the bsp tree... The manual tells me that I am going to see colors... But it does not tell me how to interpret them to optimise my scene... I can only estimate the values I need from the size of my scene... And the repartition of the objects in it... taking in acount the motion blur and other variables... And then go on testing a little higher or lower to see if I gain any time... But this tool would help me define those values faster and surely... better...

Tank you...

01 January 2002, 02:29 PM
Sorry if I missed the point of your first question.

Ok, assuming you understand the basic idea behind using binary space partitioning to accelerate the tracer's ray-surface intersection calculations, let's try a couple experiments (this is my first time, but it doesn't seem so confusing now that I try it).

First, set up a simple test scene using some basic primitives in front of the camera. Enable the BSP tree diagnostic display for Depth.

Set your BSP tree leaf size to something low, say 5 or 10, and set the maximum BSP tree depth to 1. The objects will be colored red. Increasing the maximum depth will cause objects to change from red to green to blue as the mazimum depth gets higher. I am only guessing, but it looks like blue indicates a very low depth relative to the maximum depth specified, while red indicates the maximum depth has been reached. This is like the "cold" to "hot" false coloring on thermal imagery.

The leaf size display seems to work in a similar fashion, with colors going from blue (cold) to red (hot) as BSP tree leaves fill up to their maximum capacity. Additionally, it looks like the color of leaves starts going towards white when mental ray starts exceeding the maximum leaf size. A note: mental ray only builds the tree as deep as it needs to avoid exceeding the maximum leaf size, so setting a very high maximum depth will not necessarily reduce the number of triangles in each leaf, if the leaf size is big enough.

You could use this diagnostic to adjust BSP tree depth and leaf size - if you are reaching maximum depth across most of the image, then you probably want to increase depth (tree depth takes priority over leaf size, so mental ray will increase leaf size if leaf size is too small given a particular depth; leaves that are too big result in a slow ray-surface intersection test).

A deeper tree means that fewer triangles are contained in each leaf, while a bigger leaf size will require less depth, right? Smaller BSP depths will require less memory committed to acceleration structures, but a big leaf size is inefficient. Rendering slows down if leaf size is too large (tree depth too small), but performance seems to only increases until you reach a tree depth of about 30-40 for a scene with about a half million triangles, so there is a point of diminishing returns.

Hope this helps. No need for the manuals, but thanks for the offer - they give them away for free here.

01 January 2002, 07:36 PM
Thanks a lot... I was testing it yesterday with one of the scenes from the show... And basically came to the same conclusions... Reading youre reply validates what I thought... You see, this function is very useful... Here, the renderfarm dispatches multiple frames to different machines, instead of using the distributed rendering feature (rayhost). So, it is important that the scenes are optimized to have the fastest rendering time, but also that the preprossessing time and the rendertime are averaged. Having too long a preprossing time means that the tree is optimized, but it also means that it will use a lot of ram... Which could cause some machines to crash, thus making holes in the render...

Also, try playing with the render tile size... I know most people think that it does not influence render time or memory usage, but that is wrong. You can save up to a minute and a half just by adjusting youre render tile size for specific scenes... Also helps a lot if you are doing distributed rendering using computers that are not running at the same speed and dont have the same amount of ram.

Finally, I apologise for sounding a bit abrupt in my previous reply. I have been stuck doing 25 shots a day recently... Takes a lot out of me... especially out of my patience.

Thank you

01 January 2002, 08:18 AM
No need to apologize. We've all been there... Good luck, and don't forget to surface for air periodically.


CGTalk Moderation
01 January 2006, 01:26 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.