View unanswered posts | View active topics It is currently Sun Sep 05, 2010 9:41 pm



This section is under re-development. It is not finished, and not fully functional. The current development stage is pre-alpha and as such, not every feature is even implemented yet.




Options



rss Planet-Black0ps
rss Diagmato
rss Development



Users



Total entries:
Total comments:

Terrain Texturing

Diagmato, Development
Mon Oct 13, 2008 1:40 am
Improved: 3rd October 2008

Previously, terrain was textured by applying a tiny texture to each square created by a series of 4 vertexes in a triangle strip. This was improved so that a larger texture is tiled across the terrain as a whole, in that we calculate each vertex's texture coord as such:

vertex[x][z].s = x * (textureTileCount / terrainWidth);
vertex[x][z].t = z * (textureTileCount / terrainLength);

We only need to calculate the bracketed equation once, so it was placed outside the loop for generating the coords, and its value assigned to a variable. No point in the computer doing the same homework twice, aye? :)

To test this, I adjusted the tileCount. The results were successful – a tileCount of 1 ended up with extremely thick grass, a tileCount of 20 ended up with much thinner grass (the texture was a rather detailed grass texture).

Here it is in action:


(Before)


(After)


Proposed Improvements
-Multitexturing for added detail (DONE)
-Normal-oriented texturing (for cliff faces, etc)
-Lighting support




Multitexturing

The next improvement for this concept was with multitexturing support - getting surfaces below the water level to show a muddy texture as opposed to a grass texture. This came somewhat close, but there was no grass texture. What I tried was to only render the coords for the second texture (the mud) and not the grass. This caused anything above the water level to have a seriously stretched version of the mud texture.

The solution I believe is to plot out the textures as usual, but adjust their blending, so that the mud texture shows through the grass texture.

What I have left this concept with (for now) is a terrain that is blending between rather clean looking grass, and mud, as seen in the below screenshot (going forward in time a little here):



cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.