Cycles OSL builds?

Hello,

Has anyone tried compiling Blender/ Cycles with the new OSL scripting node?

Any builds around?

:slight_smile:

Hey,
We are close to finishing the OSL work on that.
Lukas Tƶnne (Linux) and Jens Verwiebe (Mac OS) did a lot of great work to get static OSL libraries. This means that builds can be shared and all necessary parts are included.

Brecht said he will review the OSL Script node this week, so with a bit of luck we will have all needed OSL parts in Blender Trunk within 1-2 weeks.

Butā€¦donā€™t expect a build for Windows so soonā€¦ehā€¦itā€™s tricky there.

Regards,
DingTo

Ok, here is a Linux x64 bit build with the OSL script node.

It has been compiled on Ubuntu 12.04, x64. I have no idea if it works for you guys, or if it even starts. :stuck_out_tongue:
http://temp.dingto.org/osl/blender_264_x64_with_osl.tar.gz

  • Please download it, extract it and start from the console.

  • If it starts, all is good. If not, please paste the error message.
    (It probably will only run on new distributions like Ubuntu 12.04 and you need some basics like python3.2ā€¦if you already compile Blender yourself, you should have all necessary things.)

  • Try to render. Change to Cycles, and switch the Shading System in the Render buttons from ā€œGPU compatibleā€ to ā€œOpen Shading Languageā€. Press F12. If that works and does not crash, you can have fun. :slight_smile:

  • Go to the shader nodes, Add-> OSL -> Script. Now you can open a .osl shader file or write one in Blender and select that inside the OSL Script node. Keep in mind that only files on the hard drive work, so if you create them inside the Blender text editor, save the .osl file to disk first. Press ā€œCompileā€ in the node. Now you can use the shader like any other as well.

Sooo awesome to see this - doesnā€™t work for me but I was trying to hack it on fedora, where can we get the libs? Had no end of trouble compiling osl decided to wait a bit!

You mean, you would like the OSL libs? We will release them soon too, but we probably wait until the OSL script node is in trunk.
Too many loose ends still.
If you mean the libs to run the build, well just basic packages, which you also need for Blender compile. Check the Blender wiki: http://wiki.blender.org/index.php/Dev:Doc/Building_Blender

Thank-you very much DingTo! :slight_smile:

I had looked at how to compile the build. But to be honest it seemed like a little too much, and I didnā€™t want to run the risk of messing with any of my libraries, and so on.

I have downloaded the Linux 64-bit build, and it runs perfectly fine here. No errors when starting with the console. I have tried rendering the cube with ā€˜Open Shading Language Compatibleā€™ shading system and it works.

I will start testing out now. Granted I am new to OSL, but I believe it is quite a nice, and an easy shading language to get started with.

Would you like bugs to be reported to the normal bug tracker?

@DingTo yeah I meant the osl libs - I had a few problems building them, osl itself specifically. Looking forward to the osl script node, great work!

Hey, great it works for you! :slight_smile:
Please report all issues here for now, not into the official tracker yet.

If you want to get a head start with the osl shaders, take a look here: https://svn.blender.org/svnroot/bf-blender/trunk/blender/intern/cycles/kernel/osl/nodes/
Those are basically the shaders that are used for the nodes in Blender. You can download a few of them, load one into the OSL Script node and start modifying it.

Hi Thomasā€¦ running Mint 13. Downloaded and extracted, saved to my home folder, and renamed the app-containing folder (probably significant) to ā€œblender_oslā€ because Iā€™m a lazy typist - and slow. In terminal, I issued:

cd blender_osl
blender

and got the following message in terminal:

connect failed: No such file or directory
FRS_set_context: context 0x0x54742f8 scene 0x0x5a39078

HTHā€¦ probably something stupid I did?

ETA: Oh, but after that it ran fineā€¦ everything is working with no errors that I can see.

Thanks DingTo, Iā€™m currently looking through the shaders.

I think it may take a little while to fully get my head around this. Well at least to the point where Iā€™m beyond making diffuse shaders and so on.

I have a question. Can I use this PDF (https://github.com/imageworks/OpenShadingLanguage/blob/master/src/doc/osl-languagespec.pdf) when using OSL in Blender?

Tried it out over here and it works, thanks Dingto for the awesome build.

Yes sure, thatā€™s the Language Specification. :slight_smile:

I am looking forward to some cool results :wink:

Thank you for your work, is there any way that we can get a link to a mac build. I donā€™t see anything on, but I saw that Jens was working on it, maybe you could point me in the correct direction. Thank you.

Working fine here, managed to compile the brick texture right in the OSL node :slight_smile:

Here is a quick demo file to give you something to play with:

http://dl.dropbox.com/u/18763916/osl_demo_files.zip

It contains a simple scene setup already in OSL render mode (just enabled ā€œRenderedā€ object mode in the viewport).
Two OSL scripts are included:

checker.osl: very simple checker texture
mandelbrot.osl: more complex shader function using the ubiquitous Mandelbrot set, to show something you cannot do with nodes alone (while loop)

Checker texture is initially selected in the script node for the monkey material.

Notes:

  • When changing OSL files in the Blender text editor, make sure you save the OSL text, not just the .blend file (alt+s). Otherwise the OSL compiler will just use the old file version on your hdd. You can use an external text editor too of course.
  • When loading new .osl files via the file selector, make sure to disable the file type filter, otherwise you wonā€™t see and .osl files.

EDIT: Sorry, just realized the text file paths will of course not work when loading on a different system :rolleyes: Just load the .osl text files again (with disabled file type filter), should be working fine then.

Ubuntu 12.04, work like a charme!!!

Hi there,

Iā€™ve successfully compile blender with OSL support on macosx. I can switch to OSL in ā€˜Shading systemā€™ but i donā€™t have access to the OSL Script node. Where can i find this node please ?

Moved from ā€œGeneral Forums > Blender and CG Discussionsā€ to ā€œSupport > Technical Supportā€

You can get the OSL script node from either the codereview site or the gitorious.org branch:

Method 1: Download the patch from codereview

https://codereview.appspot.com/download/issue6506102_6002.diff

Apply this to your local working copy.

Method 2: Checkout with git (requires git client and basic git knowledge!)

git clone git://gitorious.org/blender-trunk/blender-trunk.git -b cycles_osl

This will give you the full development history too.

Method 3: Download full source from git branch as an archive

Go to https://www.gitorious.org/blender-trunk/blender-trunk/commits/cycles_osl, click the ā€œDownload cycles_osl as tar.gzā€ on the right side. (gitorious.org can be a bit pigheaded sometimes, just reload if the site complains).

After patching/download just build as usual. You will (for now) need the boost::python3 library, but if you already built OSL and followed our instructions for boost and OIIO this should already be there.

works fine on Mint 13! i can compile some nodes just fine, but the image texture node gives me this error:

/home/joel/Documents/osl_nodes/node_image_texture.txt:0: warning: Unable to find "/home/joel/Documents/shaders"0 . Parameter Vector : VECTOR , [0.0, 0.0, 0.0]
1 . Parameter filename : , None
2 . Parameter color_space : , None
3 . Parameter Color : RGBA , [0.0, 0.0, 0.0, 1.0]
4 . Parameter Alpha : VALUE , 1.0
Warning: filename: String type not supported
Warning: color_space: String type not supported

wassat all about?

P.S. - @DingTo should we post error messages, odd results and such here, or somewhere else?