Hello Iohannes, all,
I've developed a pix_noise object that generates a noise texture. You can find it on github: git@github.com:nixhol/Gem.git the name of the branch is: pix_noise
The object is mainly based on pix_set with a Lagged Fibonnaci random generator. I first tested with the algorithm of noise~ but, as Iohannes pointed, it was correlated on big texture. It seems ok now.
Hope that'll help! Best n
Le 14/12/2011 01:16, Nicolas Montgermont a écrit :
Hello Iohannes, all,
I've developed a pix_noise object that generates a noise texture. You can find it on github: git@github.com:nixhol/Gem.git the name of the branch is: pix_noise
The object is mainly based on pix_set with a Lagged Fibonnaci random generator. I first tested with the algorithm of noise~ but, as Iohannes pointed, it was correlated on big texture. It seems ok now.
Hope that'll help! Best n
Good news ! It could be useful for shaders too. ++
Jack
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-12-14 12:51, Jack wrote:
Iohannes pointed, it was correlated on big texture. It seems ok now.
Hope that'll help! Best n
Good news ! It could be useful for shaders too. ++
btw, i pushed a cleaned up version.
fgmasdr IOhannes
Le 14/12/11 15:54, IOhannes m zmoelnig a écrit :
btw, i pushed a cleaned up version.
The [Grey( message is now generating a blue image. But it's working after a [set x y( so it must be a difference between the declaration in the constructor and in the set message. declaring the constructor this way is working here:
pix_noise :: pix_noise(t_floatarg xsize, t_floatarg ysize) : m_banged(false), m_automatic(false), m_mode(GL_RGBA), m_rand_p(0), m_rand_k(24) { int dataSize; if (xsize < 1) xsize = 256; if (ysize < 1) ysize = 256; int randInit = 307*1319; initRandom(randInit); m_pixBlock.image.xsize = (int)xsize; m_pixBlock.image.ysize = (int)ysize; m_pixBlock.image.csize = 4; m_pixBlock.image.format = GL_RGBA; m_pixBlock.image.type = GL_UNSIGNED_BYTE;
dataSize = m_pixBlock.image.xsize * m_pixBlock.image.ysize * 4 * sizeof(unsigned char); m_pixBlock.image.allocate(dataSize); memset(m_pixBlock.image.data, 0, dataSize);
generateNoise(); }
n
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-12-15 13:35, Nicolas Montgermont wrote:
Le 14/12/11 15:54, IOhannes m zmoelnig a écrit :
btw, i pushed a cleaned up version.
The [Grey( message is now generating a blue image.
unable to reproduce. [GREY(, [GRAY(, [grey( and [gray( all produce greyscale images, with no need to [bang(, [set( or whatever.
fgamsdr IOhannes
Le 15/12/11 14:03, IOhannes m zmoelnig a écrit :
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-12-15 13:35, Nicolas Montgermont wrote:
Le 14/12/11 15:54, IOhannes m zmoelnig a écrit :
btw, i pushed a cleaned up version.
The [Grey( message is now generating a blue image.
unable to reproduce. [GREY(, [GRAY(, [grey( and [gray( all produce greyscale images, with no need to [bang(, [set( or whatever.
using pix_noise-help.pd patch and clicking on the message create and then on the message GREY Macbook Pro 2.4GHz osx 10.6.8 Pd-extended-0.42.5 Gem ver: 0.93.git 5284ad0
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-12-15 14:47, Nicolas Montgermont wrote:
Le 15/12/11 14:03, IOhannes m zmoelnig a écrit :
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2011-12-15 13:35, Nicolas Montgermont wrote:
Le 14/12/11 15:54, IOhannes m zmoelnig a écrit :
btw, i pushed a cleaned up version.
The [Grey( message is now generating a blue image.
unable to reproduce. [GREY(, [GRAY(, [grey( and [gray( all produce greyscale images, with no need to [bang(, [set( or whatever.
using pix_noise-help.pd patch and clicking on the message create and then on the message GREY Macbook Pro 2.4GHz osx 10.6.8 Pd-extended-0.42.5 Gem ver: 0.93.git 5284ad0
i had a look and found the following: - - the code was always buggy :-) - - it used fixed color offsets within pixels (e.g. "3" for "blue"), which is simply wrong on OSX. Gem has special constants "chRed",... for platform independent color offsets. - - i also changed the color-type from GL_RGBA to GL_RGBA_GEM, which will actually do the same (GL_RGBA on w32&linux and GEM_BGRA_EXT on osx) but with less confusion :-)
fgmasdr IOhannes
ok that's clear. it works now. this is the syntax used in [pix_set] maybe you should have a look there as well. thanks n
Le 15/12/11 17:07, IOhannes m zmoelnig a écrit :
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
i had a look and found the following:
- the code was always buggy :-)
- it used fixed color offsets within pixels (e.g. "3" for "blue"), which
is simply wrong on OSX. Gem has special constants "chRed",... for platform independent color offsets.
- i also changed the color-type from GL_RGBA to GL_RGBA_GEM, which will
actually do the same (GL_RGBA on w32&linux and GEM_BGRA_EXT on osx) but with less confusion :-)
after some tests, there is still a colorspace problem when using the set message. I think there is no reason the image initialization in the set message should be different than in the constructor. Using this declaration of the setMess function solve this problem here: --- void pix_noise :: SETMess(int xsize, int ysize) { if ((xsize < 1) || (ysize < 1)) return; m_pixBlock.image.clear(); m_pixBlock.image.xsize = (int)xsize; m_pixBlock.image.ysize = (int)ysize; m_pixBlock.image.setCsizeByFormat(GL_RGBA); m_pixBlock.image.allocate();
generateNoise(); }
Best, n
Le 15/12/11 17:35, Nicolas Montgermont a écrit :
ok that's clear. it works now. this is the syntax used in [pix_set] maybe you should have a look there as well. thanks n
Le 15/12/11 17:07, IOhannes m zmoelnig a écrit :
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
i had a look and found the following:
- the code was always buggy :-)
- it used fixed color offsets within pixels (e.g. "3" for "blue"),
which is simply wrong on OSX. Gem has special constants "chRed",... for platform independent color offsets.
- i also changed the color-type from GL_RGBA to GL_RGBA_GEM, which
will actually do the same (GL_RGBA on w32&linux and GEM_BGRA_EXT on osx) but with less confusion :-)
Quoting "Nicolas Montgermont" nicolas_montgermont@yahoo.fr:
m_pixBlock.image.setCsizeByFormat(GL_RGBA);
good point. i hope i found all uses use setting csize/format/type manually and replaced them with the setCsizebyFormat() call (which really should have been called setFormat()).
i also tried to replace all occurences of GL_RGBA with GL_RGBA_GEM which should fix (and instead may introduce) problems with the different RGBA colorspaces used in Gem.
fgbmasdr IOhannes
---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
Le 26/12/11 21:25, zmoelnig@iem.at a écrit :
Quoting "Nicolas Montgermont" nicolas_montgermont@yahoo.fr:
m_pixBlock.image.setCsizeByFormat(GL_RGBA);
good point. i hope i found all uses use setting csize/format/type manually and replaced them with the setCsizebyFormat() call (which really should have been called setFormat()).
it's working well now.
i also tried to replace all occurences of GL_RGBA with GL_RGBA_GEM which should fix (and instead may introduce) problems with the different RGBA colorspaces used in Gem.
with a fast test: pix_video,pix_film and pix_image help patchs work fine here. thanks, n