Community
Arnold General Rendering Forum
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Custom Closure Development

3 ANTWORTEN 3
Antworten
Nachricht 1 von 4
Anonymous
793 Aufrufe, 3 Antworten

Custom Closure Development

Hello, everyone.

Is there any documentation on how to create a custom closure? Once I create such closure, what would I need to do to "expose" it to OSL?

Thanks so much

Tags (1)
Beschriftungen (1)
3 ANTWORTEN 3
Nachricht 2 von 4
Mike_Farnsworth
als Antwort auf: Anonymous

You can create custom BSDFs in Arnold using the C++ API in ai_shader_bsdf.h by filling in the callbacks for your specific BSDF. You can wrap it in a closure like so:

AtBSDF* bsdf = AiBSDF(sg, rgb_weight, my_bsdf_methods, my_bsdf_data_size);
sg->out.CLOSURE() = AtClosure(my_color, bsdf);

This will work from within C++ shaders, but obviously not OSL shaders. Unfortunately, I don't think it's possible at this time to exposure arbitrary closures to OSL code directly. However, you should be able to create a C++ shader that outputs a closure that can be connected as an input closure color to an OSL shader (and vice-versa) in the shader network.

Nachricht 3 von 4
Anonymous
als Antwort auf: Anonymous

Thanks a lot Mike.

Nachricht 4 von 4
zhyh3721
als Antwort auf: Mike_Farnsworth

Is this something that is planned? Having the ability to write BxDFs and expose them as OSL closures would be great.

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report