Page 1 of 1

Vectron OSL problem

Posted: Sun Aug 18, 2019 5:02 am
by rohandalvi
<node 'Vectron Sphere'>:1: error: Signature mismatch, expecting a shader with 1 output (_sdf)


I'm getting this error in every single vectron example.

I'm not a coder so I don't know what exactly is the issue.

regards
Rohan

Re: Vectron OSL problem

Posted: Tue Aug 20, 2019 12:07 pm
by jobigoud
Hi,
The shader should have an _sdf (signed distance function) output instead of a color.
Add this line at the top:

Code: Select all

#include <octane-oslintrin.h>
The output argument can be declared and initialized with this:

Code: Select all

output _sdf out = _SDFDEF


and in the code you need to assign the result to the .dist member:

Code: Select all

out.dist = - sdSphere(P - position);
Check the code of the default Vectron sphere for a simpler version.