Community
Arnold General Rendering Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Callback when parameter changes

1 REPLY 1
Reply
Message 1 of 2
timothee.chabatFS8S2
152 Views, 1 Reply

Callback when parameter changes

[Maya2019 ; Arnold6.0.1.0 ; MtoA4.0.1.0]

Hello

I'm writing a C++ shader that precomputes values into an array to speed up shader_evaluate calls. I need to update this array whenever a parameter is changed.

What I planned to do is : store former values of parameters, compare them with the current ones in shader_update and generate the array if they are different.

Is there a better way of doing this ? I feel like this is very heavy and and I don't want for this verifications to be done multiple times per rendering in case of IPR. I know it is possible to create callbacks in the Python template but I'm not sure this is usefull for my c++ program.

If there's not, is shader_update threaded ? i.e. should I lock a mutex or something before checking and updating my array in shader_update ?

Tags (1)
Labels (1)
1 REPLY 1
Message 2 of 2

If there's a better way of doing this ? Sure. Not doing it 🙂

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

Post to forums  

Autodesk Design & Make Report