Game Development Community

Smooth Grass Texture Transitions?

by Michael Stoll · in Torque 3D Professional · 12/30/2012 (1:00 am) · 24 replies

Hey all,

Progress on our game has been going well but we've run into a slight visual hiccup. We have separate textures for 'plains', 'forest', 'town', and 'mountain' so as to distinguish foliage types in addition to just making the map look nice. Unfortunately, our map is very large, and so we can't be very precise with the texturing brush. This is a problem because in the 'plains' texture, grass is plentiful and very thickly placed.

In the towns, however, there is no grass so as to prevent it from showing through the floors of buildings. This creates a very clear-cut line between the two textures, and I was wondering if anyone had any input for ways to solve or alleviate this issue.

Thanks!
Mike
Page «Previous 1 2
#1
12/30/2012 (4:32 am)
Can you post a picture to help see the problem?
#2
12/30/2012 (4:38 am)
http://i.imgur.com/jybNw.jpg

To clarify, the area is surrounded by a grass texture, which I've specified that the foliage should use, so as to prevent grass from showing inside of buildings.

The texture has a smooth transition visually, but functionally the foliage can't tell the difference and it creates a harsh looking edge.
#3
12/30/2012 (6:02 am)
Experiencing this issue with my GroundEmitters aswell.
The issue is that the texturing is done by a vertex color blending, so if you do a raycast down you only get one material, which I believe is the material equal to the color of the closest vertex or the most present texture. Haven't investigated in this further yet but it's definetly something I need to get fixed.
#4
12/30/2012 (6:39 am)
You could define an intermediate texture and a type of ground cover that is less dense and lives on this intermediate texture. Then use the intermediate texture to get proper blending. But yes, it'd be really nice to have a proper/automatic solution to this. This is probably the sort of problem that can be made straight into a GitHub issue!

EDIT: I remember TGE had a method that would return a list of all terrain textures at a point and possibly their blend values. Wonder if this is still present in T3D.
#5
12/30/2012 (6:41 am)
I think I could fix it, if they hadn't removed the getMaterialAlpha function from the TerrainBlock class.
Anyone know how this looked before it was removed?
Seen it referenced a couple of places for example here
#6
12/30/2012 (8:59 am)
@Daniel Buckmaster
I had this idea as well, but unfortunately due to the size of my terrain, this isn't an option. I doubt you can tell from the picture, but all of the 'dirt' in the picture is only 3 polygons! If I were going to use an intermediate texture, it would need to be absolutely massive, which I think would make it look bad in it's own right as well.

@Lukas
If you can figure this out, please let me know. It sounds like fixing this would solve a great deal of both of our problems! I'll keep trying as well to see what I can find.
#7
01/01/2013 (9:38 pm)
Hey all,

I still have yet to find a solution to this problem. I know that it's only really an issue for large maps, but it's still strikingly bad, for visual means. Is there really no easy way to fix this???

Thanks,

Mike
#8
01/02/2013 (7:00 am)
Place the grass-bunches by hand, one by one and you can move them exactly where you want.
But i would find a solution to increase the terrain resolution, terrain blocks scaled that big look ugly anyway.
#9
01/02/2013 (12:38 pm)
@Duion

Is there a way to increase Terrain Block resolution, then? I'm not aware of one besides attempting to stitch together many Terrain Blocks...

Thanks,

Mike
#10
01/04/2013 (4:51 pm)
create a second terrain material, the same as the one for the town, and set it to use the same foliage as the one outside the town but at a lower density, then blend it in with that
#11
01/04/2013 (7:17 pm)
Did some research- you can increase Terrain resolution by exporting heightmaps, doubling their size, reimporting, and halving the 'squaresize' value.

I might do that, if Andy's suggestion doesn't pan out or turns out to be too much effort.

Are there any obvious downsides to having terrain with higher resolution?
#12
01/04/2013 (11:21 pm)
More resource consumption, naturally. If you cut your squaresize in half with a larger heightmap to double your resolution, you just doubled your polycount. Which also can more than double memory consumption.

How big is your terrain, in scale? How big do you need it to be? Sometimes you need to simply cut down on your game's scale unless you want to dig in deep to fix these things. A common mistake people make with terrains is make them far larger then they need to be.

While worlds like in Skyrim are cool and it'd be fun to make such a world of your own, you don't have a drop in the bucket in terms of resources, so don't get hung up on trying to imitate it. Don't be afraid to even give your village its own dedicated terrain, if you can work that. Break it up into small pieces, it'll make your life way easier in terms of creation and much better for performance.
#13
01/05/2013 (12:10 pm)
its not double, its quadruple. if you have say a 1024 heightmap at 1 meter per pixel, and go upto a 2048 at 0.5 meters per pixel, you will have physically the same size terrain, however you will have 4x the polycount not double.
#14
01/05/2013 (1:22 pm)
I have 4 terrains stitched together with default resolution (when I started the terrain a few months ago I didn't know that Heightmaps could be used to increase terrain resolution, so I figured it was hopeless and continued development)

Now, the map is nearly done and has a squaresize of 32.

Now, my question is this: Would increasing resolution have a large enough performance dent so as to make a difference, or could I increase it without much worry?

@Jacob
Thank you for your advice; our game is focused somewhat around seamless exploration of a large map, and gear collection. Navigation is also important. As such, we tried to make the map as large as we could manage without ruining lower end computers, and we think we've done a pretty good job of it. Our friend with a computer that can barely run low-end games can run it 'decently'. So I guess it's pretty OK, performance-wise.

However, not all of the game is complete yet, so knowing exactly how much of a difference HQ terrain will make is important so that we can plan ahead.

Thanks again,
Mike
#15
01/05/2013 (1:24 pm)
@Michael I would say figuring out how to access the alpha of the material is more viable than increasing the terrain density for that sole purpose.

Edit: I'm close to finishing my current project.. After that I might have a look at this again.
#16
02/03/2013 (7:54 am)
We've been brainstorming about this for a long while now, and we still don't have a good solution. Increasing terrain resolution to the point where it looks acceptable kills performance dramatically, and keeping the resolution low makes the grass look awful.

The size of the map is for gameplay purposes, as well, so we can't just make it smaller. Has anyone figured something else out? This is getting to be quite problematic.

Thanks,
Mike
#17
02/03/2013 (8:09 am)
Make pieces of terrain in modeling program where you need big detail and use the torque editor created terrain only for big areas where you don't need big detail.
#18
02/03/2013 (8:11 am)
As much as I wish it were that simple, that really just isn't an option. For starters, the issue is with the textures throughout the entire map, so using that solution would be no different than increasing terrain resolution, which we already threw out the window.

Thank you for your reply, though.
Mike
#19
02/03/2013 (8:21 am)
Ok, make a road texture where you have a transition and then you can paint your transition with the decal road editor.
By the way, didn't the solution with the resized reimported heighmap work?
#20
02/03/2013 (8:33 am)
Thank you for your help, but please read the topic completely. Groundcover grass cannot be placed on roads, and the resized heightmap isn't an option because it causes obscene memory usage.
Page «Previous 1 2