I think i understand the procedure now. I made some experiments, with tiling, stretching (real bas stretching, something like NEAREST, NEAREST filter), different resolution octaves etc.
I want your opinion on the steps. Esp. on the frequency series...
1) Generate n octaves of noise, using the same dimensions for all of them (e.g 32x32), and with (Frequency * 2^i, Persistance^i) for every one of them.
2) Having those n "textures" at (e.g) 16x16 resolution, start stretching them in the order: (final texture 256x256, n = 5)
# octave - original dims - final dims - tile (u, v) - weight - frequency------------------------------------------------------------------------- 0 16 x 16 256x256 1 x 1 1.0 Base 1 16 x 16 128x128 2 x 2 0.5 Base * 2 2 16 x 16 64 x 64 4 x 4 0.25 Base * 4 3 16 x 16 32 x 32 8 x 8 0.125 Base * 8 4 16 x 16 16 x 16 16x16 0.0625 Base * 16
3) Add those octaves together by tiling them accordingly, using a weighted averange.
4) Do the exponential pass and shading (???)
Requoting Yann's post.
quote:
Both. The first (lowest) octave is tiled by factor x. The next higher octave by x*2, the next one by x*4, and so on. Choose x by using trial and error, just use something that looks nice on your particular skyplane implementation. If you want absolutely no repetitions on your sky, then x should be one. But keep in mind, that you'll need lots of octaves, if you want to get a good detail on the higher frequencies. Increasing x will give you a tradeoff between the number of required octaves (ie. performance) and repetitive patterns. Put it as high as you can visually handle it.
I think, i understand the above paragraph now. I was confused with the terminology. x is the tile coef used for the 0 octave of the above table. So if x = 2 then oct[4] must be tiled 32x32 times instead of 16x16. Is this correct?
I think thread's subject is out-of-date, but what the hell!
To some more questions now.
Using octaves' resolution 16x16, when creating the noise on the GPU, is just for that. I mean, you keep it low, because it's calculated on the GPU, or this resolution gives good results either way (CPU - GPU)? Should i keep it small for faster re-generation, or there are other tricks for that?
Till now my stretching, as i said earlier, is like NEAREST, NEAREST filter, and it looks really bad. Should i implement something like bilinear filtering for stretching the originally-small octaves? The way i did it is something like that :
int octaveSize = 1 << (curOctaveIndex + BaseResolution);int pixelSize = TextureSize / octaveSize; // this is the tile (u, v) from the above table.for(int i=0;i<octaveSize;i++){// int x = i % octaveSize; // this is used for tiling int x = i / pixelSize; for(int j=0;j<octaveSize;j++) {// int y = j % octaveSize; // this is used for tiling int y = j / pixelSize; curPixel = noise[curOctaveIndex][x + y * octaveSize]; }}
Is there a similar easy way for a better stretching "filter"? Can i perform tiling and stretching in one pass? Or i have to stretch every octave to its final dimensions, and then add them togoether by tiling? (Does it make any sense??)
Until summation, should i keep noise data in the [-1, 1] field, or i can convert them to [0, 255] field? It saves 3 bytes, but i have to transform the values back to [-1, 1] for weighting them and summing. Is there anything intermediate i can do, but keeping memory requirements low ([0, 255] field), and make calculations faster ([-1, 1] field)?
Also all the questions from my previous post are still alive!!! Especially the tiling issue.
HellRaiZer
[EDIT]
Tiling problem solved, by "simulating" MIRRORED_REPEAT behavior. Everything seems to work fine right now. I must make animate now. What will give better animated results. 3D noise for every octave, interpolate over time, and reconstruct the final texture as neccessary, or generate some frames of the final texture, and interpolate over them (looping)?
I resample octaves using DevIL, but this is slow!
[/EDIT]
[edited by - HellRaiZer on October 25, 2003 1:07:57 PM]