-
I have been spoilt with IDE like CLion and PyCharm with the ability to step through source code line by line looking at how data/variable are transform/assign as part of the execution. For OSL shader development, I have mostly been using printf() Since I am new to OSL, I may be missing out on better way to debug shader code as they are being executed. Hope to learn from seasoned shader developers. Kind regards |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Unfortunately, OSL is not so widely used as to have its own IDE. Generally, I try to use the rendered image output to contain debugging information as much as possible and then resort to printf() only when I need to see the specific values of an iterated or other computation that isn't easily represented as an image value. Note that some renderers will only print unique lines of output rather than every printf() statement, so you will need to add a unique value to the printf() statement in order to see every result rather than just the unique ones. |
Beta Was this translation helpful? Give feedback.
-
Thank you @mprater on the insight about the unique value to printf(), would have saved my scalp from me tearing my hair out. |
Beta Was this translation helpful? Give feedback.
Unfortunately, OSL is not so widely used as to have its own IDE. Generally, I try to use the rendered image output to contain debugging information as much as possible and then resort to printf() only when I need to see the specific values of an iterated or other computation that isn't easily represented as an image value. Note that some renderers will only print unique lines of output rather than every printf() statement, so you will need to add a unique value to the printf() statement in order to see every result rather than just the unique ones.