Any and all chit-chat regarding L3DT.
10 posts • Page 1 of 1
The latest dev build (v2.5 beta 2, Pro only) now has an option to apply smoothing to a heightfield. The option is at currently at 'Operations->Heightfield->Filter (diffusion)' in the menu. The inputs are a number of iterations, gradient threshold, and a threshold mode. There's no documentation yet, but this will come in time.
For users that import heightfields from images, this option may be particularly interesting, as it will allow you to selectively filter those quantisation steps that occur when you use those nasty 8-bits/layer formats. If you want to do this, set the number of iterations to ~3, set the threshold mode to "gradient" and set the threshold to:
Threshold = 0.5 * (MaxAlt - MinAlt) / (256.0 * HorizScale) <-- you need to calculate this
This will apply smoothing to any slope that is as steep as or steeper than one quantisation step.
If there's interest, I can bash-together a plugin to do all this in one click. Let me know.
Great work Aaron (as usual )
I tried to apply filter on GeoControl heightfield that previuosly has been rendered with a bunch of pyramids (it was like an hedgehog ), and it works very well.
Developing a plugin (with documentation) could be another great idea and could open the way that i previously suggested to you about heightfield filter plugins.
Ah, documentation is the problem here. There are plenty of example plugins (with source code), but none of them are well-documented. I should have some time in April to address this.
Regarding heightfield filters, users of the plugin API may like to note that I've added some zeofunc extension functions (available by zeofunc_GetFunc and callable by zeofunc_Execute and zeofunc_ExecuteThreaded) that include many of L3DT's heightfield effect filters. They're nested in the namespace 'calc.HF', and for instance this filter is called 'calc.HF.GradFilter'. You can view the available zeofuncs and thier argument lists using the new atFuncBrowser plugin (included with v22.214.171.124). Yet more functions are coming in the 3rd beta of v2.5, due next week. I'll write some documentation on this at some point also.
Not as such. This particular filter function was one of the first to be implemented in L3DT back in 2002 (-ish), but for reasons unknown I've only now made an interface for it. I think I just answered the contour and interpolation bit in the ME-DEM thread.
What do you think about:
2) automatically calculate threshold based on actual heightfield MinAlt, MaxAlt and HorizScale (or based on input fields set above) ?
3) add a button (like "Recalculate") when settings changes?
2) Dynamically change Slope threshold parameter when each of other settings changes
And, what other types of values (other than Gradient) accept Threshold units?
Thanks in advance and cheers.
Yep, these are all good ideas. They're now on the to-do list.
Er...do you mean the 'degrees' and 'radians' options? These are just a different way to measure the gradient, as angles rather than rise/run ratios. For instance, I tend to think in degrees, and I do things like filter any pixels that have a change in gradient of more than ten degrees from their neighbours. To convert from degrees to gradient (the actual algo uses gradient, not angles), I use the formula:
grad = sin(angle) / HorizScale;
Radians are of course just another way to measure angle (1Rad = Pi/180 degrees, where Pi~3.14159).
Was this what you were asking, or am I off the mark?
Er...i'm sorry Aaron. I haven't previoulsy saw that Threshold units field has pre-defined values (Degrees, Radians, Gradient). I thought that this field could be only editable.
10 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests