Generic Lattice Noise; suitable for Cycles integration?

Just came across this article here about what the author says is an evolution of Perlin noise that greatly expands the possibilities.

The source code is also provided (under the Code Project Open License), and this could potentially replace the Musgrave texture in its entirety and perhaps even the code behind the generic Noise node.

Why do I mention this replacing Musgrave, to my knowledge, this would be far more powerful, far more controllable, and also produce more or less the same results. I know there’s the issue with kernel pressure for the sake of GPU rendering, but it might be a bit less so if a nice chunk of the procedural texture code can actually be replaced with something that produces a much greater breadth of results. As a bonus, it looks like it would be possible to bake it to an image at rendertime if you want faster renders.

What do you think?

The license is CPOL, which is not compatible with apache (which cycles is licensed under) –

Hi AceDragon,

I agree with you because I make a lot of procedural texture in Cycle and I miss noise to obtain very realistic textures!
Like “cloud texture” is not very clear, precise like this of GIMP…
Bye bye

Hi, I´m the code developper. I have used Blender a few times and of course, there would be no problem in releasing the code under an additional license, as CC-SA 3.0, so it would be possible to use it in Blender.

EDIT Duplicate

Ho dear Haitz,

You are an Love! Your proposal is really good for those who use Blender: A Very Good News!
Thanks a lot in advance…
Have a nice day!

CC-BY-SA 3.0 is a license not intended for source code, I’d suggest you to use a BSD or MIT-style license.

Anyway there is no need to relicense, the code is not directly reusable and the only “transferable” parts are inside the innermost loop body. Since these are essentially pure math functions, I don’t think they’re covered by copyright, unless you copied the text straight (which isn’t possible anyway).


I don’t have much knowledge about open source licenses (I used de Codeproject one since it was the one recommended there), and I don’t know which is the protocol to relicense (once I have the Codeproject license I can’t take it back, so it should be an additional license).

If someone could write how to relicense and what license is needed, I could modify the codeproject page and add it.

Right now I’m leaving for a one week travel. But I can modify the page as soon as I’m back.

Aren’t you the only developer though, does this mean they essentially steal your code if you make the decision to use CPOL and then change your mind about it?

If so, then it sounds like using that license takes away all rights you have to the code and thus you might have the ingredients for a court case against the creator of the website and the license, the construction of licenses that take away your rights relating to your own code (even if you’re the only one who touched it) should be illegal.

The following is not legal advice:

All you need to do is publish your code with a copy of the license and a written notice that the included files are covered by it. It is also common to specify the license at the top of every source file. In that case you may have to edit your source files.

No. The CPOL does not grant anyone exclusive rights. The (only?) reason CPOL is not a “free software license” is that it restricts commercial usage. Once you publish your code under any license, it cannot be be revoked for any reason that isn’t already specified in the license, or otherwise legally mandated.

If so, then it sounds like using that license takes away all rights you have to the code and thus you might have the ingredients for a court case against the creator of the website and the license, the construction of licenses that take away your rights relating to your own code (even if you’re the only one who touched it) should be illegal.

That’s bullshit. Even though that is not the case for If the terms-of-use clearly specify that you are granting exclusive rights to your work, there’s nothing illegal about it. It’s actually not unusual for employers or even universities to demand exclusive rights of their employees/students work, for the duration of their employment/enrollment. You really need to read the contracts you’re getting into.

(quick reply sent from mobile, which is shitty). I dont see any problem in releasing under a new license, so I’ll do as soon as I’m back. Anyway, this article was just the first one. I’m getting deep into procedural for my own game and this was just the beginning. My idea was to release more code after releasing an alpha for testing (some spare time by then). But if this could be useful in Blender I could use some time and do it now. The algorithm has been improved since I published in codeproject. Besides, I developped another one to render perlin noise (or an o2 appromixation from any lattice noise) in a single pass (instead of one pass per octave) intended for further optimization. And some more stuff still in the todo list, like a “simplex” version or space partitioning. If there’s interest to implement it in Blender, I could just release a new article in codeproject with the new license.

Indeed, just thinking now, I could release the code as a managed dll which returns the texture, so it can be plugged directly into Blender.

For this sort of thing, it would need to be cross platform to make it into trunk, due to blenders cross platform nature, not to mention cycles multilangage output (CUDA / OpenCL / C++). Which means that texture dll wouldn’t be the best of ideas.

Getting into it right now. I´ll release the code under MIT license.

I´m gonna make a couple of improvements.

  • Option to make textures tileable
  • Combining several functions in one texture
  • Using patterns (like the ones) as proximity functions.
  • Adding modulation based in other functions or in first derivative

For now. Probably more thing in the future, after xmas. Anyway, any idea is welcome (better this very weekend, when I´ll be dealing with the code).

Working on it. Adding some seamless features, which could work well with high persistence textures.

For example, this texture I made 5 minutes ago

It’s really composed by 16 (4x4) seamless tiles.

An important thing: I added a feature that involves that all the tiles share the same border. What that means? You can place any tile in any place and it will fit the tiles besides. That way, using a few tiles randomly placed, the “tiling” effect can be avoided.

To see it better, if I copy the tile which is at the top-right part to the bottom-left part, that would be the outcome (it can be seen that it’s the same tile).

The tile fits.

Taking a couple of tiles and applying difference, the borders go to zero

My idea to apply it to my own shaders, which automatically would place random tiles around using uv mapping, so the texture can be loaded as a single one, no need to load as many textures as tiles.

But that would be done for Unity. Have no idea if you guys can find it useful for Blender. You tell me.

Very good job Haitz, very usefull to clothes and architecture too…

Is it a patch for blender source in C ?

In my opinion, if it’s not possible to integrate this into Cycles in the form of a powerful new node type, it would be good to have this as a library that is connected to the image editor/viewer in order to give Blender a certain level of texture making abilities not only for Cycles, but also for BI, the BGE, and any external render or game engine that one might be using.

In general, having seamless procedural-based texture-making abilities inside of Blender would be a boon to everyone, especially since this is an area that is not well-served by FOSS.

And another one just with a couple of tryings, love blending, quite interisting possibilities.

Well, code is growing and it’s a bloody mess right now. To many tweaks. So basically I have changed the license in the original article to MIT, so the code there can be used.

The new version is becoming more complex than I thought. Right now, I’m thinking in creating a procedural texture generator with a workflow similar to the Photoshop one. Like different layers, but instead of images, procedural noises.

I attach the app as it is right now, in case somebody feels curious, though there’s still much more to do. (238 KB)

This is pretty cool! It’s a shame it’s a standalone program though. If this could be integrated into Blender so we could edit the procedural textures on the fly, it would be quite awesome.

And, not knowing how this algorithm works, if integrated into Blender, is this something we can use with volumetrics to get 3D noise? It’s my understanding that the reason why some of the procedural textures from Blender Internal weren’t ported for Cycles is because they’re only 2D.