I'm new to OSL for Arnold and would like to create a custom volume shader that can potentially interact with other Arnold nodes. What kind of output should the shader provide? Can I mix volume closures in the same way I can mix surface shaders?
In Houdini, this just returns a BSDF type, which doesn't seem to work:
volume sample_volume_shader (
color absorb = color(0, 0, 0),
color scatter = color(1, 1, 1),
color emit = color(0, 0, 0),
float g = 0,
output closure color result = 0
)
{
result = volume_henyey_greenstein(absorb, scatter, emit, g);
}
You need to add a metadata file for the osl file, and add the following:
[node simple_volume] houdini.shader_type STRING "volume"
Save this as a file with the same name as the osl file but with the extension ".mtd"