Community
Arnold for 3ds Max
Rendering with Arnold in 3ds Max using the MaxtoA plug-in.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AiEvaluateLightSample

7 REPLIES 7
Reply
Message 1 of 8
3rungivi
276 Views, 7 Replies

AiEvaluateLightSample

Hi guys ! do you know in arnold 5 - 6 how is it called this function AiEvaluateLightSample?


Tags (1)
Labels (1)
7 REPLIES 7
Message 2 of 8
maxtarpini
in reply to: 3rungivi
Message 3 of 8
3rungivi
in reply to: maxtarpini

Thank you Max , please take a look from the script I can't find this function in new arnold. 8208-1600891988686.png

Message 4 of 8
thiago.ize
in reply to: 3rungivi

From the link Max posted, it looks like AiBSDFIntegrate could be what you want?

Message 5 of 8
3rungivi
in reply to: thiago.ize

unfortunately isn't that function

Message 6 of 8
Stephen.Blair
in reply to: 3rungivi

AiEvaluateLightSample was removed in Arnold 5

From the Arnold 5 Porting Guide (a PDF that ships with the Arnold SDK):

Light Sampling

In nearly all cases, shaders should no longer perform their own light sampling and instead output shader closures for the Arnold integrator (see later on). However for shaders that do their own integration, there have been some changes.





// Stephen Blair
// Arnold Renderer Support
Message 7 of 8
thiago.ize
in reply to: 3rungivi

It's not a drop in replacement. You'll still need to modify other code. And as Stephen pointed out, ideally you'd completely rewrite the code to use the closures.

Message 8 of 8
maxtarpini
in reply to: 3rungivi

What Thiago says in the comments of my prev answer or if you wanna do it 'manually'...

it looks you want to evaluate direct radiance reflected from a light by a BRDF...

so you need a light sample ..

specifically.. the sample (normalized) direction you'd feed into your BRDF eval fnc..

AtBSDF *bsdf = yourbsdf;
const AtBSDFMethods *methods = AiBSDFGetMethods(bsdf);
methods->Init(sg, bsdf);
AtLightSample light_sample;
while (AiLightsGetSample(Base::render_state, light_sample)) 
   //note light_sample.Ld below
   methods->Eval( bsdf, light_sample.Ld, lobe_mask, true, lobe_sample );

And that was for the eval().. but then you may need also to support the sample() .. and that's the other part of the code in the link I posted... that together can be used to fully support MIS.

So you don't have anymore a single fnc that will do the work for you but you have to manually support light loops and MIS. (ADDED) Basically it looks like before the API were kinda light centric while now they are BRDF centric, which IMO it's more natural and consistent.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report