Page 1 of 1

Defensive structure stretching

Posted: 09 Nov 2010, 20:12
by Per
While Berg is working on adding proper foundations to current models (stretched dynamically to fit terrain), I am working on tweaking the code that is doing the stretching.

The current code produces results like this:
wz2100-20101109_185116-Sk-Rush.jpg
It looks at the corners of the building's tile to find the height of the structure, then pulls the vertices below zero height in the model down to match the terrain.

I changed it so that it tries to find its new height based on the points where the model would intersect with the ground, instead of looking at the tile's corners. For smaller models, this seems to give a clear improvement on uneven terrain:
wz2100-20101109_185204-Sk-Rush.jpg
Next up is to try to figure out a better way to stretch. Currently models are neatly adapted to the terrain geometry underneath, which produces uneven stretching in the model. Like this:
wz2100-20101109_184754-Sk-Rush.jpg
I tried instead to pull every vertex below zero height down to the same common denominator, to make the stretching even:
wz2100-20101109_184637-Sk-Rush.jpg
However, as you can see, the result is somewhat ambiguous. While the stretching is cleaner, the transition-to-ground part of the texture is now mostly underground, causing an abrupt and bad looking transition.

If you have some suggestions on how to improve this, please speak out :geek:

Re: Defensive structure stretching

Posted: 09 Nov 2010, 23:11
by macuser
maybe you could have it stretch the model "from the waist down" ?

Re: Defensive structure stretching

Posted: 09 Nov 2010, 23:26
by Per
macuser wrote:maybe you could have it stretch the model "from the waist down" ?
I am not sure what you mean, but it sounds like what Berg is working on. As I tried to explain above, only vertices below zero height in the model are stretched, so if you put a separate set of "foundation" vertices just below zero, that will expand into a foundation.

Re: Defensive structure stretching

Posted: 10 Nov 2010, 00:00
by effigy
Is this an improvement to the current way, or an alternate to what Berg is working on?

Re: Defensive structure stretching

Posted: 10 Nov 2010, 00:20
by Mysteryem
I think that I personally prefer the the second change. In a perfect world I would have it so that where the polygons intersect with the terrain, the bottom of them will gain part of the texture of the ground they're on to make them blend in. Even without something like that I still prefer the second change.

effigy, sort of both I guess, Berg is using the current system to change how it was originally intentioned while per is coming up with new systems to deal with the problem.

Re: Defensive structure stretching

Posted: 10 Nov 2010, 09:04
by Per
Me and Berg are not creating different solutions for this issue. They are complementary approaches.

Re: Defensive structure stretching

Posted: 10 Nov 2010, 14:19
by Rman Virgil
Per wrote:Me and Berg are not creating different solutions for this issue. They are complementary approaches.
That is how I understood it from the get-go because it made inherent sense. :geek:

- Synergistically, Rman :ninja:

.

Re: Defensive structure stretching

Posted: 10 Nov 2010, 16:12
by effigy
Is that to say that in the future the improved stretching will be applied to Berg's foundations, not the tower (etc) textures?