David Roberson |
A few weeks ago, I stumbled across an example Spherical Noise Map Generator using C++/libnoise. That got me to wondering if FF would be capable of doing it, too. I posted a Feature Request and emme helpfully supplied an example Map Script, pointing out that it could be further enhanced to multi-octave noise, and other cool things.
spherical_noise_v001.ffxml I remembered one of the Script API I saved was for multi-octave perlin noise and went back to study it, for help making emme's example work along the same lines. Unfortunately, I'm pretty much a beginner with Lua, and it's been years since I've done any real coding, so I could not see a direct path to follow. It seems that the "multi-octave" portion of the script is already using a z-coordinate, so that struck me as a conflict even before I realized emme's 3-coordinate example sets up the variables in a very different way. As in, I barely understand the logic of what it's doing, so I can't follow the transition from my 2-coordinate multi-octave example to 3-coordinates. Maybe somebody can help me with that. The API I'm referencing is: Script API - Multi-Octave Perlin.ffxml. This is going to be a learning project for me, and other features will come to mind, or variations along the same lines (I've mentioned exploring a way to do a Whorley noise spherical map generator, for example). I'm just not sure how much I have to study before I can figure this out on my own. Whatever happens, I'll try to keep track of my progress here, for the benefit of anyone interested in the same challenge. |
|||||||||||
Posted: December 29, 2020 7:43 pm | ||||||||||||
emme |
I added some features to the script: octaves, roughness/detail, distortion and noise-profile. This multi-octave implementation probably isn't exactly the "correct" way to do it - I just did it the quick and dirty way
![]() I think there is also a 2D Worley noise example script in the Noise-API help section. Not sure how easy it'll be to convert into 3D, but my guess would be, not super difficult. I'll check it out at some point. In the original thread, you mentioned texture baking in Blender - I'll answer it here. After creating a UV-sphere, create a new material in the shading editor and add some texturing. Next, add a new empty image texture (alt+n -> texture -> image texture) and click the New -button. In the render properties tab, select Cycles for your render engine and you should see a Bake tab below. Select the bake type ect. and click Bake. You can now use the baked texture on your object or export it to disk. spherical_noise_v002.ffxml |
|||||||||||
Posted: December 29, 2020 9:11 pm | ||||||||||||
David Roberson |
Thank you, emme! I'll check out your added features now. I discovered pretty quickly that learning Lua is going to be a little harder than I first thought. The documentation I've found so far is a bit dry and quite a bit shy of tutorials I can pick up on quickly. I still think it's worth learning, and I hope the forums here will help with that. I already have a few ideas of what features I'd like the component to have, starting with the usual: probably map inputs for color, roughness, contrast, and possibly distortion, with scale (already there), angle, details (now added) and variation. I think I'd also like to be able to pan through the 3 coordinates interactively to explore and position the noise. I did pick up the whorley noise API, today. I'll be interested to see what you come up with--you'll probably figure it out way ahead of me
![]() As for Blender, the answer helps. I imagine I'd have already learned how to do it if I'd experimented with texture baking beyond learning that it could be done. The first time is always a bit daunting. |
|||||||||||
Posted: December 30, 2020 3:37 am | ||||||||||||
David Roberson |
Emme, I'm no judge of best implementation, so I wouldn't criticize your roughness/detail and multi-octave method. It seems to work well enough for basic use. I can say that the difference between your method and the API example is greater than my analysis skills can parse. The multi-octave perlin example does a lot with the input values in the prepare() function to generate octave derived values used in the get_sample() function. The noise itself is ultimately used as the alpha matrix in a blend_normal() function that returns the composite foreground and background maps integration.
The map blending is not a high priority for me, when it comes to expanding on your script, since I'd have to supply spherically mapped inputs to get a usable result. Even though the same is true when it comes to mapped Roughness and Contrast, there are ways to mitigate their influence if I employ a circle curve gradient that masks out the top and bottom portions of the supplied maps. The effects I can get that way are useful in a lot of cases. Not that I'm getting any closer to implementing Roughness or Contrast in your script. I don't even have an example for how to do contrast adjustments, mathematically. My scripting adventures may come to a quick end. It's looking like something I can't pick up on my own. I just can't find the kind of instruction or examples I can follow, and my math skills are probably not good enough to solve graphics problems without explicit examples. I'm only able to look at the script and understand what it's doing. I can't adapt it to something else. Sigh. In any case, thanks again for your help, and your excellent examples. |
|||||||||||
Posted: January 1, 2021 4:19 pm | ||||||||||||
David Roberson |
I wrote a nice little post detailing my first update to emme's script, and it got discarded during preview as I was logged off the forum. Bother. Just to recap, what I remember, I found it easy to add offsets to the x, y and z coordinates via grayscale input. I tested it out with perlin noise inputs in seamless and non-seamless modes and the results were both seamless, so adding the values to the initial coordinate declarations worked fine. Obviously, the offsets can produce additional distortion, so extreme results are possible. I'm posting the script code for quick review, with the ffxml attached below.
I still need some tutoring or an example to follow up on adding Contrast or Roughness (independent of Details) to this. I just don't know the math for the first, and my example of the second is implemented very differently from emme's approach. I sort of understand what it's doing, but not well enough to adapt it.
Script API - Spherical Noise v.001.1.ffxml |
|||||||||||
Posted: January 1, 2021 6:30 pm | ||||||||||||
emme |
Added mappable detail (or roughness) and distortion. The noise profile should work for mappable contrast, but I just tried mapping it, and it breaks the seamlessness for some reason. Could be that the curve gets sampled incorrectly with non-square images, I'll have to look into that. Anyways, contrast is easy to adjust after the script, so I just added a mapped tone curve for that. Let me know if works ok.
Like you mentioned, all the input maps need to be in the same spherical format in order to maintain seamlessness. Mapping with seamless 2D perlin won't be seamless on a sphere - even if it looks seamless in 2D. Pretty cool to play with the xyz offsets you added btw. Really helps with visualizing the projection ![]() spherical_noise_v003.ffxml |
|||||||||||
Posted: January 1, 2021 11:33 pm | ||||||||||||
David Roberson |
A quick little progress update, here's some thoughts on Brightness/Contrast adjustment adapted fr om an online source. I revised the examples from the two articles I found into rough Lua code, without changing any of the values given. I only updated the variable names to fit in with other scripting I've dealt with. I've noted which values before the code blocks. I assume I'll need to convert the values for a 0-1 range before proceeding?
Image Adjustment links to the Articles (copyright © 2008, 2010, 2015 Francis G. Loch) included. Brightness Adjustment Adjusting the brightness of an image is one of the easiest image processing operations that can be done. All that is involved is adding the desired change in brightness to each of the red, green and blue color components. In pseudo-code it would go something like this (unstated, but assuming value range of 0-255)(also assuming brightness is a slider value, so technically declared in prepare() and omitted here):
Contrast Adjustment The first step is to calculate a contrast correction factor which is given by the following formula (assuming the value in question is RGB in the 0-255 value range):
In order for the algorithm to function correctly the value for the contrast correction factor (F [or f, in the line above]) needs to be stored as a floating point number and not as an integer. The value C [c] in the formula denotes the desired level of contrast. The next step is to perform the actual contrast adjustment itself. The following formula shows the adjustment in contrast being made to the red component of a color:
Translating the above formulas into pseudo-code would give something like this (assuming the value of contrast will be in the range of -255 to +255, wh ere negative values will decrease the amount of contrast and, conversely, positive values will increase the amount of contrast):
The function truncate() just ensures that the new values of red, green and blue are within the valid range of 0 to 255. The function truncate() in pseudo-code (assuming value range of 0-255):
As always, your thoughts are welcome. This is just a nudge in the direction of a -- hoped for -- mapped contrast control. That, and a mapped roughness control are my two main objectives for now. |
|||||||||||
Posted: January 1, 2021 11:35 pm | ||||||||||||
emme |
You might be overthinking it
![]() You can already do mapped contrast with existing components. Since the operation is not directional or size dependent , it won't break seamlessness - as long as you use a spherically seamless input maps. Check my last post. |
|||||||||||
Posted: January 1, 2021 11:46 pm | ||||||||||||
David Roberson |
I'm sure I am, emme. I've been known to do that. Got the stubbornness gene from both parents, I guess! I missed your update with the mapped details/roughness and distortion while I was working, so my update this time contains my own solution for mapped roughness. I played a little with the details formula to get in a little extra roughness at the high end. I'll post the code for those who just want a glance at the script, before the attached ffxml with my current experiments in it.
One last thought, how do you enter a tab inside the script editor? Or do you compose the script outside it and just paste in the final version when you're done?
|
|||||||||||
Posted: January 2, 2021 2:48 am | ||||||||||||
David Roberson |
Apart from adding mapped distortion to my working script, I have not made any new progress, so this may be the final version I'll end up using unless I come up with something new I need the script to do. I've wondered about working with multiple noise instances to be blended into the main result, in keeping with the recommendation to make one Map Script to do what you need rather than have multiple Map Scripts in one filter. Even so, I have to prototype the composite with regular components to figure out exactly what I'm trying to accomplish before working out the script to do it internally.
Like before, here's the current script code, with the attached ffxml below:
Script API - Spherical Noise.ffxml |
|||||||||||
Posted: January 3, 2021 5:18 pm | ||||||||||||
David Roberson |
Hey, emme. I've confirmed that mapped curves do break spherical seamlessness, unless their sources are spherically mapped. Even then, some curve utilities, like Repeat, still break it.
|
|||||||||||
Posted: January 4, 2021 4:37 pm | ||||||||||||
David Roberson |
I had a system crash and lost my working ffxml, so I retrieved the one I posted here last. That's when I discovered it was also out of date. So, just a quick repost with the final tweaks, for anyone interested in the prototypes so far. Versions are noted inside, (most of my changes were to emme's v.002, so hers is the only v.003 script in it) so I dropped the version of the ffxml itself. The final change was making Distortion grayscale accept HDR values, since distortions in the +/-1 range are useful, and mapped values beyond it can be useful in some cases. I thought of adding strength sliders -- one for Distortion and a Percentage for the offsets -- to adjust the influence of mapped input, but decided that could be handled by adjustment components beforehand. It's easy enough to add if anyone feels they'd be useful, internally, in spite of being redundant when mapped inputs are not used.
Script API - Spherical Noise.ffxml |
|||||||||||
Posted: January 4, 2021 4:47 pm | ||||||||||||
David Roberson |
Oops! Pointed out the wrong bad guy. Repeat did not break seamlessness after all. It was an Offset mapping of Amplitude that got weird. It didn't really break seamlessness as populate the background with fractional offsets of the source noise. It technically doesn't break the seam at top and bottom, it just creates an unwanted tiling within the perimeter.
|
|||||||||||
Posted: January 4, 2021 5:13 pm | ||||||||||||
David Roberson |
I've been losing my work file in spite of regular saves, so I'm posting the new version while I'm still in the Filter Editor. I've checked that it did save this time, so I might be right that Projects are messing up the file somehow, but this time I made sure I was closed out of any open Projects.
The change was simply adding Foreground/Background map inputs, with my noise assigned to Opacity, with an HDR option for the inputs. Like emme said, an easy thing to add once I decided it was still worth having. I'd almost forgotten it was one of my original goals! Here's the script code, with the attached ffxml, below:
Script API - Spherical Noise.ffxml |
|||||||||||
Posted: January 5, 2021 8:16 pm | ||||||||||||
David Roberson |
Since I lost what I was working on, once I finished reconstructing what I could still remember (last post), I thought I'd begin looking into other types of spherical noise. I quickly composed my own version of Spherical Uniform Noise and got it working in color and grayscale modes. Sadly, the results don't differ any from the API - Uniform Noise. You just get a uniform size noise, without polar distortion like I expected. Still, it was just a warm-up before trying to tackle something more challenging, like Cell Noise. I'm not yet sure if I can adapt the example to this, but at the moment it's the only kind I have an example for.
I'd be thrilled if anyone can provide (or post links to) scripts or coding samples for scripting/programming other types of Worley noise. I can't bug emme for everything (though some times I can't help myself ![]() Just the code snip, this time:
|
|||||||||||
Posted: January 5, 2021 10:17 pm | ||||||||||||
David Roberson |
Well, a little bit of progress is often followed by a lot of confusion. I quickly got lost trying to work out how to do Worley cells in 3D. I don't really know how to explain my confusion other than by commenting on the API script, and seeing if someone can point me back in the right direction. I also experimented, quasi-logically to see if I could at least make the 2D cells seamless, but there doesn't seem to be set_noise_seamless() or set_noise_seamless_region() functions to call.
|
|||||||||||
Posted: January 6, 2021 3:20 am | ||||||||||||
David Roberson |
I've been scouring the web for help on Worley noise, but the examples are in different scripting or coding languages and are nowhere near as succinct and clear as the API script I got from the Noise API page on the FF site. I'll keep looking over what I find, but I'm getting more new questions than answers. For example, how to implement different distance formulas for Euclidean, Manhattan, Chebyshev (sp?), etc.
These are the key to the various types of Worley noise you can get. A great overview of this is in the following video: Coding in the Cabana 4: Worley Noise The video mentions several online resources you'd come across searching the web, which I've seen (I can retrieve the links if prompted, but again, they're not terribly hard to find). The real trick is really understanding what these pages contain. It's really quite the rabbit hole. To those who have become knowledgeable about this stuff, how did you learn it? I don't think you can google your way to expertise. If there are more explicit tutorials and examples out there, they're not turning up in my searches. I will keep sharing anything I learn, as I go, however. |
|||||||||||
Posted: January 6, 2021 2:25 pm | ||||||||||||
David Roberson |
Well, my "analysis" of Worley noise all falls apart the instant I finally notice I can't reference the global value z... unlike the x,y args in the get_sample(), it simply doesn't exist. So obvious it slipped past me entirely that the z coordinate I'm thinking of is only introduced in the noise function.
So, yeah, just ignore that whole post. |
|||||||||||
Posted: January 6, 2021 4:06 pm | ||||||||||||
David Roberson |
A little progress... I was partly on the right track with my analysis, after all. Once I provided a z coordinate, I was able to generate 3d Worley noise. It's still cartesian, rather than spherical, but the feature points used to calculate the distances are now arranged in x,y,z coordinate space.
Here's the code:
Here's the output I got: ![]() |
|||||||||||
Posted: January 6, 2021 5:01 pm | ||||||||||||
David Roberson |
More progress! Once I had a bit more of a handle on 3d Worley noise (above), I was able to work out how to integrate emme's spherical approach. I'm not sure if "local nz = math.cos(y) * z" is really, technically, the right way to do this, but it works, with x,y remapped the default way. I was pretty surprised when it worked. I guess I'm starting to understand the math better, though I'm sure the research I've done has helped get it through my head.
Scaling needed a little adjusting, and the multiplier I went with doesn't zoom in quite as far as it could. I just liked seeing a few cells at the maximum Scale. I'll share the ffxml in my next post. I still need to figure out how to address the nth point as a variable, to get other permutations, i.e. 2nd closest, 3rd closest, etc. point. I also need to figure out how to apply the other distance formulas for Manhattan, Chebyshev, etc. That's where the other Worley type noises we're familiar come from, with formula variations. So, still work to do! Here's the code:
And here's the example output: ![]() |
|||||||||||
Posted: January 6, 2021 6:02 pm | ||||||||||||
David Roberson |
Okay, I went ahead and added map inputs for Foreground/Background, and a Profile curve. The next step would be to implement Offset X/Y/Z, Detail and Distortion like my Spherical Perlin, but I'm not sure how they'd fit into the structure of my Spherical Cell Noise. I may have to see if emme has some advice, there, before proceeding. I'll skip the code this time and just share the output example. You can get the Map Script from the ffxml I'll be posting right after this.
![]() |
|||||||||||
Posted: January 6, 2021 7:00 pm | ||||||||||||
David Roberson |
One note of warning, the Z Coordinate is an HDR grayscale input, but it really should be a Value input; plugging in a grayscale image will give you a sort of tiled distortion, so just use it like a Value slider.
Here's my current work file: Script API - Spherical Noise.ffxml |
|||||||||||
Posted: January 6, 2021 7:01 pm | ||||||||||||
David Roberson |
In the hope of adding Detail and Distortion, I've tried a few things, including making a get_worley_noise() function, but my inexperience with Lua, or rustiness with coding and scripting in general, have been tripping me up. With the function, I'm having trouble with referring x,y,z parameters to the function and returning them as x,y,z values to the get_sample() that calls it. As for Detail and Distortion, I'm not sure where to apply the modifiers so they'll have the desired effect. I'm mostly breaking the distance mapping, in the way's I've tried so far. I'm pretty talented at breaking code, as opposed to fixing it. So, if there are any willing volunteers, I'll leave those objectives out there for anyone interested in lending a hand. I wish I was good enough at this to do it on my own, but I'm relying mostly on my intuition and scripting doesn't lend itself to intuitive approaches very often.
Oh, since a bit part of the goal here is learning, along the way, I'd be interested in any help with Lua. If you just post a sample function like what I'm after, I'm game to try and apply the lesson to my goal, myself. No, the forum is not seeing a lot of traffic, so it might take a while for anyone to bite. I'll keep trying until help arrives or I eventually figure it out. It got me halfway where I wanted with Spherical Worley Noise. Help is always appreciated, though. |
|||||||||||
Posted: January 7, 2021 2:59 pm | ||||||||||||
David Roberson |
I guess I spoke too soon. My get_worley_noise() function works after all. I just had some issue with the editing I was doing at the original time that was throwing up nil errors. Before scrapping the idea, I made one last attempt with a fresh cut-and-paste into the script editor, and it worked. I must have typoed a variable somewhere, before. I can never spot them. So, here's the script using the function (I'll see if there are other things I can do as far as Details and Distortion, now that I have this working):
|
|||||||||||
Posted: January 7, 2021 4:39 pm | ||||||||||||
David Roberson |
Yay! Persistence pays off!
Once I had my Worley noise isolated, the previous approach to Detail and Distortion worked again. I now have my Spherical Cell Noise module caught up to my Spherical Perlin Noise. I'm going to tinker with it a bit more, before posting the ffxml, but here's the final script and a preview of the output:
![]() |
|||||||||||
Posted: January 7, 2021 5:29 pm | ||||||||||||
David Roberson |
Well, I did a little tinkering with my spherically mapped noises and submitted the final results to the Library. You should see them popping up in a few days, at most. The only thing I didn't really do, do to my lack of experience, was optimize the distance algorithms for the Worley noise. To do that, I have to use a sorted table and do a little more searching on the subject of Worley noises. In both cases, I hope to learn what I need to, since I still want to make other types of spherically mapped noise. I figured the work I've already done might help someone else if I made them available in the Library.
|
|||||||||||
Posted: January 7, 2021 9:39 pm | ||||||||||||
David Roberson |
I'm kind of at a crossroads, with this project. I've gone about as far as I can working with the API Noise and valuable help fr om emme. Now I'm confronted with the challenges I discovered in the process of researching noise generation online. So, before starting anything today, I'm taking a moment to organize some of my thoughts. I'll begin with the loose threads I've already mentioned.
And:
The problem I'm having has to do with a feature of Worley noise I've seen in every example, except for the API Worley noise I actually used. In most implementations of Worley noise, there is a set of steps devoted to creating, distributing and querying the feature points, which are distance mapped in Euclidean, Manhattan, Chebyshev, etc. method. The API Worley Noise does not seem to openly address that step. I can't see where it determines which point is closest to a given point. I'd have to know that to impement a QuadTree -- the optimization I mentioned last. I'm pretty sure a QuadTree could be implemented in Lua; the structure is similar to Tech Noise Scrippet shared in the forums by ThreeDee (I can't find the thread at the moment, but I'll attach a sample image.Edit: You can find it here) There are other variations of Cell noise created by mapping to the nth closest point (1st, 2nd, 3rd, etc.). Those are also dependent on identifying and sorting seed points, by relative distance. It's unfortunate that I'm such a novice at graphics scripting; I'm asking for help a lot, which has to bother people at times. I do make progress on my own, provided I have something to lean on, wh ere my own expertise is nil. I do look for answers outside the forum, but there are some very smart people here who do help out on occasion, So, I'll keep asking. But in a lot of ways, I'm flooding the forum (on my own thread, so why not?) mostly to keep track of what I'm doing, and how I'm doing it. If it helps others, fantastic. If it's annoying, well, I'm sorry for that. It gets me through, day to day, though, so it's worth it to me. If you're still reading, and feel helpful (and of course have the knowledge to share and time to share it) I'd like to see other noise examples roughly on par with the API Worley Noise. I do wish FF had provided scripted examples for each of the Worley-based noises in FF. Collecting and preserving those here is one of the objectives of this thread. I think that's everything on my mind this morning. Today is going to be spent surfing for noise algorithms I can, hopefully, adapt for this project. TTFN ![]() |
|||||||||||
Posted: January 8, 2021 2:45 pm | ||||||||||||
David Roberson |
So I finally stumbled across this thread -- Home > Forums > Beta 10.0 > Math: F1, F2, F3 + noise -- which clarified the whole F1, F2, F3 and Euclidian Distance, Manhattan Distance, or Chebyshev Distance terminology for the internal Worley noises. So now all I need is a script example for implementing each of these features in my spherical noise generator.
I could not post a response in the Beta 10.0 thread, and it's already 11 years old, according to the last post, so it's a bit of a stretch, but I'm hoping to catch Vladimir Golovin's attention with this request for additional noise APIs to help with my project. I don't know if it really counts as a Feature Request, so I've held off on starting that kind of thread. I'll keep studying and trying to figure this out on my own, but I'm thinking I'll have to start over from scratch. The implementation of Worley noise I find elsewhere is done very differently, exposing the points to nth order sorting. I'm still looking for examples of other distance functions. I find references to them, but no examples of the formulas themselves in use. |
|||||||||||
Posted: January 9, 2021 2:41 pm | ||||||||||||
David Roberson |
Another victory for persistence! I had been looking for examples of Worley using different distance calculations when I should have just googled the four types I've come across: Euclidean, Manhattan, Chebyshev and Minkowski. That little shift in focus got me the results I was hoping for, and each of the formulas (with a partial exception for Minkowski) boiled down to one line of code.
I tested each one out and got decent results, though I'm clearly still missing whatever produces chaffs or stones. I did not find anything yet on superquadratic distance calculations. I did run into an odd problem when I tried to make the different distance methods controllable by an intslider. The "if" conditions generated a script error, saying "attempt to compare number with nil". I did a little testing assigning the intslider to set different rgba values and it worked outside the "for" loop, but not when it was inside it where the distance mapping needs to occur. Here's a simplified version of the script that's giving me trouble. Maybe someone else can figure out, or knows, what the problem is. Of course, I can just make a different map script for each type of distance mapping. It just seems like I should be able to switch modes in the same script.
|
|||||||||||
Posted: January 9, 2021 6:51 pm | ||||||||||||
David Roberson |
I spent the afternoon debugging my script and eventually tracked down the source of the error I was getting. By this point, I'd moved my distance calculations to their own function, so it may not technically be necessary. But, it works, so I'm leaving it in there as a sub-function of my Worley noise. In the process of debugging, I broke down what each part of the script was doing with comments. I'm leaving those in for the moment too, since I was left with a couple questions I still need answered, or rather parts that I hope someone else can explain.
When I got frustrated, I took a break and got the Contrast snippet I posted earlier working, so I can add that in next. I'll be reexamining the API Perlin Noise method of doing Roughness next, too. For now, though, I'll post the new Spherical Worley Noise script, which gives the option of using Euclidean, Manhattan, Chebyshev or Minkowski distance mapping. My work file is getting a bit cluttered, and I'll eventually upd ate my submissions to the Library with the final versions I come up with. If someone really wants to see an ffxml for this version (and save themselves the trouble of configuring inputs for the script I'm posting) then I'll drop a copy of the Map Script into a new file and post it.
|
|||||||||||
Posted: January 11, 2021 3:01 am | ||||||||||||
David Roberson |
Okay, I hit a stopping point early today. I was seeing what I could accomplish working with the API Multi-Octave Perlin and discovered that the way it handles Roughness is not compatible with spherical mapping. Remapping was not that hard, but there is a stretching artifact along the "equator" that, at best, could only be minimized -- not eliminated. There also seems to be an issue with scale settings for completely zoomed in. What worked in Cartesian space, without modifications to the input scale, does not work even with modifications to scale in the sphere map.
I was able to map Roughness and Contrast (which was easy enough to add), so there's at least a v.001 that works. The ffxml has a v.002 started, current to where I left off. I'll post the code and file for anyone who wants to take a crack at this. I'm sure there are many people on the forums who would fare much better than I.
Script API - Multi-Octave Perlin v.001.ffxml |
|||||||||||
Posted: January 11, 2021 3:33 pm | ||||||||||||
David Roberson |
Having run into a couple problems I could not solve, at present, I went ahead and spent part of the day updating my spherical noise scripts and posting the updates. Since it could take a while for those updates to go through, I'm wrapping up by posting copies here for anyone who doesn't want to wait.
Spherical Perlin Noise Map Script.ffxml |
|||||||||||
Posted: January 11, 2021 10:51 pm | ||||||||||||
David Roberson |
Here is the other. It's slower, by a minute, but now offers four different variations (Euclidean, Manhattan, Chebyshev and Minkowski), as noted a couple posts ago. Manhattan gives a result most similar to Pyramids. Chebyshev falls somewhere between blocks and Techno -- and Minkowski offers a range between Euclidean (Cell noise) and Chebyhsev. Once you apply any of the possible distortions and levels of detail, they tend to become even more similar. Oh well.
Spherical Worley Noise Map Script.ffxml |
|||||||||||
Posted: January 11, 2021 10:57 pm | ||||||||||||
David Roberson |
Having reached the limit of what I could do with my current level of scripting ability, I've sort of drifted off into the land of Processing.org having found a massive resource in the videos of Daniel Shiffman. Having once studied things like Java and Javascript Processing should be much easier for me to pick up and use than Lua. My experience with C/C++ is more out of date, and it's difficult to find tutorials for Lua graphics scripting. I'm hoping to be able to take some of what I learn in Processing and apply them in Lua, at which point I'll come back to projects like the one I started here.
The Worley noise I created only has F1 distance mapping. I was not able to grasp how the script identified the closest feature point in its distance calculations. I will keep tabs on this thread, in case someone offers assistance with F2, F3 and F4 distance mapping. I don't know if they can apply equally to the four types of Worley noise I was able to get through different distance algorithms. That's something I'll need clarified too. I hope I'll be able to figure it all out eventually, but maybe I'll get help from the forum along the way. If either of those things happen, I'll take update my Spherical Worley Noise. If you've read through the thread this far, thank you and hopefully you found some of it useful. TTFN |
|||||||||||
Posted: January 14, 2021 3:54 am | ||||||||||||
David Roberson |
So, it's been a year and change since I thought about this, but I came back to it today and find the problem still stumps me:
I compared this to a few other noise scripts I've done or used as examples, to try and understand why this seems to happen only with Perlin noise called using get_perlin_noise(). Or rather, the version in Egret's API Perlin Noise script. The octave blending emme provided an example did not have this problem. I would be inclined to keep using that, but the Roughness just isn't as nice as Egret's. I do hope an FF team member can chime in here, since Egret's implementation was based on the FF version. I'll post a pic of what I'm talking about, since I'm just throwing this out there again to see if someone can shed some light on why this is happening or how to fix it. ![]() |
|||||||||||
Posted: October 26, 2022 12:34 pm | ||||||||||||
David Roberson |
Last night I did a bit of online research and found a different implementation of improved Perlin noise adapted for lua. So, today I worked on an update to my Perlin Spherical Noise map script. I have been able to generate a sphere and a spherical map using it. I discovered that the noise did not tile correctly as a flat plane, however, so I'm posting the code to see if anyone can suggest a way to make it properly seamless and not just repeating or completely hashed. The options to see the default presentation and my attempt to apply SEAMLESS_WIDTH and SEAMLESS_HEIGHT are commented off.
My attempt to impose seamlessness seems to conflict with the method used to implement octaves. It still produces noise, but in repeating blocks diminishing in octaves as well. That suggests two probable issues to resolve; first is seamless blending of the base noise, and second, getting properly scaled seamless tiling for each octave, to the lim it of octave_index. At the moment, I have no ideas on how to do that. |
|||||||||||
Posted: October 27, 2022 5:40 am | ||||||||||||
David Roberson |
Looking at the spherical Perlin I produced, I had one idea regarding the mapping required for a seamless plane; basically, I need to get mapping coordinates for a torus, which curves in 3d space to create a perfect 2d planar mapping. I'll see if I can find the right function for this, but I'm making a note of it here in case someone else wants to try this idea out.
![]() |
|||||||||||
Posted: October 27, 2022 6:16 am | ||||||||||||
David Roberson |
Since the standard Perlin Noise works for most of the things I'd need to be seamless-squared, I set that part of my scripting aside to focus on what could be done with the equirectangular sphere maps and the spherical projection I came up with so far. The goal of a good, fully procedural planet generator is still a bit of work away. I do have a nice preview of what can be done with these new map scripts. Using a downloaded Earth map, I made some very nice clouds and atmosphere using two map scripts, a few Perlin Noises (mostly to make stars and offset a Profile Gradient), a couple of curves and Scale components (to adjust the Earth map to a square workspace), and a few Math components.
![]() |
|||||||||||
Posted: October 29, 2022 10:46 am |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,711 Registered Users
+18 new in 30 days!
153,531 Posts
+36 new in 30 days!
15,347 Topics
+72 new in year!
21 unregistered users.