<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://opensimulator.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://opensimulator.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bhardly</id>
		<title>OpenSimulator - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://opensimulator.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Bhardly"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Special:Contributions/Bhardly"/>
		<updated>2026-04-10T10:39:36Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.9</generator>

	<entry>
		<id>http://opensimulator.org/wiki/Terrain_Splatting</id>
		<title>Terrain Splatting</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Terrain_Splatting"/>
				<updated>2010-08-20T19:57:20Z</updated>
		
		<summary type="html">&lt;p&gt;Bhardly: Terrain splatting algorithm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To do the terrain splatting you build an array the size of the heightmap with values [0-3] that map to the four terrain textures. Floating point is used so you can blend between the textures when creating the final output. The array is a combination of the actual height (scaled down to 0-3) and some perlin noise. Heres clean room documentation of the noise generation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vec = global_position * 0.20319f;&lt;br /&gt;
low_freq = perlin_noise2(vec.X * 0.222222, vec.Y * 0.222222) * 6.5;&lt;br /&gt;
high_freq = perlin_turbulence2(vec.X, vec.Y, 2) * 2.25;&lt;br /&gt;
noise = (low_freq + high_freq) * 2;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To build the final values in the array the start height and height range need to be used by bilinearly interpolating between the four corners of each with the current x/y position in the array. It all comes together like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
value = (height + noise - interpolated_start_height) * 4 / interpolated_height_range;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That's all there is to it basically. The rest is an exercise in texture compositing and interpolation.&lt;/div&gt;</summary>
		<author><name>Bhardly</name></author>	</entry>

	</feed>