{"id":61,"date":"2009-06-02T15:15:12","date_gmt":"2009-06-02T21:15:12","guid":{"rendered":"http:\/\/www.ancor.ch\/schoebey\/?p=61"},"modified":"2009-06-02T15:15:18","modified_gmt":"2009-06-02T21:15:18","slug":"make-some-noise","status":"publish","type":"post","link":"https:\/\/www.ancor.ch\/schoebey\/?p=61","title":{"rendered":"make some noise"},"content":{"rendered":"<p>An outline of a simple zoomable heightmap generation algorithm:<\/p>\n<ul>\n<li>create a 256&#215;256 noise map<\/li>\n<li>upon zooming in, create a new one as soon as the zoom factor reaches (1.5 x iteration level)<\/li>\n<li>sample it at the respective coordinates to make it serve as the base for the new texture<\/li>\n<li>use global coordinates (relative to the sphere) to create new texture iteration<\/li>\n<li>iteration++<\/li>\n<li>when zooming further in towards (2x iteration level), blend the new texture over the old one to hide transition artifacts<\/li>\n<li>when zooming out again, blend it out between (2x iteration level) and (1.5x iteration level)<\/li>\n<li>discard the texture upon reaching (1.5x iteration level)<\/li>\n<\/ul>\n<p>using this approach, we will only have 256&#215;256 heightmaps in graphics memory, albeit <em><strong>n<\/strong><\/em> of them.<\/p>\n<p>i.e. if the target planet has a circumference (<em>edge size<\/em>) of \u00c2\u00a040&#8217;000km (earth), and the maximum zoom level would be 1m edge size, we would end up with approx. 25 textures.<\/p>\n<p>One approach would be to only keep the minimum amount of textures (thus limiting the view distance) in memory and discarding the rest, re-rendering them on demand.<\/p>\n<p>The same algorithm can be applied to movement parallel to the ground: if the camera is moved further than (0.25x edge width of current iteration), a new texture at the same iteration level but with new base coordinates is computed and blended over the old one between (0.25x edge width) and (0.33x edge width)<\/p>\n<ul><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>An outline of a simple zoomable heightmap generation algorithm: create a 256&#215;256 noise map upon zooming in, create a new one as soon as the zoom factor reaches (1.5 x iteration level) sample it at the respective coordinates to make it serve as the base for the new texture use global coordinates (relative to the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-code","category-p407"],"_links":{"self":[{"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=61"}],"version-history":[{"count":2,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/posts\/61\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}