Multitextured
Pixel Shading
Pixels are
sampled from texture images and Hermite spline interpolated {0..1} over regions
of existence based on elevation as passed to the pixel shader function. The
multi-texturing blend operation, proposed by [3] was chosen over older
fixed-function texture blending operations and implemented without a blend map.
While a blend map would produce a finer and more realistic blend of each
region's texture in multi-textured surfaces as demonstrated in [3], the chosen
method provides reasonable blending for higher altitude scenes which
necessarily lack a finer level of detail due to the height of the viewpoint as
may be experienced in a flight simulator. Each elevation zone is separated by
constants indicating gradual shifts between regions of sand, grass, rock, and
snow to create a blended effect over the range of elevations with regions
nearing the next texture region taking on pixel hues of samples of that area, a
method suggested by [9] in the shader effect file.
Future
Work
There are a
number of interesting problems remaining to be tackled with respect to fractal
terrain generation. Applications of automatic landscape generation face
decisions associated with conflicting game-play elements in the storyline or
unrealistic features that present themselves from both fBm and other fractional
models of terrain.
In addition,
most terrain generation methods are calculation intensive and are not
real-time. While some fractal algorithms lend themselves easily to
multi-threading, the result is still time consuming as is the case with the
Mandelbrot set [10] and may not apply well without significantly reducing the
size of the perturbed surface greatly or reducing the number of iterations inspected.
An interesting and difficult problem remains open for multi-threading a
fractional Brownian motion implementation since it is a global operation,
taking into account different domains of the variable. One could split
processing by row or column, spanning a surface's Z values or even by quadrants
for processing with results that skew the controls of the algorithm's
parameters and render more noticeable regions of disjoint terrain.
It is this interdependence of previous values from the
calculation that introduces the very properties we are seeking from fBm
introduced by way of the Hurst index, Lacunarity, and Octave. As such, it
becomes difficult to split calculations amongst physical processing units.
Investigation of this concept with Dr. Mandelbrot [8] shows that there may be a
solution to the threading problem through truncation of fBm. However, some
level of introduced errors may be present in the calculation as a result. If
the desired scene produced by the rendering process is aesthetically pleasing,
some inaccuracy in the operation may be acceptable. We would like to determine
what effect a multi-threaded fBm algorithm would have on a rendered terrain as
well as analyze its performance for multi-core processors with optimized code.
References
1. [Mandelbrot67] B. Mandelbrot. How Long Is the Coast of Britain?
Statistical Self-Similarity and Fractional Dimension. Science. New Series, Vol.
156, No. 3775. May 5, 1967). pp. 636-638.
2. [EMPPW94] Ebert, Musgrave, Peachey, Perlin, Worley. Texturing
and Modeling: A Procedural Approach. Academic Press Inc. 1994. Musgrave
Chapters 7-9, Perlin Chapter 6.
3. [Luna06] Frank Luna. Introduction to 3D Game Programming with
DirectX 9.0c: A Shader Approach. Wordware Publishing Inc. Chapter 11.
4. [MKM89] Musgrave, Kolb, Mace. The Synthesis and Rendering of
Eroded Fractal Terrains. SIGGRAPH 1989. ACM Computer Graphics, Volume 23,
Number 3, July 1989.
5. [SS05] Stachniak, Stuerzlinger. An Algorithm for Automated
Fractal Terrain Deformation. Computer Graphics and Artificial Intelligence. Ed.
D Plemenos. ISBN 291425607-8, 64-76, May 2005.
6. [HR06] Hardy, Roberts. Blend Maps: Enhanced Terrain Texturing.
Proceedings of SAICSIT 2006. pp 61-70.
7. [MSSDK07] Microsoft Corporation DirectX SDK (November 2007). http://www.microsoft.com/downloads/details.aspx?
familyid=4b78a58a-e672-4b83-a28e-72b5e93bd60a&displaylang=en.
8.
[Mandelbrot07] B. Mandelbrot. Personal Email Communication.
November 2007.
9. [Hayes07] Hayes, Jeremy. jeremy.hayes@intel.com. December 2007.
10. [Intel05] Using SSE3 Technology in Algorithms with Complex
Arithmetic. http://softwarecommunity.intel.com/articles/eng/3426.htm. February 23, 2005.
About
the Author
Jeff Freeman
is a Software Engineer in the Software and Solutions Group, where he supports
Intel integrated graphics solutions in the Client Scale Enabling team. He holds
a B.S. in Computer Science from Rensselaer Polytechnic Institute. He can be
reached at jeffrey.m.freeman@intel.com.
Credits
Steve Pitzel
steve.pitzel@intel.com: Art/Textures
Jeremy Hayes
jeremy.hayes@intel.com: Guidance on terrain shading
Download
PDF
Procedural
Terrain Generation With Fractional Brownian Motion [PDF 283KB]
Download
Demo
IntegratedGFX_FractalTerrain_Demo.zip
[ ZIP 4.9MB]
Additional
Images
|
I just wish the article was longer.