<?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/index.php?action=history&amp;feed=atom&amp;title=Terrain_Splatting</id>
		<title>Terrain Splatting - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://opensimulator.org/index.php?action=history&amp;feed=atom&amp;title=Terrain_Splatting"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Terrain_Splatting&amp;action=history"/>
		<updated>2026-04-09T12:55:13Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.9</generator>

	<entry>
		<id>http://opensimulator.org/index.php?title=Terrain_Splatting&amp;diff=18645&amp;oldid=prev</id>
		<title>Bhardly: Terrain splatting algorithm</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/index.php?title=Terrain_Splatting&amp;diff=18645&amp;oldid=prev"/>
				<updated>2010-08-20T19:57:20Z</updated>
		
		<summary type="html">&lt;p&gt;Terrain splatting algorithm&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&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>