Jump to content

Terrain texture blending


Recommended Posts

Vertex blending is much worse. Think vertex shading vs per-pixel shading. Also since the heightmap and texture max seem to have the same resolution, it would basically have the same affect.

Perhaps for the hieghtmap some sort of "intelligent dithering" stretching algorithm instead of the bilinear/trilinear we have now would look nice. That would do stuff like mini sand dunes and patches of snow automatically.

Link to comment
Share on other sites

Vertex blending is much worse. Think vertex shading vs per-pixel shading. Also since the heightmap and texture max seem to have the same resolution, it would basically have the same affect.

I doubt that. See this page for example before and after shots. The 'before' shot looks essentially identical to our current terrain blending.

Link to comment
Share on other sites

I dunno, unless it's a new technology with an old name, I'm pretty sure of myself. The vertex blending I know is a old technology used extensively in older FPSs for example. It's only as good as the number of vertices you have in your mesh. I think the example you showed just has a lot of vertices. See this old article: http://www.katsbits.com/tutorials/idtech/vertex-texture-blending-applied-to-models.php

Link to comment
Share on other sites

I doubt that. See this page for example before and after shots. The 'before' shot looks essentially identical to our current terrain blending.

I don't know anything about the technical aspects, but just looking at it I don't really see that much difference between the before/after in terms of blending (depending on exactly what is going on there in the middle, it's hard to know whether it's several dirt/grass/grass-mixed-with-dirt textures or just the two grass textures with a dirt texture in between). There is a big difference in the actual textures though, and I wouldn't say it's fair to compare the blending when you're using such different textures :P

What I would think might work best is what I think someone else suggested somewhere: to use different blending textures for different textures, say three different sizes. Or at least create larger blend textures that would make the transition smoother. As far as I can see there are two issues that would need to be thought out by people who know more about the programming for something like that to work:

If we use different sized blend texture, how would it be determined which one to use? It could easily be described in the texture XML which size each individual texture would use, but if you have a transition between say a road texture which would use a sharp transition and a dirt texture that has a smoother. Perhaps it could be dependent on which one is on top (see http://trac.wildfiregames.com/wiki/Atlas_Manual_Terrain_Tab#Texturepriority )?

And is it possible to have transitions which covers more than one tile? (I.e. a blend texture that's larger than one tile.)

Link to comment
Share on other sites

I don't know anything about the technical aspects, but just looking at it I don't really see that much difference between the before/after in terms of blending

Then you need to look closer! :) You can basically trace 'staircases' along some of the transition lines in the first image, while in the second image they are completely smooth and curvy.

The problem with blend textures/masks/maps/whatchamacallit seems to be that there are so many cases to handle.

If we use different sized blend texture, how would it be determined which one to use? It could easily be described in the texture XML which size each individual texture would use, but if you have a transition between say a road texture which would use a sharp transition and a dirt texture that has a smoother. Perhaps it could be dependent on which one is on top (see http://trac.wildfire...Texturepriority )?

I'm not sure, but I think maps do not currently store any such priority/ordering/layering information, though that ultimately may prove a useful path. The feature in Atlas seems more like a 'trick' that gives the map author a way to pick which blending texture is used.

Link to comment
Share on other sites

What if we 1) identified the tiles making up the border between the two differently textured regions, 2) fitted a curve to this border and then 3) applied a blending mask along the curve (sharp mask for "roads", dithered mask for sand, etc.)?

I believe there is already some logic for drawing curves in the engine (used for territory borders).

Link to comment
Share on other sites

Then you need to look closer! :) You can basically trace 'staircases' along some of the transition lines in the first image, while in the second image they are completely smooth and curvy.

The problem with blend textures/masks/maps/whatchamacallit seems to be that there are so many cases to handle.

I'm not sure, but I think maps do not currently store any such priority/ordering/layering information, though that ultimately may prove a useful path. The feature in Atlas seems more like a 'trick' that gives the map author a way to pick which blending texture is used.

Ah, true that problem (which I personally wouldn't call blending as much as smoothing :rolleyes: ) goes away. The trouble with reading things too quickly =) The actual blending (as in transition from the one to the other) between two textures still seems to be the same in the above/below though which obviously was what I was looking at :P
Link to comment
Share on other sites

What about my dithering idea? not to self promote, but I always thought smoothly blended textures looked really bad. Even if the alternative is the wavy artifacts we see here (akin to the line of sight "circle" in aoe II I might add).

In real life, sand turns to grass as patches of grass start to appear more and more, and the soil gains more nutrients. with snow, patches of snow become bigger and bigger until they cover the entire ground. I see no real life inspiration for smooth blends, only granular ones.

Link to comment
Share on other sites

What about my dithering idea? not to self promote, but I always thought smoothly blended textures looked really bad. Even if the alternative is the wavy artifacts we see here (akin to the line of sight "circle" in aoe II I might add).

I didn't quite understand it, to be honest. Perhaps you can elaborate? Personally, I very much dislike the staircase artifacts.

Link to comment
Share on other sites

Here is normal blending versus two types of dithering. (The third, not showed, approach is a clean break in the middle.)

colourconfig2.gif

Now dithering is traditional y used as a way to go from a a smother image to a pelleted one, but perhaps the two steps of stretching the texture map and dithering it could be combined into one "shader" (I'm not sure how/if OpenGL let's one add texture stretching methods).

Link to comment
Share on other sites

Dithering is sort of what the game uses right now, though not completely. The thing is that using 64x64 texture for that, like it does now, is a bit too small for proper blending of some textures (such as sand->grass, wet->dry).

The game actually uses a full square to blend a texture, using on of 16 (I think) textures.

Edited by wraitii
Link to comment
Share on other sites

If having bigger textures would improve the terrain blending, couldn't we have an option to switch between the current textures and the proposed bigger ones? This would only be if higher resolution ground texture would degrade performance at all.

Link to comment
Share on other sites

I think some are talking about increasing the resolution of the blend textures, correct? Not the actual terrain textures. Most of the terrain textures are 512x512 (older biomes) or 1024x1024 (updated biomes). I don't think the game's terrains need to be any higher res than 1024x1024.

These are a sample of the blend textures in the game:

post-130-0-40956800-1341676620.png

post-130-0-89467800-1341676620.png

post-130-0-50430400-1341676621.png

post-130-0-06418900-1341676622.png

Link to comment
Share on other sites

If having bigger textures would improve the terrain blending, couldn't we have an option to switch between the current textures and the proposed bigger ones? This would only be if higher resolution ground texture would degrade performance at all.

It would, but I am unconvinced that it would resolve the staircase artifacts in any way.

Link to comment
Share on other sites

In the current system, here's what you get (the blending texture are the size of a tile):

post-9128-0-39057200-1341676965_thumb.pn

To improve the blending between very different textures, we'd need blending texture that occupy at least 2x2 tiles. They could be placed over a tile and go beyond the size of a tile. I'm not completely sure how to do that, however.

Link to comment
Share on other sites

I think some are talking about increasing the resolution of the blend textures, correct? Not the actual terrain textures. Most of the terrain textures are 512x512 (older biomes) or 1024x1024 (updated biomes). I don't think the game's terrains need to be any higher res than 1024x1024.

These are a sample of the blend textures in the game:

Sorry, that's what I meant.

Link to comment
Share on other sites

To improve the blending between very different textures, we'd need blending texture that occupy at least 2x2 tiles.

I don't think that is the right solution, unless we are talking about different things. What I am talking about are the jagged, zig-zagging artifacts that readily span more than 2x2 tiles:

OaANus.jpg BgjA0s.jpg

Edited by zoot
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...