BSDF eigth entries limitation

Discussion related to the LuxRender Material system, programming API and Scene file format.

Moderators: jromang, tomb, zcott, coordinators

BSDF eigth entries limitation

Postby farsthary » Tue Aug 11, 2009 3:28 pm

Hi all :D

sorry for being offline, I hope all my nigthmares end in september when
I get my oficial job with internet access (I´m crossing finguers)

I have started to feel confortable with luxrender and I have made some
minor modifications before start to doing the big ones. though I still
have many things to learn to start coding a big feature in Lux.

Recently I have noted that Luxrender , like in PBRT use a static array
of 8 entries in BSDF, though that is more than enough for near every
material, well ... I dont like very much that kind of limitation so I
took the chance to change the array for a dynamic list, so removed that
limit and everything work the same. I haven´t noted a performance loss
or gain (though I have being waited for a performance loss since arrays
are always faster to access than linked lists)
Could that be usefull for integration?

But then I have a question: is the same thing a material with a BSDF of,
lets say, 10 BRDFs and a mixed material of 10 BRDFs each one?

Cheers to all
farsthary
Developer
 
Posts: 9
Joined: Wed Mar 04, 2009 6:21 pm

Re: BSDF eigth entries limitation

Postby jeanphi » Wed Aug 12, 2009 2:29 am

Hi,

As I see it, the major advantage of the fixed size array is that it is allocated alongside the BSDF and the BxDFs in the memory arena. This way you reduce cache pressure. As long as everything fits into the cache, you might not see a performance penalty, but if you're running short on cache, the performance will degrade faster with widespread allocations. Most material only use 1 or 2 BxDFs so this might not be that noticeable, you might trigger it more easily with the carpaint material. I'm not agaisnt this change, but it will need thorough testing.

A BSDF with 10 BxDFs is not the same as the mix of 10 BSDF with 1 BxDF each (if that is the question).
For the BSDF with 10 BxDF, the result is BxDF1+BxDF2+...+BxDF10
For the mix, the result is a1*BxDF1+a2*BxDF2+...+a10*BxDF10 with a1+a2+...+a10=1

Jeanphi
jeanphi
Developer
 
Posts: 6569
Joined: Mon Jan 14, 2008 7:21 am

Re: BSDF eigth entries limitation

Postby farsthary » Mon Aug 17, 2009 3:47 pm

Hi jeanphi :D

Thanks a lot for your repply, and for claryfying me about the BSDF combinations, in that case when more than 8 BSDF per material are necesary then it could not be aleviated with the mix material.

I have another question: if the majority of materials ue 1 or two BSDF materials then in a very big scene there should be a memory usage redution using the dynamic BSDF because each material will not allocate the 8 BSDF? or is not allocated per scene but per ray? In the second case it will not matter then.



Cheers
farsthary
Developer
 
Posts: 9
Joined: Wed Mar 04, 2009 6:21 pm

Re: BSDF eigth entries limitation

Postby jeanphi » Tue Aug 18, 2009 1:50 am

Hi,

I've recently reworked a bit the BSDF system and now there are 3 possible BSDF (maybe more in the future):
- SingleBSDF: only one BxDF, common case
- MultiBSDF: the old BSDF with 8 slots
- MixBSDF: a proper mix with 8 slots even if only 2 are currently accessible through the file format, I'll extend it after v0.6

Jeanphi
jeanphi
Developer
 
Posts: 6569
Joined: Mon Jan 14, 2008 7:21 am


Return to Materials, API & Scene file format

Who is online

Users browsing this forum: No registered users and 0 guests