0
$\begingroup$

How to recreate "getattribute()" function and cycles attributes in OSL to use them in other render engines later.(Renderman, Arnold may have different attributes)

Here's link the list of the common cycles attributes: https://docs.blender.org/manual/en/dev/render/cycles/nodes/osl.html#attributes

Thanks.

$\endgroup$
1
$\begingroup$

Most attributes are calculated dynamic based on the ray intersection point. This is not easy to write as a script that is compatible for other render engines. Using preprocessing directives the cross engine compilation can be solved as long as the other render engine has a similar attribute. You can place this code in a library or a separate node for your convenience. But still for all render engines you you need to solve this. In the end it is just a switch in a compile directive. To automate it a bit more, you can organize this in separate config files.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.