Solid noise

New releases and general discussions.

Post » Sat Jun 06, 2009 12:33 am

Iv'e got the mesh part of my terrain program pretty much down, and Im experimenting with the image manipulator to try to be able to map maps all within one program. There are a couple things that Im kinda missing. One being a controllable blur, and for some procedural stuff... solid noise, or clouds.
I can probably get around the blur thing with a loop, but setting up something to act like solid noise, using just the regular noise is getting pretty annoying. Just wondering how hard would it be to implement that?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sun Jun 07, 2009 12:48 am

solid noise? what do you mean?
also, what do you mean clouds? as an effect/behavior? they can easily be done with what's there now

On adjustable blur:
viewtopic.php?f=7&t=3719
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sun Jun 07, 2009 1:49 am

Yeah sorry Its generally called perlin noise.

There are a few workarounds to get similar effects, I was hoping there was some existing code that could used, or modified for use in the image manipulator.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sun Jun 07, 2009 9:27 am

[code:331kxyxb] color = GetPixelColor(x,y);

n= (long)((rand()/(float)RAND_MAX - 0.5) * level);
color.rgbRed = (BYTE)max(0,min(255,(int)(color.rgbRed + n)));

n= (long)((rand()/(float)RAND_MAX - 0.5) * level);
color.rgbGreen = (BYTE)max(0,min(255,(int)(color.rgbGreen + n)));

n= (long)((rand()/(float)RAND_MAX - 0.5) * level);
color.rgbBlue = (BYTE)max(0,min(255,(int)(color.rgbBlue + n)));

SetPixelColor(x,y,color);
[/code:331kxyxb]

That's the code to add noise (note that I used an external library written by an image expert, I didn't do it myself). If you have an algorithm for the above noise I could probably add it.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun Jun 07, 2009 1:56 pm

Thanks Rich, Im not sure where thats supposed to go tho...
Any way about all I could find was a library for c++.
[url:2qd7qxn3]http://libnoise.sourceforge.net/glossary/index.html[/url:2qd7qxn3]

I might add I've figured out a procedure for generating that kind of noise using sprites copied from a canvas, and then blurred. Its very slow though.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sun Jun 07, 2009 2:23 pm

OK, that actually looks promising, but I'd think it'd be better implemented by a separate plugin, as it looks fairly configurable. If anyone is willing to have a shot, I can modify Image Manipulator to transfer back/forth from such a plugin, and we could even modify Sprite/Canvas to copy to/from it.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sun Jun 07, 2009 4:22 pm

Well I think it might be worth it, there's quite a lot of stuff that library can do. The noise could be used for making fog, and clouds, and then there are some procedural textures as well, like wood, and granite.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Jun 30, 2009 12:40 am

[url:2c86e0hr]http://www.udec.cl/~jfuente_alba/noise.cap[/url:2c86e0hr]
Example using single noise texture.
Requires motion blur from [url:2c86e0hr]http://www.scirra.com/phpBB3/viewtopic.php?f=7&t=3719&st=0&sk=t&sd=a#p29542[/url:2c86e0hr].
Also, being able to set offset and scale for tiledbackground for the editor would have negated the need for ANY EVENTS AT ALL. (is it that hard to add those properties?)

Yeah, a shader would be probably better suited to the task, though I insist on using a noise texture instead of generating the noise inside the shader.
I'll look into it.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Jun 30, 2009 3:49 am

Looks promising, altho using a 2.0 shader might be an issue later on.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Jul 07, 2009 12:01 pm

Would it not become less of an issue, as even the worst new hardware supports PS 3/4? :)
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 0 guests