Simplex noise for OSL

I’d like to share my port of Simplex Noise to OSL. In the blog post you will find the code and a link to an article that explains all about this fast and versatile alternative to Ken Perlins original noise. I’ve ported both the 2, 3 and 4D implementations so there is plenty of room to experiment :slight_smile:

Cheers,

– Michel.


Enhanced the noise a bit with turbulence in the form of fractional brownian motion:


picture shows 1 (= no extra perturbation), 2 and 3 octaves for the 2D noise variant. (The code implements this for 2,3 and 4D noise)

thanks varkenvarken. Just a question is it as fast for rendering with an osl noise as with a blender noise ?

speed is about equal for the 2 and 3d versions but I didn’t do any optimizations yet there is no 4d blendervariant but higher dimensional simplex noise is a lot faster than regular perlin noise I will look into the speed issue although my main motivation in porting it was to have a noise basis that is easily extended with stuff not yet available in the standard noise like for example vorticity (swirls)

ok, nice :slight_smile: I didn’t find how to use those OSL textures for the displace modifier. I have problems with the experimental displace in cycle which crash blender most of the time. Where can I plug the output to get it in the displace texture ?

@matali: displacement is as you said experimental and did not work for me that well either :frowning: The idea was that you should be able to plug any float socket into the displacement socket and that would be it (apart from some scaling) And alternative might be to use the vector bump node. It takes any float value as a height and has a second socket to scale this height. I realize of course that a bump is not the same as a true displacement but it might be good enough depending on what you want.

Hi varkenvarken,
I’ll try that bump alternative :slight_smile: My english is bad, I was asking if it was possible to use your OSL script as a texture for the Displace modifier (not the cycles specific dicing option) ?

@matali: no I am sorry, as far as I know it is not possible to use OSL shaders in the displacement modifier. You can use node based textures in the displacement modifier but these texture nodes are restricted to regular blender internal nodes.

ok, thanks for your help and your great shaders :slight_smile: