[Plugin] Chromanin - Procedural Texture Generation

Post your completed addons to share with the community

Post » Fri Oct 05, 2012 2:52 pm

Edit : update v1.1! (small bugfixes, access to intermediate layers and new demo).

With this update, you can access the various layer used to create the final effect.
You can check the edited demo.

HEre's a screenshot showing you how to create a cloud texture, for example :


The demo : https://dl.dropbox.com/u/1412774/ChromaninTexGenDemoEditor/index.html
The plugin : https://dl.dropbox.com/u/1412774/ChromaninTexGenDemo/pode_chromanin.1.1.zip
The .capx : https://dl.dropbox.com/u/1412774/ChromaninTexGenDemo/ChromaninTexGenDemoEditor.capx
________________________

Here's a plugin that let you create procedural texture (think Perlin noise, eroding layers, cell machines and all that )



All the following textures where produced by the plugin :


It is a port of Chromanin.js for C2 (http://amsqr.github.com/chromanin.js/texgen.html)

I modified the code a bit to let it works under "strict" mode, and do some operations faster. If you spot a bug, don't hesitate to post it here !

The texture are created procedurally, with bit of scripting.

As in the linked example page, you need to specify what you want to do.

For example, the following lines produce the tiles red carpet of the first screenshot :
[quote]
ch = new Chromanin(256,'canvas1');
ch.initlayers(256,256);
ch.colorLayer(0,255,0,0);
ch.cellMachine(1,1234,99);
ch.kaleidLayer(1,1,1);
ch.tileLayer(1,1);
ch.tileLayer(1,1);
ch.tileLayer(1,1);
ch.addLayers(0,1,4,1,1);
ch.writeCanvas();
[/quote]


As you can see, you can copy-paste scripts straight from the original Chromanin, and they work !
For the first line of each script, you need to keep
ch = new Chromanin(XXX,'YYY');,
but for XXX you can enter any size, my code will discard it, as well as the YYY name. You just need to set the size of your texture first via the "Set Texture size" function call in Construct2.
(Working that way allow you to copy/paste scripts made by others without thinking about it too much).

When the script has finished rendering the texture, you can grab it as a base64 image string, and Load it inside a regular Sprite.

If you want to use some procedural texture (coulds, grass...) in your game, the best would be to generate them during the loading of the game.

If you want to know all the possibilities, you can go to the original editor page : http://amsqr.github.com/chromanin.js/editor.html

The demo : https://dl.dropbox.com/u/1412774/ChromaninTexGenDemo/index.html
The plugin : https://dl.dropbox.com/u/1412774/ChromaninTexGenDemo/pode_chromanin.1.0.zip
The .capx : https://dl.dropbox.com/u/1412774/ChromaninTexGenDemo/ChromaninTexGenDemo.capx

Pode2012-10-05 17:01:27
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Mon Oct 08, 2012 10:13 pm

Great
thanks
B
60
S
9
G
7
Posts: 176
Reputation: 8,799

Post » Mon Oct 08, 2012 11:14 pm

wonderful...Pode,u roxx ^^
B
159
S
38
G
11
Posts: 229
Reputation: 17,361

Post » Tue Oct 09, 2012 4:43 am

Awesome, it's great method to generate textures via scripts!
B
96
S
25
G
20
Posts: 3,054
Reputation: 22,642

Post » Sat Oct 13, 2012 11:54 am

Wouldn't mind using this but there's like no documentation.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Mon Oct 15, 2012 3:07 pm

@newt : I'm porting the original editor to a C2 project. With that, I think people can begin to use the plugin to create their own textures.
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Mon Oct 15, 2012 9:17 pm

Cool, can't wait.
Looks like its got everything but the kitchen sink.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Wed Dec 17, 2014 4:49 pm

What a massive bump, sorry.

The subject it pretty interesting, so are there any updates?
Only the chromanin example from that site works for me, sadly the c2 plugin does not (tested in FF 34 and Chrome 40).
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Wed Dec 17, 2014 9:48 pm

would love to see this updated and more procedural generator plugins.
B
73
S
24
G
36
Posts: 146
Reputation: 23,229

Post » Mon Jan 19, 2015 11:49 pm

now its working in FF35, wonderful stuff
B
73
S
24
G
36
Posts: 146
Reputation: 23,229

Next

Return to Completed Addons

Who is online

Users browsing this forum: spacedoubt and 1 guest