Talk:Hackathon Proposal: Fractal Terrain shading

From FlightGear wiki
Jump to navigation Jump to search

> Near the groud, many textures are rather blury or look very flat.

> It would be nice to have some fractal shading to change that.

> See Outerra for a good example of how it could look like.

A quick note:

The ALS shaders already have fractals - made from simplex noise, unless you mean something else.

What people mean when talking about fractals in GPU rendering are often functions made by mathematically combining simple non-repeating functions - generally these simple functions be smoothly varying and have hills and valleys - sort of like a sine wave. The frequency and amplitude of these can be varied. It's possible to add together the simple functions - sort of the same way people can construct arbitrary waveforms by adding together sinusoidal functions of different frequencies and amplitudes. A function made this way will be non-repeating, but it will have the same characteristics - e.g. gently sloping hills on the 1km scale, with some small but rapidly varying height representing rocks on the 1m scale. Of course in texturing the values from these functions are not used for height. These math functions are called fractals because they are (statistically) self-similar - they are also called noise in the sense that they are non-repeating and can't be predicted although these noise functions are smooth unlike, say, static.

rock-ALS.frag is a pure math shader. Generally flightgear uses a combination of textures and math in a variety of ways. Typically noise functions of different scale are enabled at different distances. Also have a look at ALS ultra version of the terrain shader to see both.

What's missing is often providing the textures input (at different scales) and configuring regional definitions files - the existing systems can create a lot of detail. Even well developed areas can be improved further. Start at ENBR, turn trees off, and overalys and look at the forest floor - you'll see white spot detail fade in as you get closer.

If more is needed once the existing systems are used properly, there's a toolset of techniques and functions - noise.frag has a lot of fractals in the sense you are likely talking. More textures with detail at different scales can be added, using techniques already created.

Anyway, have fun at the hackathon:)

Kind regards Vs (talk) 07:36, 13 November 2020 (EST)