html5-img
1 / 61

CSE 788 Fractal Terrains

CSE 788 Fractal Terrains. Terrain Map. Height Map z = f(x, y) x and y are sampled on a 2D integer grid Real data : Satellite, Elevation maps Synthetic : Texture map, Noise functions. Terrain Map. Connect samples into a mesh. Terrain Map. Natural looking Model high detail Size

Download Presentation

CSE 788 Fractal Terrains

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSE 788Fractal Terrains

  2. Terrain Map • Height Map z = f(x, y) x and y are sampled on a 2D integer grid • Real data : Satellite, Elevation maps • Synthetic : Texture map, Noise functions

  3. Terrain Map • Connect samples into a mesh

  4. Terrain Map • Natural looking • Model high detail • Size • Storage (Millions of polygons) • Rendering speed • Zoom-in, zoom-out (does not scale well) • Use textures to model detail? • Not real geometry (bump mapping at silhouettes) • Not scale independent • Repeated textures do not work well

  5. Fake Terrain • Generate the heightfield • Random process • Reflects “realistic” terrain in some way

  6. Random Terrain • Simple: • Terrain(x,y) = rand( MAX_HEIGHT ) • Results in random noise • Next step: • Smooth the terrain generated above • FIR filter:

  7. Filtering • FIR (Finite Impulse Response) filter: • Pass a “window” over the data • Multiply data in window by weights • Result = d1*w1 + d2*w2+ … + dN*wN • Window + weights is called “filter kernel” • Larger window grabs more data

  8. +dHeight Random Fault Lines • Repeatedly: • Create a line that crosses terrain • Add dHeight offset on one side of line • dHeighti = dHeight0 + (i/n)(dHeightn -dHeight0) • Select random endpoints to generate line • Compute “side of line” by plugging X,Y into line equation

  9. More Realistic Faults • Apply FIR filter to faulted heightmap • Smooth out abrupt fault transitions: “Erosion”

  10. 1000 iterations

  11. Variations • Use a smoothstep function

  12. Variations • Use a bump: • -d at distance R away • +d at zero. • Images from lighthouse3d • Used a cosine here.

  13. Variations • Cosine Bump

  14. Variations • Do not need to use a half-plane. Any function that splits space into two halves will work. • Radial functions • Etc.

  15. Particle Deposition • Drop particles in areas where you want volcanic mountains • Particles flow downhill until they come to rest • Move the drop point to create interesting peaks

  16. Particle Deposition • Flow computation • At given point, find lowest neighbor • If local geometry is not flat enough, move new particle on top of lowest neighbor • Roll down hill • “Flat enough” = 27 degrees or so • Check 3x3 pixel window or 5x5 to check neighbors.

  17. Particle Deposition

  18. Perlin Noise • Using a sampling of 2D perlin Noise provides smooth hills.

  19. Terrain Coloring • Using a 1D texture map based on the altitude can provide many useful mapping.

  20. Terrain Coloring • Striped 1D texture map.

  21. Terrain Coloring • Using a 2D texture map provides richer detail, but is independent of the terrain.

  22. Terrain Coloring • More advanced coloring is based on altitude and slope.

  23. Rolling Hills • Scaling in one dimension gives smooth rolling hills.

  24. Procedural Modeling With Fractals • Procedural Modeling • Compute geometry “on-the-fly” • Fractals • Model Natural Phenomena - Self Similarity • Mountains, fire, clouds, etc. • Scales to infinity • Add or “make up” natural looking details with mathematical tools

  25. Fractals “Repetition of form over a variety of scales” • Mandelbrot set, Julia set

  26. Two Fractal Properties • Self-similarity

  27. Two Fractal Properties • Fractal Dimension • Euclidean dimensions : 1, 2, 3, 4, … • Fractal : 1.2342, 2.7656 • Measure of detail or roughness of a fractal D = (ln N)/(ln 1/s)

  28. Midpoint Subdivision • Midpoint (recursive) subdivision

  29. Midpoint Subdivision • Brownian Motion • Describes random movement of particles in a gas or fluid • Fractional Brownian Motion • Brownian Motion + Fractal Dimension • A useful model for natural phenomena

  30. Fractional Brownian Motion • Fractional Brownian Motion • Equations are compute intensive • Approximate with “A family of 1D Gaussians ” • Zero mean • Standard Deviation : S = k2-iH H = fractal dimension (roughness)

  31. Fractional Brownian Motion • Fractal dimension = roughness, I.e. H

  32. Terrain Modeling Criteria • Input • Initial coarse mesh + stochastic parameters • Two criteria • Internal Consistency • Reproducibility : Model is independent of position and orientation • Associate “random numbers” to point index • External Consistency • Continuity between adjacent primitives

  33. A B A B A B Fractal Mountains • Fournier & Fussell (1980) • Recursively subdivide geometry by random number d: –dHeight/2 < d < dHeight/2 • At each recursion: • dHeight *= 2-r • r=1 : self-similar • r>1 : large features early • r<1 : large features late

  34. Triangle Subdivision • Subdivide a triangle into 4 triangles at edge midpoint

  35. Quadrilateral Subdivision • Subdivide a quad into 4 quads at edge midpoints and a new center point.

  36. Diamond-Square Subdivision • Alternate subdivision • Alleviates some creases on the grid.

  37. Fractal Terrain

  38. Mesh Subdivision • Square-square Subdivision • Addresses “creasing problem” (slope discontinuities) • Subdivide parametric patches

  39. Mesh Subdivision • Displacement is scaled by the recursion level. • | b – a | -rn • When do you stop the recursion? • Pixel resolution • Displace upward, or towards the normal to the surface? • Implies that it is not a height-map. • Could use Geometry Images here though.

  40. Mesh Subdivision • External Consistency • Avoid tears between neighboring polygons • How do we compute the normals? • Average polygon normals at each vertex. • Propagate normals down the recursion • Cheaper : use the original mesh normals only

  41. Ridged Fractal Terrains • To create sharp peaks, add an absolute value and flip the surface upside down. • Or, reflect about a maximum value. • Provides a volcano-like effect.

  42. Caldera

  43. Multi-Fractal • This produces a ridged multi-fractal

  44. Add a 1D Texture

  45. More Controls • To create plateaus, add a min function to flatten out high areas.

  46. More Controls • To create a plain, add a max function to flatten out low areas.

  47. More Controls • Multiply by a Guassian to limit the mountain range.

  48. More Controls • To create valleys, create a lower amplitude and rather smooth terrain to use as the max operator.

  49. max (Fractal, Smooth Noise)

  50. max (Fractal, Smooth Noise)

More Related