Simplex noise plugin

fsk's picture

quite a lot of times i wanted to do something but couldnt because the built in random patch chooses a new seed for every instance you make (you cant get the same value from two random patches). The other day franz posted his version of something like this but it doesnt work for me so i decided to try and make a plugin again.

unlike my former attempts i think im actually gonna use this one quite a bit:). Its still not working exactly as i want it (you cant edit the octaves setting without the stepper) but it seems stable and without leaks.

wish i knew how to add a custom icon:).

enjoy

PreviewAttachmentSize
simplex noise.zip34.04 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

franz's picture
Re: Simplex noise plugin

hi fsk i really love your plugin.

After some quick research, i now understand that your plugin is less computational heavy (than mine ;). The simplex lib - also by Ken Perlin - seems really nice.

I also noticed that your plugin works fine within iterators, while mine doesn't.... How did you do this ?

However, in your patch, i can't set persistence and octave from within the graph (with a noodle)

Why not join our efforts ? Please contact me by email eventually.

toneburst's picture
Re: Simplex noise plugin

Hey, great! Does this use GLSL internally? I've been messing around with 'classic' and simplex Perlin shaders for a while.

Good work!

a|x

fsk's picture
Re: Simplex noise plugin

Quote:
The simplex lib - also by Ken Perlin - seems really nice.

where did you see that? googling it just turns out your post.

the plugin was made with code from this paper http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf

Quote:
I also noticed that your plugin works fine within iterators, while mine doesn't.... How did you do this ?

i didnt do anything special to make it work in iterators. so i guess you had to do something to make it not work in them :).

Quote:
However, in your patch, i can't set persistence and octave from within the graph (with a noodle)

i could change that. couldnt think of any reason to make them animatable. why do you need that?

fsk's picture
Re: Simplex noise plugin

it doesnt use gl. it doesnt draw anything, just makes a number. just a Random patch with a seed input:).

toneburst's picture
Re: Simplex noise plugin

Ah, I see. Should have downloaded it before I posted :) So it's essentially a 1D Simplex Perlin plugin. Cool, sounds handy.

a|x

franz's picture
Re: Simplex noise plugin

http://en.wikipedia.org/wiki/Simplex_noise says Ken Perlin invented the algo in 2001 as his previous algo replacement.

I would need animatable octave and persistence.... well, just to be able to change the noise behaviour in realtime and dynamically. This is very usefull, beleive me, esp inside iterators where elements can have different octaves values...

fsk's picture
Re: Simplex noise plugin

i thought you found a library. i tried using the code from his paper but it seems to have some bug.

i moved the "number of octaves" and "persistence" parameters to ports. and i plan on adding the possibility for more than one output, where each next output would have its seed offset a bit.

PreviewAttachmentSize
Simplex Noise.plugin.zip31.78 KB

franz's picture
Re: Simplex noise plugin

thanks, will look into it. multidimentionnal output would be great: with simplex, apparently with one seed and one time input, you can output 3 noise values (3 dimentions - even more) This would be good for generating XYZ coords from within one single patch.

fsk's picture
Re: Simplex noise plugin

Quote:
This would be good for generating XYZ coords from within one single patch.

yeah, thats exactly why i want to add it. I think it will brake any comps that use the plugin now because i want to name the ports "Value 1" "Value 2" and so on, instead of just "Value" for all of them.

fsk's picture
Re: Simplex noise plugin

Added multiple outputs.

edit: replaced it because it didnt save some option

PreviewAttachmentSize
Simplex Noise.plugin.zip38.57 KB

waxtastic's picture
Re: Simplex noise plugin

This version doesn't work for me. I get this error in QC:

-[Simplex_NoisePlugIn inputNumberOfOctaves]: unrecognized selector sent to instance 0x10124a200
 
0x8705a45f: -[QCContext nextExecutionTimeForPatch:time:arguments:]
0x8705a208: -[QCGraphicsContext nextExecutionTimeForPatch:time:arguments:]
0x87059fd7: -[QCOpenGLContext nextExecutionTimeForPatch:time:arguments:]
0x0000d5f2
0x870a1da1: -[QCView render:arguments:]
0x83694fae: -[NSView _drawRect:clip:]
0x83693c21: -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
0x83693f8b: -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
0x836922f3: -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
0x836931bf: -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
0x836931bf: -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
0x83691e17: -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
0x8368e6bf: -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
0x83607f37: -[NSView displayIfNeeded]
0x83602dde: _handleWindowNeedsDisplay
0x85762427: __CFRunLoopDoObservers
0x8573e2d4: __CFRunLoopRun
0x8573dc2f: CFRunLoopRunSpecific
0x861a6a4e: RunCurrentEventLoopInMode
0x861a67b1: ReceiveNextEventCommon
0x861a670c: BlockUntilNextEventMatchingListInMode
0x835d81f2: _DPSNextEvent
0x835d7b41: -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
0x8359d747: -[NSApplication run]
0x00001d2b

And there is no input port for the octaves.

fsk's picture
Re: Simplex noise plugin

ups:) sorry for that.

PreviewAttachmentSize
Simplex Noise.plugin.zip38.57 KB

fsk's picture
Re: Simplex noise plugin

i tried it on 10.6 today and experienced similar symptoms. rebuilding it in 10.6 made it go away.

PreviewAttachmentSize
Simplex Noise.plugin.zip33.49 KB

waxtastic's picture
Re: Simplex noise plugin

I'm still getting the same issue.

vade's picture
Re: Simplex noise plugin

post source :P

dust's picture
Re: Simplex noise plugin

Im getting a raised exception error using only one output.

im on x_86 10.6.1 using quartz in 64bit running on 32bit kernel.

here is the exception...

-[Simplex_NoisePlugIn inputNumberOfOctaves]: unrecognized selector sent to instance 0x100b9ec00

0x8041675b: -[QCContext nextExecutionTimeForPatch:time:arguments:] 0x80416504: -[QCGraphicsContext nextExecutionTimeForPatch:time:arguments:] 0x804162d3: -[QCOpenGLContext nextExecutionTimeForPatch:time:arguments:] 0x0000d5f2 0x8045e06d: -[QCView render:arguments:] 0x8045d7a8: -[QCView startRendering:] 0x0000cd80 0x81ada926: _nsnote_callback 0x8155be4a: __CFXNotificationPost 0x815487f8: _CFXNotificationPostNotification 0x81ad1890: -[NSNotificationCenter postNotificationName:object:userInfo:] 0x822041ff: -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:] 0x82203e5c: -[NSWindow orderWindow:relativeTo:] 0x822017da: -[NSWindow makeKeyAndOrderFront:] 0x82406251: -[NSWindowController showWindow:] 0x0000ca7f 0x15b35732 0x827a55d2: -[NSToolbarButton sendAction:to:] 0x8241802d: -[NSToolbarItemViewer mouseDown:] 0x82305967: -[NSWindow sendEvent:] 0x8223b122: -[NSApplication sendEvent:] 0x0000a994 0x821d1acc: -[NSApplication run] 0x00001d2b

fsk's picture
Re: Simplex noise plugin

i think i fixed it. i didnt notice it since xcode ran QC in 32 bit mode and this would only happen in 64.

had to declare number of octaves as NSUInteger instead of uint.

PreviewAttachmentSize
Simplex Noise.plugin.zip33.48 KB

dust's picture
Re: Simplex noise plugin

that fixed it for me. no errors now. any chance on releasing the source ?

waxtastic's picture
Re: Simplex noise plugin

works perfectly now. thanks. this will be useful.

fsk's picture
Re: Simplex noise plugin

Added a structure output mode. you have to use structure index member to get to it because dynamically created structure ports can only carry dictionaries which mix the entries. I guess i should have made a separate plugin instead of using that workaround. its to bad the 3D noise function from the same pdf seems to be bugged (makes some kinks in the curve).

also attached the source. please tell me if i did something stupid in there :).

cybero's picture
Re: Simplex noise plugin

When I tried this download today to get franz 1024 particle example working, it says

-[Simplex_NoisePlugIn inputNumberOfOctaves]: unrecognized selector sent to instance 0x1008ab000

FYI :-)

fsk's picture
Re: Simplex noise plugin

that thing again:/.

can you check if this fixed it please:).

PreviewAttachmentSize
Simplex Noise.plugin.zip38.86 KB

cybero's picture
Re: Simplex noise plugin

cheers, fsk.

wasn't actually expecting an update but glad you did, it makes a pretty good partner for the particle plugin by franz :-)

thanks.