Results 1 to 10 of 30

Thread: height field to sphere?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,562

    Default

    Why am I so awesome? Practice!

    Wilbur uses the basic Musgrave and Perlin code (well, slight variation, but not from a performance perspective). It stores the data as a floating-point surface and renders from there. Convenience of programming was always the important part. It's all C/C++ code, compiled with reasonable optimizations. Note that Wilbur always does a 3D noise solution rather than 2D.

    (Assuming x86/x64): On any semi-modern processor, it may be faster to use native-sized variables rather than unsigned characters. Depending on your processor, floating-point multiplies may be faster than integer (but not a lot). Compiling with SSE2 (if available) may aso speed up float-based math a bit. Using OpenMP or other multi-threading library to share the work across all available cores will also help. Truncation float float to integer can eat a lot of time if you do float operations and aren't using SSE2. http://stackoverflow.com/questions/2...odern-hardware has some good discussions on the subject.

    My spiffy new i7-3770 calculates the 2048*1536 image (including generating displaying the lighted image) in under a second. Adjusting for number of cores, processor speed, architecture, and so on suggests that your code is in the ballpark of the Wilbur code speed.

    If you want a less computationally expensive basis function that's reasonable, do an Internet search for "simplex noise".
    Last edited by waldronate; 05-06-2012 at 03:25 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •