AiEvaluateLightSample

AiEvaluateLightSample

3rungivi
Explorer Explorer
869 Views
7 Replies
Message 1 of 8

AiEvaluateLightSample

3rungivi
Explorer
Explorer

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


0 Likes
870 Views
7 Replies
  • MtoA
Replies (7)
Message 2 of 8

maxtarpini
Collaborator
Collaborator
0 Likes
Message 3 of 8

3rungivi
Explorer
Explorer

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

0 Likes
Message 4 of 8

thiago.ize
Autodesk
Autodesk

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

0 Likes
Message 5 of 8

3rungivi
Explorer
Explorer

unfortunately isn't that function

0 Likes
Message 6 of 8

Stephen.Blair
Community Manager
Community Manager

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
0 Likes
Message 7 of 8

thiago.ize
Autodesk
Autodesk

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.

0 Likes
Message 8 of 8

maxtarpini
Collaborator
Collaborator

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.

0 Likes