0
\$\begingroup\$

Here's the scenario:

I procedurally generate terrain on the fly, creating an isosurface which is an overlay on top of a scalar field of data points. These underlying data points are basically voxel data, and I use the Marching Cubes algorithm to interpolate vertices, which are used to create the triangles for the meshes.

What I end up with is a contiguous terrain, which is split into chunks, with each chunk split into "blocks". Each block's outline, when looking from directly above, is a square, made up of up to 5 triangles.

The underlying mesh data (vertices, indices, texture coords, normals), are calculated for each "block", and then a mesh is built for each "chunk" (collection of blocks' data). Texture coords are determined for each triangle, and as such, you can see separate texture mappings for each triangle when looking at the textured mesh.

At a minimum, I would like to figure out how to apply the textures to each block as a whole, i.e.- stretch it over all the triangles in a block.

Better yet, I would like to implement something like texture-splatting on arbitrary regions of the terrain, spanning accross chunk and block boundaries, so that I can arbitrarily paint different textures where every I want them.

Ideally, I would like to do the splatting I mentioned procedurally, so that aspects of the terrain, (altitude, proximity), will determine what texture is used in what location.

Can someone clue me in to what is involved in achieving this? I am using Ardor3D (Java) for mesh creation/texturing/etc...

\$\endgroup\$
  • 1
    \$\begingroup\$ Maybe Triplanar texture mapping would be useful for you. See e.g. memoirsofatexel.blogspot.fi/2010/08/… or Google for more. \$\endgroup\$ – msell Nov 21 '13 at 6:14
  • \$\begingroup\$ Thanks, but that does not fit my problem, as I am not using heightmap terrain or planar texture mapping. Great article though. \$\endgroup\$ – MukRaker Nov 21 '13 at 18:17
  • \$\begingroup\$ Actually, it might help after all. \$\endgroup\$ – MukRaker Nov 21 '13 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.