question

Jake Merrell avatar image
Jake Merrell asked ·

Can't Compile OSL for Arnold; function 'empirical_bssrdf' not declared

While trying to compile an osl file, I'm getting an error when I try to use the 'empirical_bssrdf' (and the randomwalk too).

For example, here's a simple osl file:

shader Example ( color color_in = color(0.3, 0.18, 0.18), output closure color out = 0 ) { out = color_in * diffuse(N); //out = empirical_bssrdf(vector(0.8, 0.4, 0.4), color_in);}

When I comment in the empirical line and compile with oslc, I get the error:

test.osl:6: error: function 'empirical_bssrdf' was not declared in this scope

Looking at the debug info, I see a 'subsurface' function available (different signature). If i switch to that function the osl compiles, but when I try to use it in arnold, I get this error:

error: function 'subsurface' was not declared in this scope

My version of oslc is this:

oslc -- Open Shading Language compiler 1.8.2.pixar1697a56


The docs say that empirical and randomwalk are supported:

https://docs.arnoldrenderer.com/display/A5ARP/OSL+Shaders


Is there something else I need to do? I didn't find anything wrt empirical_bssrdf and osl on the interwebs, but maybe I missed something. Help please.

arnoldoslsubsurface scattering
10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Jake Merrell avatar image
Jake Merrell answered ·

Thank you Stephen for the quick answer!

It helped me figure out what was going wrong. A different oslc was in my path before the one provided by Arnold. Fixing that fixed my issue.

Again, your answer was super helpful! Thank you so much!


Not that it matters, but this was my version of MtoA

MtoA 4.0.3.2 - 66869982 (master) - Jul 13 2020 10:27:55


Thanks again!


Jake


10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Stephen Blair avatar image
Stephen Blair answered ·

What version of MtoA are you using?

It works for me:

empirical-bssrdf.png



empirical_bssrdf is declared in C:\Program Files\Autodesk\Arnold\maya2020\osl\include\stdosl.h


10 |600 characters needed characters left characters exceeded

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 2.0 MiB each and 9.8 MiB total.

Welcome to the Arnold Answers community.

This is the place for Arnold renderer users everywhere to ask and answer rendering questions, and share knowledge about using Arnold, Arnold plugins, workflows and developing tools with Arnold.

If you are a new user to Arnold Answers, please first check out our FAQ and User Guide for more information.

When posting questions, please be sure to select the appropriate Space for your Arnold plugin and include the plugin version you are using.

Please include images, scene and log files whenever possible as this helps the community answer your questions.

Instructions for generating full verbosity log files are available for MtoA, MaxtoA, C4DtoA, HtoA, KtoA, and Kick.

If you are looking for Arnold Documentation and Support please visit the Arnold Support site.

To try Arnold please visit the Arnold Trial page.

Bottom No panel present for this section.