Hey Guys!
I've been wandering how games like
Company of Heroes texture their
terrains. In a way that the whole map is not beeing tiled through alphamap, but actually there are
roads, bricks and details more or less unique for the whole map.
I've read about Id Software/Splash Damage Megatexture technique which i find absolutely AWESOME, but it's out of my reach. Most tutorials i came across describe only alphablending method.
One way i was examining is to create separate mesh(quadstripes) for the roads, that is lying on top of the actuall ground. That mesh would have had an applied texture with transparent sides so that it would blend seamlessly with the grass/mudd/sand or whatever lies underneeth.
I really doubt that this is the approach THQ/Relic used to create CoH environments.
If any of You know the way to go, please, advise me.
Cheerio.
Jacek.
Replies
but the real deal are the roads. as they look pretty well composed into the ground. floating props as well?
Instead of vertex color blending, they could be using pretty tiny RGB maps. I think EQ mentioned using something like that on Darkest of Days. Each channel would reveal a specific material. There was a strange restriction too, like you couldn't blend all three together and 2 needed to be fully blended for the 3rd to be revealed?
I whipped this up a long time ago as an example for some stuff we where doing in 3dsmax but it kind of illustrates what I was thinking.
The roads are most certainly floating with edge alpha - they were doing this back in the Command & Conquer: Generals editor, too. CoH is using alpha blending on it though, to make it look more natural (albeit more expensive to render), which makes it harder to tell. Even more modern games like ArmA2 use floating roads like that. On Forza 3 we couldn't do the floating road thing of course. Our edges were blended using a texture blend just like the rest of the terrain.
thanks for the answear though:)
my main concern was about the roads.:)
right now i'm thinking of using polyboosts tool to lay the geometry on top of a surface of a heightmap-generated terrain.
Does that generate mapping coords? I'd suggest using splines, since it generates UV's for you already. Though if you decide to go the polyboost route, Max 2009+ (I *think*. I know 2010 does) has something called spline mapping. If you make a spline down the center of your "road" and apply an unwrap to the mesh, you can pick the spline as a guideline for the UV map - works amazing well for things like that.
when You draw splines on top of a terrain and then using sweep modifier(i don't know how else) create geometry the place where the road sticks to the terrain is in the middle(that's rather obvious), which causes the borders to be sometiems 'burried' in the ground. is there any way to project that missplaced vertives onto the surface? that wouldnt be the case with strip-laying tool. though the automatic mapping coordinates while using spline/sweep may end up to be an unbeatable profit.
Vessago, You've mentioned something about spline guideline for the mapping coordinate of a mesh. i'll have digg into that as it might be an ultimate way to deal with the problem.
Then set the spline to renderable, then setting it to rectangle. Probably apply an edit poly on top and delete the bottom part of the geo so you're left with just a plane.
You can also use a conform compound object but it will smash that object completely flat to the surface. So it works best on flat objects. If you need height afterward you can use the shell modifier.
You could also use a spline painter script to paint a spline on the surface of the terrain, it should follow it along pretty closely. Neil Blevins has a great one in his pack of scripts.
http://www.neilblevins.com/soulburnscripts/soulburnscripts.htm
This is what you'd obviously get from a top down UV map - not what you want for a road texture.
Cut a loop down the center of the road, then create a linear spline from it.
Apply an unwrap modifier, select face mode, then choose the "spline" option. Choose the spline you just created, then choose "planar" from the spline mapping drop down. You can see that this creates a nice linear UV set (though squished, it's ideal for a road). Just scale/adjust from here.
Nice road UVs in less than a minute.
that's nice little trick You've got there
@Vig that's exactly what i've done. correct me if i'm wrong but this way makes the borders of a road go either over the terrain or below it, as only the base spline is tangent to the surface. Vassago's way deals with that as it creates a quatstrip that has vertices touching the surface. plus it has the mapping coordinate fix.
lovely
You should take a look at Cryengine 2 Sandbox editor. You can lay down multiple layers of textures then use the road tool to overlay. That combined with Decals is all you really need.
Megatexture still amazes me though. You get great looking terrains with near 100% unique textures.
isn't the cryengine like... expensive? i mean, it's not free, like UDK
i'm not looking to buy any engines any time soon btw. UDK is free if You use it in non commercial projects. though if You'd plan to sell it, 25% of everything You earn above 5 grand goes to Epic.
Have you looked at world machine/L3DT they can generate blend maps for your terrain.
STALKER has some decent terrains and all thats modeled in maya, then they use vert colours for blending.
There are some pitfalls to poly draw:
- Even with it set to draw on an object it will clip here and there and need tweaking. It might conform a little better in some cases.
- It tends to have a inconsistent width because its based on the angle of the camera to the strip. When the strip doesn't align to the viewport (because its trying to follow the terrain) you get an inconsistent width. These inconsistencies in the road width cause issues when unwrapping to a consistent tile or viewing the road from other angles than the angle it was drawn at.
Extreme example to highlight the problem.
Even when painting in the top viewport you run into hills, valleys lips and over hangs that create problems. Which is the advantage of using poly draw over a spline it conforms, or should. A spline works on a near flat surface just as well...
The advantage of the spline is that it has a consistent width and UV's to match, to start with. You can stretch the mesh a little to force it to conform to the terrain without having to do a lot of tweaking to the UVs.
You can try and hand tweak the UV's and the mesh of a poly drawn strip to be more of a consistent width and hope it tiles well.
I'm not saying don't use poly draw, just watch out for some of the pitfalls and be prepared to tweak the final results with both methods.
They're both good methods and it depends on the game, the terrain and what kind of setup and time you have as to which you deploy so keep them both in your toolbox
[ame]http://www.youtube.com/watch?v=A1ELRWTXQ1g[/ame]
EDIT:
the other way would be to stack every segment on top each other, so that they share the same UV space, but again, doing it manually seems like an awful repetative job.
You could scale the whole thing so one quad fits the 0-1 space and the rest just hangs off and tiles.
Also texTools has a stack function. You could break all the edges, click stack and it should stack them all on top of each other.
Another way you can do it would be to use multiple UVs and textures. So you have a tiled top-down UV texture of just the road, whether it's dirt, concrete or whatever. The next UVs set would be a 1to1 mapped texture that gets multiplied over the top to create the tire marks, wear, edging, etc.
I've tried few different methods, and here are some quick points:
quadstrip from polydraw tools makes the inner edges run under a weird angle:
this doesn't occur when using the spline creation method.
the stacking of every quad on top of one another UV-wise restricts the way Youd have to create a texture. as every tile would have to fit exactly one quad. but in most cases You'd probably want to fit one tile in 3 or more subsequent quads.
i don't know how to break up the UVstrip into 3-quad areas (well again, not manually). so i guess the only way that is left is to fit the first 3 quads and let the rest just hang in space.
PS. dont mind the awful texture, as it's just for testings sake ;]
Or you can use quadstrip, then select the edge ring, and use Connect with the options dialog, it has a squeeze/expand control for controlling the width of the segment.