Examples and Interesting Programs for mkheightmap

From Picogen-doc

These are some examples created by seb/phresnel. If you have some funky creations, feel free to post them in a new article, or contact me for assistance (a@b.c, with a="seb", b="picogen", c="org"). Your support is much appreciated!

Contents

Abstract

In this article I will present some interesting hackings in Height-Slang. The program mkheightmap is primarily meant to be a heightmap creation tool, though the creations presented in this article are not necessarily usable as such. Think of this article as a show-off of Jux and mkheightmap.

Note that the results may vary slightly as the images in this article have been made with picogen 0.1, which used another random number generator than newer versions.

This article is based on a transciption of [1].

Programs and Example-Outputs

Edges

code example
(^  (-  1 
        (abs ([2 LayeredNoise 
                 frequency(15) 
                 layercount(8)
                 persistence((* 0.4 (-1 (abs x))))
              ] x y))) 
    3)
"Edges"
"Edges"


Rivers

code example
(-  1 
    (^  (-  1
           (abs ([2 LayeredNoise 
                    frequency(15) 
                    layercount(8) 
                    persistence((* 0.4 (-1 (abs x))))
                 ] x y))) 
        3))
       
"Rivers"
"Rivers"


Interesting

code example
(lerp (sin (* 10 x)) 
      (sin (* 10 y)) 
      (^ (- 1
            (abs ([2 LayeredNoise 
                     frequency(15) 
                     layercount(8) 
                     persistence((* 0.4 (-1 (abs x))))
                  ] x y)))
          3))
       
"Interesting"
"Interesting"


Funky Noise

code example
(? (> 0.1 
      (+ (sin (* 30 x)) 
         (sin (* 30 y))))
   (* 0.2 
      (sin (* y 500)))
   (^ (- 1
         (abs ([2 LayeredNoise 
                  frequency(15) 
                  layercount(8)
                  persistence((* 0.4 (-1 (abs x))))
               ] x y))) 
      3))
       
"Funky-Noise"
"Funky-Noise"


A bit like Marbles

code example
(sin (* 3.141
        (^ (- 1
              (abs ([2 LayeredNoise 
                       frequency(15)
                       layercount(8)
                       persistence((* 0.4 (-1 (abs x))))
                    ] x y)))
           3)))
       
"A bit like Marbles"
"A bit like Marbles"


Sketchy

code example
(sin (* 20 (^ (- 1
                 (abs ([2 LayeredNoise 
                          frequency(15)
                          layercount(8)
                          persistence((* 0.4 (-1 (abs x))))
                       ] x y)))
              3)))
       
"Sketchy"
"Sketchy"


I can no more

code example
(sin (* (/ (* 100 
             ([2 LayeredNoise frequency(10)] x y)) 
          (^ y x))
        (sqrt (+ (^ (- x 0.5) 2)
                (^ (- y 0.5) 2)))))
"I can no more"
"I can no more"


I can no more 2

code example
(sin (* (/ (* (^ (- 1
                    (abs ([2 LayeredNoise 
                             frequency(15) 
                             layercount(8) 
                             persistence((* 0.4 (-1 (abs x))))
                          ] x y)))
                 3)
              (^ (- 1
                    (abs ([2 LayeredNoise
                             frequency(15)
                             layercount(8)
                             persistence((* 0.4 (-1 (abs x))))
                          ] x y))) 
                 3))
           (^ y x))
        (sqrt (+ (^ (- x 0.5) 2) 
                 (^ (- y 0.5) 2)))))
"I can no more 2"
"I can no more 2"


Weird

code example
(sin (* (/ 100 (^ y x))
        (sqrt (+ (^ (- x 0.5) 2)
                 (^ (- y 0.5) 2)))))  
"Weird"
"Weird"


Sin/Cos-Checkers

code example
(+ (sin (* 100 x))
   (cos (* 100 y)))
"Sin/Cos-Checkers"
"Sin/Cos-Checkers"


Another-Checkers

code example
(sqrt (* (sin (* 20 x))
         (cos (* 20 y))))
       
"Another Checkers"
"Another Checkers"


Funky

code example
(sin (* 20
        (sqrt (* (sin (* 20 x))
                 (cos (* 20 y)))))) 
"Funky"
"Funky"


This-shalt-be-a-heightmap?

code example
(sin (* 20
        (sqrt (+ (sin (* 20 x))
                 (cos (* 20 y))))))
        
"This shalt be a heightmap?"
"This shalt be a heightmap?"


Interf-0

code example
(+ (* 2
      (+ (cos (* y x))
         (sin (* x 20)))) 
    (sin (* 200
            (* x y))))
        
"Interf-0"
"Interf-0"


Interf-1

code example
(+ (* 2
      (+ (cos (* y 40))
         (sin (* x 20))))
   (sin (* 200 
           (* x y))))         
"Interf-1"
"Interf-1"


Interf-2

code example
(+ (* 2 
      (* (cos (* y 90)) 
         (sin (* x 30))))
   (sin (* 200 
           (* x y))))
"Interf-2"
"Interf-2"