Procedural Hexagon Texture (OSL?)

I was wondering if it is possible to tweak one of blender’s default procedural texture generators (like voronoi or bricks) into producing set geometric shapes like triangles, polygons, hexagons, etc. with controllable side lengths (or at least tiling), and side thickness/color. Can it be done? Can it be done with OSL? I know, there are workarounds, but they’re complicated and are either time-consuming, or CPU-consuming, an

*I have found an OSL script that does something similar but not quite what I want, as it’s limited to picking hexagon colors only, and has a weird displace output.

well there is a script trick for making mesh hexagon
but don’t think you can set width of edges
but you might e able to use the inset faces with multextrude script !

happy bl

Such procedural textures would be very useful - but I dont think there is a way to do it in Blender currently without going down the OSL route.

I used to use Imagine 3D a long time ago on the Amiga - and that had fantastic support for procedural textures. Several third parties made add ons and I think the ones in the link below are a derivation of those original Imagine 3D procedural textures (they certainly look very similar).

http://www.shaders.co.uk/ifw2_textures/whatsin10.htm

Unfortunately they are for Lightwave.

Erm…
Guess I’ll have to try and contact the author of that OSL script I mentioned… see if he can modify that.

In the meantime, I’ll post a request up in the OSL section. Maybe someone would be able to produce a script.

did u make a test with it ?
tried it and not working as expected !
get mostly vertical lines

happy bl

Yeah, works like a charm. Try setting the Mapping scale to 40, and also UV unwrap the mesh.

Here, I made a quick test scene with basic texture/bump setup (didn’t change anything except for the scale):


----EDIT----
Oh yeah, forgot to mention that I also unwrapped all the meshes. Cheers :wink:

sorry links wants to install a download soft!

you should be able to upload file here if less < 1.5 MB

but in nodes set up it is shown as generated not
UV map !

thanks
happy bl

Sorry about that :smiley: Got so used to those freebie filesaring websites.

Here’s that node tree:


And here’s the .blend file Hexagons_Test.blend (1.83 MB)

Yeah, I noticed that he had a generated texture in the node setup too… But! If you go back to the original script that I mentioned in the first post (http://archive.today/uHJRN), you’ll see that he used UV maps. Since the new script is just a modified version of the old one, I assume nothing changed there, and he used the generated texture for simplicity (because he projected it onto a plane).

So, do use UV maps. :wink:

—EDIT—
Just spent a good half-hour trying to figure out why the texture was projecting in one blend file but not in the other. In the end I realized that I didn’t have the OSL turned on… http://www.laie-smileys.com/facepalm.gif

well i look at his blog page and it does show it as a generated texture
and did not see what scale was needed !
may be let him know
might be a mistake !

thanks for file
works fine with UV map

thanks
happy bl

Experimented on them a little, and got this funny result:
http://i.imgur.com/ncHfkzl.png

Here’s the node tree for it:


Yep - you can do this with any texture. Mix a texture into one of the colours of another texture - and you’ll get a textured texture :smiley: