Tiled noise blender

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
cval
Citizen
Posts: 58
Joined: Sun Apr 20, 2014 2:15 pm
Location: Ukraine

Tiled noise blender

Post by cval »

I've been playing around with noise texture generation, to create them tiled out of nothing and came up with another mess of a helper class.
Many of you probably tried to use built in noise function to generate values, however i found that "as it is" its not that easy to make it tileable in constrained domain (e.g. if you have tile 128x128px).
Dude here described how its very easy to make it tileable with some awesome math and i have created helper class and GUI for it to control and play around.
Batchnoise.love
(132.51 KiB) Downloaded 156 times
You can add or remove parametric textures, change their values, change blending modes, add tint and make each texture posterized to certain level count, and thing will rerender and show them separately above, however after you change texture size, you have to press "Apply and render", because make process "live" after size change is going to garbage memory with canvases and nobody wants that. Since code is a mess, you can just press "Save texture" to save result texture into your appdata, or press "Get code" to copy parameters to your clipboard for later. Why you would want to copy it for later?

If you want to add a touch of messy procedural generation to your project, you are going to need these files:
blender.zip
(1.83 KiB) Downloaded 107 times
Just require "blender" somewhere in your project and create it with Blender:new(seed,width,height). And then you can paste previously copied parameters into a table to feed it to created blender object, and call

Code: Select all

-- Seed parameter is unnecessary since it is already defined in parameter table
blender = Blender(nil,128,128)
blender:setParameters(preset)
blender:createBlankBatch()
blender:renderPreTex()
blender:render()
Where "preset" is your preset table with copied data from GUI. Then, you can call blender:getTexture() to get result texture (a canvas) to draw it somewhere you want to (an atlas, for example)

More usage hints in example below
example_nb.love
(2.97 KiB) Downloaded 130 times
I've tried to keep things as simple as possible, but if someone is interested, i will try to clear things a bit if code is too much of a mess.

Also if you unpack batchnoise.love, there is a file called "reverse.lua", it's going to be included automatically if present and you can paste there previously created parameters to work. Just restart the thing after you do it.
User avatar
SiENcE
Party member
Posts: 797
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Tiled noise blender

Post by SiENcE »

Also a nice tool!

Why not combine it with your particle editor? You could create masks with it.
cval
Citizen
Posts: 58
Joined: Sun Apr 20, 2014 2:15 pm
Location: Ukraine

Re: Tiled noise blender

Post by cval »

I thought about that, and i also, while creating this and that particle editor, thought that it would be nice to create full-blown (full-half-blown) automated material editor for all kinds of things (textures, particles, scripted special effects etc), however both tools are created part on a whim, part for helping me to construct other things and eliminate as much routine as possible (writing particle emitter code, restarting project to see the result is boring, for example), so...
I think it's going to happen. Sometime. But as you may have noticed, my codebase is not really best in means of design and scalability, so unless i rewrite it until it will not induce headache while working with it, i am going to set that idea aside.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests