Terrain Texturing
Ok my question is about different way of texturing a heightmapped terrain. Currently I have a 1024*1024 texture stretched across a 100*100 vertex square mesh.
Each vertex has it''s x and z coordinate on a grid in 1 unit intervals. The y (height) value is loaded from a file. The texture coordinates are evenly distributed across the x and z values by the formula tu = x/width and tv = z/length.
I''m curious about what other ways I should look into texturing the terrain as currently the texture gets stretched when the terrain changes altitude.
Thanks for any ideas on how I should texture or load the terrain.
i cant give you a detailed answer so let me point you in some good directions.
you''ll want to google ''texture splatting'', which is one of the more common implementations.
the one i have in mind is for my vertex format to hold 2 or more texture coords and to iterate thru my vertices, apply a texture based on the Y value, and then select a blending mode based on the average delta between the 8 surrounding vetices Y value and the current vertice Y value. havent implemented it though.
Dredd
________________________________________
"To die with your sword still in its sheath is most regrettable" -- Miyomoto Musashi
you''ll want to google ''texture splatting'', which is one of the more common implementations.
the one i have in mind is for my vertex format to hold 2 or more texture coords and to iterate thru my vertices, apply a texture based on the Y value, and then select a blending mode based on the average delta between the 8 surrounding vetices Y value and the current vertice Y value. havent implemented it though.
Dredd
________________________________________
"To die with your sword still in its sheath is most regrettable" -- Miyomoto Musashi
check this out!
it a very good thread just about everything you want
(might be a good time to point to the search feature)
it a very good thread just about everything you want
(might be a good time to point to the search feature)
thanks for the great thread!!
yeah, I was looking through a search, but i guess i wasn''t looking for the right thing. Thanks.
yeah, I was looking through a search, but i guess i wasn''t looking for the right thing. Thanks.
I mae a method up (I think).
Basically I calcluated a colour for every vertex for every texture in the level.
So basically for every terrain texture (grass, mud, rock, snow) there''s an alpha texture. The alpha texture is the same size as the heightmap. The alpha textures are calculated depending on things like height and gradient.
The clever thing is that if the textures the same size of the terrain, the alpha-texture texture stage uses a magfilter to shae in the gaps, creating a smooth blend.
It works quite well. You can check out the first screenies here
http://uk.geocities.com/oh_so_skillfull/game.htm
The only problem is that for every terrain texture, you need a seperate pass. I''m hoping to cut that down.
The good thing is it cuts down loads on texture memory with the largest textures being the size of your HM.
maybe you followed that, hope so
matt
Basically I calcluated a colour for every vertex for every texture in the level.
So basically for every terrain texture (grass, mud, rock, snow) there''s an alpha texture. The alpha texture is the same size as the heightmap. The alpha textures are calculated depending on things like height and gradient.
The clever thing is that if the textures the same size of the terrain, the alpha-texture texture stage uses a magfilter to shae in the gaps, creating a smooth blend.
It works quite well. You can check out the first screenies here
http://uk.geocities.com/oh_so_skillfull/game.htm
The only problem is that for every terrain texture, you need a seperate pass. I''m hoping to cut that down.
The good thing is it cuts down loads on texture memory with the largest textures being the size of your HM.
maybe you followed that, hope so
matt
You could use a pixel shader to very simply combine the varying texel colours using pre calculated weighting values passed as the color value. It only requires one pass but obviously older hardware will be unable to run it.
http://www26.brinkster.com/potatoesnack/TerrainDemo1.jpg
Theres a very rough example of the kind of effect that can be produced.
[edited by - LowCalorieSoftDrink on November 30, 2003 3:29:51 PM]
http://www26.brinkster.com/potatoesnack/TerrainDemo1.jpg
Theres a very rough example of the kind of effect that can be produced.
[edited by - LowCalorieSoftDrink on November 30, 2003 3:29:51 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement