#### Archived

This topic is now archived and is closed to further replies.

# Semi-constant-texel size terrain texturing

This topic is 5476 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Alright, I''m doing heightmaps in my latest game, and I have these texture tiles (grass, stone, etc). The catch, you ask? I''d like to make the all of the texels on the terrain as close to the same size as possible. In other words: I''m interested in the textures not stretching out on sharp hills (or near-cliffs). I can''t really figure out how to handle it (preferably automatically). Anyone have any ideas? Thanks, Josh

##### Share on other sites
Planar mapping is relatively easy; but to the best of my knowledge, getting planar-mapped textures to line up at the edges of non-coplanar faces is impossible with unit texturing. The problem is somewhat easy if the rotation between each given pair of triangles is in exactly one axis; map by the axis. But it won''t work for any interesting terrain.

##### Share on other sites
volumetric textures are your friend. i dont know if there are any realtime algos for it though...

##### Share on other sites
quote:
Original post by Drilian
Alright, I''m doing heightmaps in my latest game, and I have these texture tiles (grass, stone, etc). The catch, you ask?

I''d like to make the all of the texels on the terrain as close to the same size as possible.

In other words: I''m interested in the textures not stretching out on sharp hills (or near-cliffs).

I can''t really figure out how to handle it (preferably automatically). Anyone have any ideas?

Ahhh yes, i came across this same problem when texturing my heightmapped terrain. One idea I thought of was instead of setting the u and v texture coordinates to be equal to the x and y values of each vertex, to instead set the u and v value to be equal to the length along each line divided by the total length along that axis.

That kinda might not makes sense but I''ll try to draw an example here. This is a side perspective of the x axis.

old way:

_/\_ _ _._ _ _ _

the u value would equal 6 / 10 = 0.6

new way:

_/\_ _ _._ _ _ _

because you have to count the distance of going up and down the new u value would 6.828427125 / 10.82842712 = 0.630601937

from another point:
old way:

_/.\_ _ _ _ _ _ _

the u value would equal 2 / 10 = 0.2

new way:

_/.\_ _ _ _ _ _ _

the u value would equal 2.414213562 / 10.82842712 = 0.222951453

Your texture will still get stretched, but I beleive this will even out the stretching of the texture so that it is not focused on cliffs and steep hills.

Hope this helps.

##### Share on other sites
Hmm...That sounds like it's worth looking into! I like it. The only thing is that textures might get skewed a bit.

But it's certainly loads better than anything that I've come up with thus far

Thanks! I think I'll run with that.

Also, volumetric textures would be nice, if they didn't take up so much memory. Sadly, they're not really much of an option. Thanks, though.

[edited by - Drilian on December 15, 2003 6:26:52 PM]

##### Share on other sites
No need for 3D textures (that''s unrealistic today). Anisotropic filtering is more your friend here I think. Like mimapping but separate u and v sizes, memory =base texture *4 instead of base texture*133%.

##### Share on other sites
I don''t see how Anisotropic filtering will help with making the texel size contant?

Isn''t Anisotropic filtering just for determining which texels to use on a poly that is close to parallel with the view direction?

1. 1
2. 2
3. 3
Rutin
16
4. 4
5. 5

• 12
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633723
• Total Posts
3013545
×