3
$\begingroup$

I'm trying to use debug functions to achieve an unusual behavior with OSL in Blender. I'm trying to use the fprintf function but I'm getting the following error:

ERROR: Parsing shader "node_test": instruction "fprintf" is not known. Maybe compiled with a too-new oslc?

Can someone help?

Thanks!

$\endgroup$
3
$\begingroup$

The OSL documentation states the fprintf function for already a long time. but the actual commit has been done last summer. The OSL version blender is using (1.7.5) does not have the code for fprintf. The fprintf function is supposed to be released in OSL version 1.9.1 1

It is unclear when blender will update their current OSL version to this version. Developers of Blender are still planning on this subject, and I have found several commits to support OSL 1.9 in cycles.

$\endgroup$
  • $\begingroup$ Thank you very much! I do not intend to use fprintf for debugging actually... I needed a way to communicate the shader with an external script. I did that by writing to the console and intercepting the printfs with an external script using a pipe |. I'm simulating some adaptive optics for a spectrometer that will be built for a large telescope. The render machinery of blender is very efficient so I managed to use the OSL to make a material that behaves like a CCD. It reports the ray hits to the external script that in turn feeds back a deformable mirror that corrects for atmospheric effects $\endgroup$ – ninguem Feb 7 '18 at 22:13

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.