Hey guys, I am doing some tests and was wondering if anyone has any ideas for how to texture a huge terrain without pixelating.
I have been doing tests with the multi-camera LOD trick (main cam renders the high-res stuff a short distance ahead then a secondary camera renders the low-res stuff beyond that, both cams layered on screen), but I am having a hard time figuring out how to texture this beast and have details like roads, dirt patches, etc. The ideas I have had so far (but they are all hacks) are:
1: Break the terrain up into many (many many) small blocks and have a seperate high-res texture for each cell and use the LOD camera trick to make the actual amount of textures displayed sane and keep the computer from exploding. The problems with this are the time required to do this, and actually painting the textures without tiling, especially for roads, etc.
2: Have a base tiling texture over the whole terrain and somehow (projector?) add textures where needed such as cliffs, mountains, roads, etc. Problems being; hard to get right, limiting, texture transitions would be a real pain, and it may not work in Unity as we don’t really have decals do we?
3: Ask here and hope someone else has an idea.
I am really hoping someone here has better ideas?Unity really needs a proper terrain system IMO.
I’d love to hear other suggestions for this, but IMHO the best way to do terrains is your dreaded #1 solution.
But it’s not about breaking up the terrain into many faces, it’s about breaking the terrain into many UV maps.
A simple example for grass terrain with roads:
Create a tileable grass texture that is seamless in both U and V directions.
2 Create secondary textures for roads and other anomalies such as rocky patches that are maybe only tileable in U or V and that are seamless to your main grass texture in U or V.
Spend the time to properly UV map and assign the different textures to all the faces of your terrain mesh. This is a time consuming process (not only creating all these tileable textures, but UV mapping them to the terrain), but it seems to be the method used by a lot of games.
Ugh…I was afraid of that… UV mapping and Jeremy don’t exactly get along very well yet (wow I refered to myself in the third-person…don’t I feel smart). Also texture transitions would be hard (like road to grass) unless I do multi-layered textures which I assume could get expensive.
I will have to find some resource or book for UV mapping in XSI… I can do basic stuff, but when it comes to subprojections, working with a huge map and such my eyes start to blur and I get dizzy…
Hopefully there is another way to do this (doubt it), but in the mean time I will brush up on my texturing…uh…skills.
No texture layering needed, you just need to get pumped for some serious hours tweaking, clone stamping, blending, offsetting, and color correcting images in Photoshop to work out all these seamless textures.
I can’t think of a single thing I find fun about UV mapping… except for an end result that actually looks good
Doesnt XSI have planar mapping? If so just center the projection on the terrain from above. This takes no time at all and you will have almost perfect uv’s as long as you dont have super steep hills.
As far as texturing goes I think it’s best to use a multilayer system such as this. If you need a shader made I can whip one up if you like, or maybe richard would share his? Either way I dont think that terrains are to daunting. I think there actually really fun to make. I love the poly brush in maya, It lets me paint on the hills, which is so cool.
Oh yeah, XSI has planar mapping. I was just saying that UV mapping generally scares me. I can get a texture mapped to the whole mess, but mapping the detail stuff seems a bit daunting at times as I have no real experience with UV mapping.
Wow, very nice offer thank you. I don’t want anyone to go to any trouble though as I am just doing testing to see how to get a full outdoor scene going (trees, grass the whole works). I will ask richard if he will share his, but I may take you up on your offer later on if it still stands. Thanks a lot.
XSI has paint tools which I will look into more, but that is one area where I think it is pretty clear that Maya wins hands down. XSI’s tools are used mainly for weight maps or Vector art.
It’s actually no trouble at all. I could do it pretty quick and it sounds like you will need it for your testing. Using a multi-texture shader actually doesnt look like it would be to slow at all. Not having to do every layer in a different pass seems to really speeds things up. I will have some extra time tomorrow at school, I have a huge gap in schedule and I will be needing some thing to do. You give the word and I’ll see what I can do.
No problem, I have started to really like this shader stuff. 8) Its very rewarding for some reason. Do you use AIM at all? I would like to chat some time…
Thanks man. I haven’t started with shader programming yet but it seems very exciting.
I don’t use AIM though, I go on the net with my PC as I have issues connecting with my Mac sometimes for some reason, I only have msn and xfire on this machine… Hmm… I don’t like AIM on PC with it’s spyware and such… Any other ways? Would be cool to chat. Or if I can find a hacked version of AIM with spyware removed.
EDIT: man I can’t type tonight…I have had to edit typos on most of my posts tonight
Well it’s not hacked but the best chat app in the world is AdiumX It’s free and super customizable it does aim, icq, yahoo, msn, ect. Which is totally nice since a lot of people use different stuff. Also im sure theres no spyware. But of course theres always iChat… but it’s not my fav. For PC theres middleman and another this other good one ill remember in a sec…
I shall try to get something… Trillian does AIM doesn’t it? In the mean time PM me your name and if all goes well I will talk to ya there…not tonight though, it is 4:45am here
yeah Jeremy, if you get an AIM account let me know too. Sync and I have some fun late nights on chat
I was going to mention Richard’s alpha layering shader, but the thing is with any huge terrain you’re still going to have to tile textures because you just can’t afford to have all these huge textures that cover the entire terrain. There’s just no way around this paradigm of creating tiles that you can replicate throughout you’re environment to create a larger cohesive terrain… at least not until GFX cards have gigabytes of RAM to spare.
Yeah I know I will still have to tile it up, but at least with a shader I don’t have to do as much hand painting for 50+ cells if you know what I mean. I can have a tiling base texture and add detail tile-by-tile as I need it. Not perfect but it helps…well, we will see.
He could get away with a shader like that for most things… He can tile the two coloring textures. The only limitation will be when the mask starts getting so stretched you can see the pixels being blended. But yes for HUGE things he will need tiles of this sorta thing.
How much of a performance hit would it be to have a few of those layers, not just path, but… 3 or 4 layers all masked on top of each other? It looks like it would be dead easy to alter the shader, I suppose I should just try it.
I’m also trying to figure out the method that Warcraft III uses. It’s sort of a complex tiling scheme like in a 2D game, laid down on top of the mesh, but also with several layers. I guess that must mean multi texturing using multiple UV maps in combination with a this layering method to smooth out the transitions between types.
Just to be clear on the method talked about earlier where the mesh is broken up into multiple UV maps (which I don’t actually know how to do in Maya… but I haven’t looked into it either.) You’d have to make a shader with many, many textures, right? Possible 25 or more, right? The shader would have to link them to the correct UV map and you’d probably name each texture something like terrain1-1, terrain1-2, terrain1-3, terrain1-4, terrain1-5, terrain2-1, terrain2-2, etc. Is that the idea?
You actaully cant I guess with unitys current shader compilation scheme you can only have 4 textures per pass max. You could add more layers in other passes but obviously the more passes makes it slower. I dont think it would be to taxing to add another pass. Jeremy also asked this. One thing to remember is we have to make another mask texture every time we want a different tillable one. I can mess around with making another pass if you like.
Actually when you break your mesh up in maya, you will want to break it up in squares each with a different material. Each material has it’s own set of uv’s and once in unity each material section can have a different shader. They dont share shaders.
So lets say he have a 4 tile terrain… What I would do is make a huge 4048x4048 mask once it’s down divide it into quarters so you have 4 peices each peice is for a different tile. Divide your mesh into 4 materials in maya apply those textures. Make the terrain according to how you masked different areas. Then import the entire thing into unity. You will end up with one mesh with 4 materials each with there own masks that wont have seams.