Home of the Open Toolkit library

This project is a viewer of terrains created by the software "EarthSculptor" using "Terrain Splatting" technique . The rendering uses the brute-force and GLSL shader. The source code is available here.

The first image shows terrain rendering with EarthSculptor,

the following picture shows the same terrain rendered with OpenTK.

I also include the basic code of a circular manipulator for the more restless. This manipulator is operated by the keypad.Perhaps someone in the future implement a terrain editor!Everything is possible.

Hi Miguel !
I try to implement approximately the same thing, without splatting for the moment. I have a question.
I think you use the original heightmap size of 257 pixels ? So, how do you create your terrain grid ? Is it also the same grid resolution (256x256 vertices (257-1)) ? Or do you use a custom resolution and interpolate values between heights ?
It's in case you use a grid of squares obviously ... maybe you use another technique ?

I ask this question because I use the first described technique, and my terrain seems very ... "3d pixelated" (I don't know how to say that)

In sending you the attached PDF I am preparing documentation but I could not finish because of time. It's in Spanish but most importantly you translate and you can see the explanatory drawings.

As you can see in figure 1, for an area of ​​4x4 chunks need bitmap 5x5 pixels. For each pass through the inner loop computes the position of the upper left point of the chunk in the row in question. For the first iteration would be the point 0, followed by the 1, 2, 3, and 4, as shown in the illustration above. For the second iteration would be 5, 6, 7, 8, 9 and so on.

As an optimization triangles are also generated in the inner loop. When constructing the triangles (two per chunk constructed) should avoid this construction triangles for both the last chunk of each row to the last row. The code that does this is if (Contz

Hi Norris
In sending you the attached PDF I am preparing documentation but I could not finish because of time. It's in Spanish but most importantly you translate and you can see the explanatory drawings. <a href="https://sites.google.com/site/bitiopia/Terrain-Heightmap.pdf?attredirects=0&d=1" title="Terrain-pdf-file"></a>
As you can see in figure 1, for an area of ​​4x4 chunks need bitmap 5x5 pixels. For each pass through the inner loop computes the position of the upper left point of the chunk in the row in question. For the first iteration would be the point 0, followed by the 1, 2, 3, and 4, as shown in the illustration above. For the second iteration would be 5, 6, 7, 8, 9 and so on.
As an optimization triangles are also generated in the inner loop. When constructing the triangles (two per chunk constructed) should avoid this construction triangles for both the last chunk of each row to the last row. The code that does this is if (Contz <totalChunksZ && contX <totalChunksX).
For each chunk two triangles are constructed, (i1, i2, i4) y (i2, i3, i4).
To avoid "3d pixelation" try to change the order of the indexes of the triangles for each chunk, for example, for drawing three triangles are created (i1, i2, i4) and (i2, i3, i4), to change indexes are created (i1, i2, i3) and (i3, i4, i1).
Yet I fear that EarthSculptor use any smoothing technique that softens the ground even more.
I hope you serve something ...
regards