PDA

View Full Version : mental ray BSP Explained To Artists


EdHarriss
04-09-2008, 02:18 PM
Bernard Lebel wrote an excellent article that discusses the usage of mental ray's BSP tree. It's a must read for anyone doing a lot of rendering in mental ray. Check it out: BSP Explained To Artists (http://www.bernardlebel.com/wiki/index.php?title=3D:XSI_tutorials:BSP_Explained_To_Artists). There is also a PDF Version (http://www.bernardlebel.com/tutorials/bspexplainedtoartists.pdf).

Edit: Perhaps I should have put this in the SoftimageXSI section. Feel free to move it.

ThE_JacO
04-09-2008, 03:17 PM
This should probably go in rendering forums
As for the article, while it has some good info in it, I honestly think it should be taken with a pinch of salt as it introduces many concepts and methodologies somewhat disjointedly and not always correctly (some of the mistakes being enormous I should add), very easily leading into a "little knowledge is worse than none" kind of situation.

kimaldis
04-09-2008, 03:40 PM
Agreed. The shear number of words are muddying the message it's trying to get across, it's not always accurate and it's un-necessarily and often incorrectly critical of other articles.

take it with a pinch of salt, confirm the facts before you take them away. Some of it's right, some of it's not.

Carina
04-09-2008, 03:48 PM
So, the Mental Ray BSP tree is an Octree, not a BSP tree? ;)

ThE_JacO
04-09-2008, 03:50 PM
So, the Mental Ray BSP tree is an Octree, not a BSP tree? ;)

Clearly the author of another article showing binary branching, and not boxes neatly divided by four, must have no idea what he was talking about. After all the people who know don't want to share and all common knowledge is bullshit, and all octal is like binary cubed right? ;)

edit:
After reading through the whole thing I have to say: A for the effort, E for the technical contents, it will mis-educate a number of people if made popular.

alexyork
04-09-2008, 03:51 PM
Well, like anything wiki or blog-based on the internet this should be taken with a pinch of salt.

However I think a massive "thank-you" is due here. This article has been a huge help to me even skimming over it quickly in 5 minutes. I'm sure it will prove to be the same for many others.

Carina
04-09-2008, 05:05 PM
Right, so. This is worrying:


re-directed to Dave Lajoie's paper (http://www.edharriss.com/tutorials/tutorial_xsi_rendering_lajoie/XSI_rendering_lajoie.pdf). Dave's paper will give you an excellent lecture about how BSP works. His lecture on the Softimage DVD is also excellent, which includes 3D graphics and sophisticated material. But Dave's method for finding BSP is based purely on statistics. Only very experienced and/or technical users will be able to quickly figure out the meaning of numbers and find the right BSP settings accordingly. Also, Dave proposes to run a script overnight that automates the collection of data, computation of statistics, and the finding of the best BSP values. This is great, however, for most of us, a night spent at finding correct parameters rather than rendering the thing would be considered a wasted night. Most of us just can't afford that.


"Dave Lajoie's paper" actually describes a BSP tree, whereas this article describes an Octree. These are not the same. They do not work the same way. Yes, there will be similarities, notably they can both be used as ray acceleration structures (uhm.. doh):surprised, but there will also be noticeable difference in certain scenarios.

"Dave Lajoie's paper" also isn't THAT technical, and is a lot more to the point, as well as seemingly correct.

kimaldis
04-09-2008, 05:35 PM
Only very experienced and/or technical users will be able to quickly figure out the meaning of numbers and find the right BSP settings accordingly.

Rubbish. It's simple. Change a value, if rendertime increases go the other way, if it decreases go more the same way until it levels off. I've been teaching artists this for years, it takes 5 minutes to explain after a bit of practice they can usually get a good time in 3-4 shots.

kimaldis
04-09-2008, 05:51 PM
However I think a massive "thank-you" is due here. This article has been a huge help to me even skimming over it quickly in 5 minutes.

Are you sure?

This is very much the point Raf is trying to make about spreading mis-information. A little knowledge is a dangerous thing. A little incorrect knowledge is positively lethal. How can you be sure which bits of what you've learned from this article are correct? You'd be much better off going to Dave Lajoie's article, it's informative, well presented and pretty much on the button.

alexyork
04-09-2008, 05:57 PM
perhaps this article is best used as a simple explanation for what a BSP tree actually is and what it's for, rather than how to use it effectively and efficiently. to that end it's been very useful. as far as reading further into it on a more technical level goes, it would probabably be best, in the light of everyone's thoughts, to look elsewhere.

interesting discussion!

Carina
04-09-2008, 06:00 PM
perhaps this article is best used as a simple explanation for what a BSP tree actually is and what it's for, rather than how to use it effectively and efficiently. to that end it's been very useful. as far as reading further into it on a more technical level goes, it would probabably be best, in the light of everyone's thoughts, to look elsewhere.

But this is the point, it ISN'T a description of what a BSP tree is. It also isn't descriptive of how a BSP tree is generated, cause what he's describing is a different type of structure.

alexyork
04-09-2008, 06:04 PM
But this is the point, it ISN'T a description of what a BSP tree is. It also isn't descriptive of how a BSP tree is generated, cause what he's describing is a different type of structure.

in that case this is obviously quite a serious cock-up! looks like bernard's server has either died or he's pulled the article.

[edit] it's back up again

kimaldis
04-09-2008, 06:32 PM
in that case this is obviously quite a serious cock-up!


Exactly. :-)

Ohmanoggin
04-10-2008, 01:36 AM
While I agree that the article is not completely correct, I do not agree that he is doing artists a disservice. Alot of artists don't respect the importance of the BSP and therefore don't use it.

The article gets artists thinking...even arguing in this case about the BSP tree. If I have to gamble on this, I'd say there is a better chance of getting some artists to start using the BSP than there is to damaging someone's career for not knowing a more technically accurate definition of the BSP tree.

I realize my opinion means absolutely nothing in this discussion, but the tone of this thread comes off as very vicious.

Ohmanoggin

bt3d
04-10-2008, 10:58 AM
Rubbish. It's simple. Change a value, if rendertime increases go the other way, if it decreases go more the same way until it levels off. I've been teaching artists this for years, it takes 5 minutes to explain after a bit of practice they can usually get a good time in 3-4 shots.



What value? 'Depth' or 'leaf size'? If it is really so simple and will take only 5 minutes to explain please don't hesitate to explain it to us.

Carina
04-10-2008, 11:30 AM
While I agree that the article is not completely correct, I do not agree that he is doing artists a disservice. Alot of artists don't respect the importance of the BSP and therefore don't use it.

The article gets artists thinking...even arguing in this case about the BSP tree. If I have to gamble on this, I'd say there is a better chance of getting some artists to start using the BSP than there is to damaging someone's career for not knowing a more technically accurate definition of the BSP tree.

I don't have anything against getting artists thinking about these things. However, there are ways and means of doing this, and a brief, general explanation of how ray acceleration structures work would have been fine. However this goes into specifics that are actually wrong, so while it might get you thinking, it will also get you thinking the wrong thing. If you don't know much about ray acceleration structures, how are you going to be able to judge which bit of this article is reliable?

I realize my opinion means absolutely nothing in this discussion, but the tone of this thread comes off as very vicious.

If it comes off vicious I can't be reading it right, I've just re-read the entire thread several times, and I'm not sure what bit is supposed to be vicious. If you know a great deal about a particular area, and see someone else trying to educate people who don't, by telling them the wrong thing, do you really think people who know it is wrong should just stand back and say nothing?

Not sure what to make about the comment that your opinion means nothing, if you think that, why post?

Ohmanoggin
04-10-2008, 03:38 PM
Carina,
My concern in this matter is Bernard took a lot of time to try and explain graphically something that is a very difficult for typical artists to grasp. Something that is extremely important for every Mental Ray artist to know. For his efforts he was not only told “no thanks” he was treated as though he spit in someone’s face.

Comments like these are what I am concerned with:

"little knowledge is worse than none"

“must have no idea what he was talking about”

“After all the people who know don't want to share and all common knowledge is bullshit,”

Rubbish. It's simple. Change a value, if render time increases…”

A little knowledge is a dangerous thing. A little incorrect knowledge is positively lethal.

“this is obviously quite a serious cock-up!”

“Exactly. :-)” (In reference to last comment)

While these kinds of comments might be the norm for typical posts, Bernard was trying to help the 3D community. I myself want to encourage that. If his article is wrong, I think we could have handled it a little better. I have no doubt this scared off other artists from ever thinking about taking the time to create such a document.

Just my two cents,
Ohmanoggin

ThE_JacO
04-10-2008, 03:48 PM
“must have no idea what he was talking about”

“After all the people who know don't want to share and all common knowledge is bullshit,”

Those where actually quotes from the original article, where a proper representation of a BSP (arbitrary binary partinioning by an hyperplane) was called out as wrong. Or the part where the article -literally- calls something bullshit, and demeans public awareness of acceleration structures, and then proceeds to get them all wrong.

And I don't see how "little knowledge is worse than none" doesn't apply here.

The author of the article invites people to prove him wrong the moment before he abandons all mailing lists, closes all threads talking about the issue on xsibase, and then says the people in this thread should "be ready to see their opinions challenged" while doing all that. That is after having previously banned several people from forums he moderates solely for contradicting him.
Don't make a saint and a martir out of somebody who brought all of this on himself please, because the levels of hypocrisy (not yours Ohma) are all the way into the red here sorry.
This all stemmed from placid and honest comments that dared disagree, and while I'm not enjoying posting this, there's only that much childish attitude I can cope with before calling somebody out on it, especially if my person called in cause.

There was nothing personal in the comments that addressed an article that was, and remains, fundamentally wrong, drivelly, contradictory and inconclusive.
The author decided, instead of giving people who were in bed while he was going mad the time to reply, to stomp his feet, go blue in the face, pick up his toys and leave. It's not the first time, I wonder if it's the last or there will be a next.

Think it personal, professional, unprofessional, impersonal, or whatever else you want, the fact remains that the author of a seriously and clearly unclued article (author who struggles with the basics of linear algebra) is trying to argue the correctness of it and the validity of the opinion of somebody like Carina or Kim, both professionals with a broader and deeper understanding of, and experience in, the subject at hand.

I guess if you don't know the subject at hand you really can't spot how telling some statements like "a bsp always divides in two equal halves"(paraphrased) in regards to blatant ignorance of the basics.

Ohmanoggin
04-10-2008, 04:31 PM
The_JacO,
If this thread is all about crucifying someone for boasting about what he knows of BSP tree, which is incorrect, then fine. Flame away.

Ed Harris, who has been a great source of XSI knowledge for years posted an article. It looked useful and appeared as though you guys were being too harsh.

If I have been mistaken, I apologize.
Respectfully,
Ohmanoggin

Carina
04-10-2008, 04:53 PM
Well, I can only speak for myself, but in no way did I mean to sound as though I was "attacking" the original poster of this thread. I was simply commenting on the perceived accuracy of the content of the article posted, which the OP is clearly not responsible for.

Edit: My comments are also coming from an angle that's completely detached from mental ray. I didn't have a clue what ray acceleration technique was used in Mental Ray, but on reading the article, what it describes is clearly not a BSP tree. So unless it's called a BSP tree just for kicks, the article is wrong.

kimaldis
04-10-2008, 04:55 PM
My concern in this matter is Bernard took a lot of time to try and explain graphically something that is a very difficult for typical artists to grasp. Something that is extremely important for every Mental Ray artist to know.

He did and he deserves some credit for it. But consider this; if I were teaching a child to cross the road and I taught that he should look left first (UK) and that he should never cross at a pedestrian crossing, when the child is injured, as he surely will be, do I deserve credit for teaching him even though my teaching caused his injury? This is an extreme example and no-one's going to get injured getting BSP wrong but the analogy holds true and the article is misleading and people will get things wrong and perpetuate myths because of it.

I don't want to veer this thread off the original topic but since you brought it up I think a response is meritted. I don't agree that any of these comments are 'viscious'. Most of what's been said he has been careful and measured, some has been maybe slightly heated but if you've seen the way he's reacted to the same kind of commentary on other forums that's hardly surprising. He over-reacted on xsi@softimage.com, he closed down a thread on XSIbase yesterday on this very topic when someone started to disagree with him. In an unrelated incident a few weeks ago he barred me from XSIbase for politely correcting him.

There seems to be a general feeling here that he is being persecuted. He's not, it's being pointed out that some of what he's written is wrong and there's nothing wrong with that. Please remember also that the people who are concerned about inaccuracies all have a pretty good idea what they're talking about. I really don't see what anyone would stand to gain from simply panning the piece just for the sake of it. Why a completely disparate group of people from all around the world would I understand still less.

The day when people cannot openly discuss something as uncontencious as this will be a sad day. And what I see happening around XSIbase right now, over there the day seems to have arrived. There's no doubt in my mind that if this thread were on XSIbase it would be dead by now.

ThE_JacO
04-10-2008, 04:57 PM
The_JacO,
If this thread is all about crucifying someone for boasting about what he knows of BSP tree, which is incorrect, then fine. Flame away.

Ed Harris, who has been a great source of XSI knowledge for years posted an article. It looked useful and appeared as though you guys were being too harsh.

If I have been mistaken, I apologize.
Respectfully,
Ohmanoggin

I don't think anybody had at any point an issue with Ed, or questioned how much he's done for the userbase over the years.
I sure didn't, and if it looked that way Ed has my apologies.

Ohmanoggin
04-10-2008, 07:18 PM
I don't think anybody had at any point an issue with Ed, or questioned how much he's done for the userbase over the years.
I sure didn't, and if it looked that way Ed has my apologies.

ThE_JacO,
No, I certainly didn't think that and I don't think anyone else would have. I only mentioned Ed, because he was the person that posted the original message saying that every artists needed to look at it. I trust his judgment, just like I trust yours, Carina and Kim's. If any of you posted a similar thread, I would have been puzzled by negative comments as well.

Carina,
Honestly, I agree with you and in fact my original post wasn't directed at you. However, just as you fight for the cause of being able to freely criticize, I was concerned about other artist not feeling free to post information. Of course in hind-site, I realize that there are other issues involved and would not have gotten involved in this thread had I known them.

Perhaps my position could be summed up as this: There is a commercial from an investment company, where a person is choking in a restaurant, the other members of his party notice he is about to die and instead of doing anything about it, just continue to talk about what is the best way to save him. Of course the point is, it doesn't really matter what your choice is, if you do nothing then the person dies.

So, perhaps I see this situation in a similar manner. While those of us debate what is the correct technical definition of the BSP, others of us who do not write code or understand ray tracing engines as well, would just like something, anything even if it isn't totally correct, so we have at least some rudimentary idea on why I would care about the BSP tree and how I might use it to get my work done. Even Bernard, mentions in his article how much developers disagree on this topic.

Anyway, I highly respect all of you. I wish that I had never posted in the first place. I concede my post was in error and I sincerely do apologize and graciously except and ragging I might deserve.

Sincerely,
Ohmanoggin

ThE_JacO
04-10-2008, 07:35 PM
Even Bernard, mentions in his article how much developers disagree on this topic.

That would be another part worth discussing.
I don't know what programmers argue about what, but I think he meant that some people prefer statistical approaches, while others prefer diagnostic ones to narrow down to acceptable deltas before going to the inevitable statistical phase. That's got nothing to do however with the definition of a BSP :)

The only argument, purely for academic purposes, that could be made here is that an OCtree can be considered a kind of BSP, but it falls apart on the practical side, since the choice of an OCtree over a more "pure" BSP is normally made for particular reasons and in particular situations where it's of easier implementation or more performing.

MRay's Acceleration structure of choice simply IS NOT an octree, and no two programmers would argue that it is when it isn't. No amount of contrived examples will change that, and thinking it is will lead into doing all the wrong things.

An OCtree is a valid way to introduce people to the idea of voxeling, as it is the most visually intuitive and approachable, which I also think to be the reason why people so quickly root into thinking it's the only space partitioning modality used, but it should be made very clear when something is presented as an introduction to a topic, but is unrelated to the technology discussed, rather than inferring it's a perfectly valid comprehension tool when MRay's optimization is involved.

bt3d
04-11-2008, 09:21 AM
Due to the fact no one answered my question (in post #15) I want to ask it again.
Kim Aldis wrote:

Rubbish. It's simple. Change a value, if rendertime increases go the other way, if it decreases go more the same way until it levels off. I've been teaching artists this for years, it takes 5 minutes to explain after a bit of practice they can usually get a good time in 3-4 shots.

What value? 'Depth' or 'leaf size'? If it is really so simple and will take only 5 minutes to explain please don't hesitate to explain it to us.
It seems that here are some people who know a lot about BSP tree optimization and I just want to take the chance to bring a little bit light into the BSP myth. During the years I readed a lot of articles / post where people say: 'Optimize your BSP tree' but unfortunately there never was a useful/simple description. Most of them pointed to the mentioned script or to the lajoie document. If anyone is able to put it into a few simple words I'm sure the community will be very thankful.
Please don't get me wrong, this is not an offense and surely a little bit offtopic, because it has nothing to do with the discussion on the mentioned article. But at the moment I saw Kim Aldis comment I thought: hey, this is a good chance to get some information and the BSP tree topic is maybe easier than it seems.

kimaldis
04-11-2008, 11:49 AM
probably the best article that I saw was Dave Lajoie's but that seems to have dropped off the radar in the Softimage site reshuffle, which is a shame. It was short, simple and to the point. I'll see if I can persuade someone to put it back.

OK, the easy way to optimise BSP:

Park the timeline at a frame that's more or less typical of your scene (remember, as objects move in and out of the shot optimal values can change and you can't animate these setting, so you're looking for a happy mean.
in your region properties, set the anti-aliasing down nice and low so you get a good refresh and turn logged messages to 'information' to get render times. (I'm in 6.5, earlier versions may be slightly different but what you're looking for in the mental ray log output is 'wallclock').

now open a smallish render region in your camera view. Last I heard there was some discussion about whether size is important (ask girlfriend) and whether anything need be in the region. I usually start off with small then double check on something larger if I'm bothered enough. Make a note of the wallclock times.

Start with the max depth slider. What you need to do here is move the value up or down, checking the wallclock time, aiming to get that time to a minimum. If you move it one way and the time decreases, carry on going until it levels off. if it increases go back the other way. The thing to keep in mind is that you don't need small value changes with these values, 5 up or 5 down is usually enough granularity, even larger when you're starting off. accuracy isn't critical, value changes of 5 or 10 don't make massive differences, values changes of 1 are almost negligable in their effect.
Now repeat with the Max Leaf Size slider. Exactly the same thing.

You should be able to get this in less than 3-4 iterations for each value. Again, accuracy isn't important.

This is what I do for most shots when I just want to get more or less the best times, when timing isn't hugely important. Small scenes in particular where render times are only a few minutes sometimes it's quicker just to render it and not care too much than it is to spend time getting too caught in render times. But if the scene is a dog, if there's a shedload of pre-process time or it's rendering like pants the verbose output gives out more useful information. In fact, the xsi documentation - which is nowhere near as bad as many people believe - is quite good on this. In the optimisation tab click the '?' (nobody ever uses this but there's a lot of really useful information there ) in the optimisation tab of the render manager. Look out for and follow links to Optimizing Large Scenes for Scalability and BSP Raytracing Acceleration.

bt3d
04-11-2008, 12:29 PM
Kim, thank you very much for this nice and short description. This was exactly what I'm looking for. Don't get me wrong I already read the Dave Lajoie's docs and watched the DVDs coming with XSI 4 and also have read the manual. But when I tested it, all the statistics and the technical backgrounds sometimes leaded to more and more confusion. So your simple explanation is very welcome. Thanks again :)

ctrl.studio
04-11-2008, 01:45 PM
your're lucky guys, mr 3.6.5 comes with another space partitioning method which has no parameters ! :)
http://graphics.uni-ulm.de/BIH.pdf
http://en.wikipedia.org/wiki/Bounding_interval_hierarchy

max

kimaldis
04-11-2008, 02:17 PM
Kim, thank you very much for this nice and short description. This was exactly what I'm looking for.

what I meant to add, but forgot, was that optimisation is about getting the balance between memory use and speed right for the circumstances. You can have fast and memory hungry or slow and memory light, more or less. For more on this, again, check through the softimage documentation. Honestly, it's not that bad.

ThE_JacO
04-12-2008, 01:22 AM
Anyway, I highly respect all of you. I wish that I had never posted in the first place. I concede my post was in error and I sincerely do apologize and graciously except and ragging I might deserve.

I don't think you owe anybody an apology, nor deserve any ragging, and I don't think anybody sent any your way. Some of the more heated parts of the discussion aren't heated because of what or how you posted.

Don't worry about such things and don't let this thread make you think you should ever be afraid of asking for explanations about something, be it technical or posting/writing ethics.

One of the reasons why threads here can get somewhat more heated is exactly because we encourage and allow inquisitive minds to roam, and the day the site won't or "forum leaders" will start considering themselves more privileged than users, or arrogate themselves the right to censor for personal reasons, is the day I'll leave the forum tbh.

And that's it for my veering OT and completely contravening to my moderation duties ;)

fabis
04-14-2008, 12:34 AM
your're lucky guys, mr 3.6.5 comes with another space partitioning method which has no parameters ! :)
http://graphics.uni-ulm.de/BIH.pdf
http://en.wikipedia.org/wiki/Bounding_interval_hierarchy

max
thanks, max. But have some questions. How BIH integrated into mental ray and what I need to do to enable it in render settings? Perhaps, I don't understand you correctly, but I suppose that you mean BSP2 aka Hierarchical grid. If it's true, so why there slill exist settings like 'Max depth' and 'Max size'? Thanks again and forgive for my english :)

ctrl.studio
04-14-2008, 01:37 PM
in maya there's still the option for hierarchical grid but it's obsolete. if you look at the verbosity options (in the output window) you'll see that selecting hierarchical grid you actually engage the bsp2.

max

fabis
04-16-2008, 05:28 AM
Oh, Max. Thanks again. So, this two options required for hierarchical grid, which is not used in rendering and replaced by BSP2. Very strange, why maya/mental ray developers don't delete Hierarchical grid if it's not used and change acceleretion method name to 'BSP2'?

CGTalk Moderation
04-16-2008, 05:28 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.