Monday, May 21, 2007

36RSO Project progress 5

Last 2 weeks

  • reconsidered height and normal texture packing due to float precision problem and artifacts on clipmap edges
  • textures are now separate, no coarse and fine values packing together. It means more texture lookups but solves many problems - use of A32B32G32R32F and packing height value and normal together could be interesting in the future
  • camera speed control and fixed updating when moving too fast (still minor bugs)
  • TerraD3D automatically uses noise addition to real height data or synthesizes all the levels with perlin noise according to selected synth_levels variable, which can be set from the console
  • perlin noise added for complete terrain synthesization. Terrain is synthesized on GPU
  • perlin noise functions are implemented as a GPU shader program - thanks to FilouGK http://filougk.blogspot.com/






36RSO presentation (
czech ~8MB)

Video here (~7.1MB)

Monday, May 7, 2007

36RSO Project progress 4

Last 2 weeks
  • most of the time spent on correcting the code for new type of clipmaps - synthesized
  • synthesized clipmaps are updated using GPU unlike levels updated from heightmap
  • synthesized levels smoothly add noise to levels with real height data or synthesize terrain from scratch
  • implemented mid-point displacement - easy and fast algorithm with good results. New height values on finer levels are sampled from a randomly generated noise texture. Range for the displacement is always halved on finer level

W/o noise With noise
W/o noise
With noise


Next 2 weeks
  • try more complex algorithms for synthesization - perlin noise etc.
  • when generating terrain from scratch either use the same algorithm or implement special algorithm only for this purpose
  • solve problem with precision limits when packing 2 float height values into one using integral and fractional part in height value textures

Friday, April 20, 2007

36RSO Project progress 3

Last 2 weeks
  • implemented 3rd method for shading - using normal maps in vertex shader. VS fetches normal map and sends normal to PS. Probably the fastest solution and results are good. (Final shading comparison will be made after implementation of synthesized terrain)
  • studied several methods for terrain synthesizing on GPU (noise or auxiliary function, fractal noise, Perlin noise)
  • rewritten clipmap code for height values source other than heightmap. Now it is possible to choose number of synthesized levels that will be added to arbitrary number of heightmap levels (coarse to fine - synthesized levels are finer)
Next 2 weeks
  • synthesized terrain prerequisities - prepare textures for noise generation, finest heihtmap level as base texture
  • GPU shader program for synthesizing
  • try to ensure smooth transition between real and synthesized terrain

Friday, March 30, 2007

36RSO Project progress 2

Last 2 weeks
  • revised existing shading
  • studied appropriate shading methods for geometry clipmaps
  • implemented shading using normal maps computed on GPU (user can change normal map resolution)
  • implemented 'on-the-fly' shading on GPU (2 possible ways of normal computation)

Next 2 weeks
  • implement supersampled normals using both ways of shading
  • try to make on-the-fly shading more effective
  • study possible ways of synthesizing terrain on GPU
  • modify existing clipmap code to enable reading height values from synthesized source, not only heightmap

TerraD3D Shading 1 (v1.04)

Implemented two different ways of shading - using normal maps and on-the-fly.

Normal maps define one normal per vertex and are computed during clipmap update. Asirvatham and Hoppe use double resolution normal maps but these form undesirable blocks. Normal maps are computed in vertex shader and rendered to a texture, during rendering the pixel shader simply samples the texture and computes a color. Normal maps require the same amount of video memory as height maps (4 times more for double resolution) but provide very fast way of shading.

The second way is to compute normals on-the-fly in vertex shader reading several height samples (currently 4) to obtain a normal, which is then sent through pipeline to pixel shader. No extra memory is needed but vertex texture lookup is still very expensive and framerate drops down to 50% compared to normal maps. It would be interesting to find out if only 2 extra texture lookups can produce similar shading quality.

Normal maps - close

On-the-Fly - close

Normal maps - far

On-the-Fly - far


Normal maps form block artifacts at close views, on-the-fly method provides best results with higher vertex density. Blending both methods could be the way to go (http://www.robertwrose.com/cg/terrain/rose-geoclipmaps.pdf).

TerraD3D v1.04 binary here (~4.5MB)
Shading techniques can be changed in console using clipmap.render_texhnique command with parameter render for normal maps and render1 or render2 for on-the-fly method. clipmap.normal_res_double turns on/off double resolution for normal maps.

Thursday, March 22, 2007

36RSO Project progress 1

Last 2 weeks
  • studied possible ways of mesh locality optimizations
  • implemented own way to generate triangle strips for regular grids (up to 400% higher framerate!)
  • compared with nVidia tristrip library (worse results due to the general use of this library)
Next 2 weeks
  • study of shading techniques for GPU clipmaps
  • revise existing shading and update to valid GPU per-pixel shading using normal maps
  • proper normal map update during clipmap shift on GPU
  • blend normals near boundary of clipmaps (same way as geometry blending)

36RSO Project assignment

GPU implementation of geometry clipmaps

Student: Václav Kyba kybav1@fel.cvut.cz
Supervisor: Jaroslav Křivánek xkrivanj@fel.cvut.cz

Extend existing geometry clipmap implementation done as a 36SEM project: