Tex Gen OSL

I’ve been mucking around with some OSL texture generation nodes. The plan is to create a number of patterns or scripts which take XY coords to function.

A blend file and the scripts are available here: http://homepage.ntlworld.com/charlie.jolly/blender/xy.zip


The blend file is setup to render a 512x tile using a constrained plane and window coords.

This is all wip so be prepared to tweak the settings.

I don’t have time to test it right now, but if this will give users the ability to render out high resolution seamless textures with high levels of details along with things like normal maps, than this could become a great tool for those wanting to stick with open source because there’s not much out there right now. (when it comes to FOSS at least).

It may not be too much to look at now, but I see what could be quite a bit of potential in Blender as a texture generator.

Some more experiments.

Tartan texture using nodes, curves and OSL. Blend file contains external OSL nodes which might need updating.


Blend and OSL files here. The main use of OSL is to create the tiles from the texture coordinates.

http://homepage.ntlworld.com/charlie.jolly/blender/xy_tartan.zip

Penrose tiling. Ported with adjustments from RSL code found here http://code.google.com/p/projectwidowopensource/


Blend file: http://homepage.ntlworld.com/charlie.jolly/blender/xy_tex_gen_penrose.zip

V.interesting inspiration.
Would it be also possible to ‘script out’ relevant normal, specular,displacement/bump maps - to prepare a complete material set ?

That’s an awesome code, I can not choose the better texture

Your results look interesting.

Thank you for sharing the osl files.

I have problems to get visible results.

Getting errors like


Dokumente/Vorlagen/3d/OSL/TexGen/xy_library.h:18: error: integer overflow, value must be between -2147483648 and 2147483647.
...
ERROR: ConnectShaders: source layer "node_osl_script_0x86a0750" not found
ERROR: ConnectShaders: source layer "node_osl_script_0x85cbeb0" not found

Maybe, I did something wrong?

( edit )
I did not notice the date (January).
Something might have changed.

( Looks like my cycles/blender uses 32 bit int (on a 64 bit machine). Its the 64Bit SVN build. )

It’s an easy fix. Replace 3039177861 with 2137483647 in xy_library.h

OSL changed slightly since I wrote the original script but I haven’t updated the zip file.

Hi Charlie,

thank you for your answer. Will try it.