Skip to main content
GameDev.net gamedev.net
🔒 Locked

Complex texture problem

Started by SoaringTortoise Mar 8, 2003 at 2:01 PM 4 replies 350+ views
Original Post
SoaringTortoise
SoaringTortoise
I am encountering several problems with my terrain engine and would appreciate some help. Any and all pointers are welcomed. I have a height-mapped terrain. I want to texture this in the normal way (grass/rock/etc), but NOT according to the height. Instead, I want to be able to paint the texture onto each terrain quad (as with the Warcraft III editor). This I can currently do with no problem by just having a base texture with multiple edgings, such that when the primary point is painted, all surrounding quads receive an edge texture. In order to allow any texture to be painted over any other texture, my edge textures are alpha-mapped bits that get overlayed on the base texture already existing at that point during a second-texture pass. My problems at the moment are: 1: To get the texture blocks small enough to look cool, the terrain has to be fairly tesselated. With the extra tessellation, I have to drop the maximum view-distance to maintain speed. 2: I can switch the texturing method to use in-block edges (i.e. instead of using a center block with 12 edge pieces, I can create a texture set that contains the requisite 32 edge pieces to cater for all possible edge scenarios... eh, what?). The problem here is that I am currently using a single terrain texture file that is 2048x2048 pixels, split into 16x16 mini-textures, with each row corresponding to a different terrain texture. Each row contains 4 ''alternate'' base textures, plus the 12 requisite edges. If I switch to using in-block edge pieces, I''m going to have to lose terrain texture types because I''ll need to use 3 rows per texture type just to handle the required variations... I can reduce this by using rotation and only keeping 16 edge pieces, so that I only have to use 2 rows. But still, this limits me to 8 terrain textures, which seems quite limited. I have also toyed with keeping the edge masks seperate, but the performance hit is massive because of the texture swapping. 3: How can you get irregular blends other than by tiling? For example, in Unreal Tournament 2003, the outdoor areas (particularly antalus), seems to have very smooth and irregularly blended textures. Is this a case of generating the textures when you compile the map, or just very nifty tiling? 4: If I switch to a generated texture, how on earth do I represent the creation of that in the map editor without turning every map creator into a programmer? OK, that''s quite a chunk. Hope my issues make sense. Hope even more that I''m missing something really obvious. Learning to fly is easy, but as a tortoise, the landings are really rough.
Always prey on the weak, the timid and the stupid. Otherwise you'll just get your butt kicked
For a tortoise, this is extremely hard to do, but when you get it right... the expression on their faces ...
tok_junior
tok_junior
Hm, i wouldn''t really go for your way of texturing...
Try this way: Make one texture that covers the whole map, that contains all the terraintypes and so on. This will be extremely stretched, but with some nice filtering it''ll look pretty ok. Then have a few detail-textures that are tiled over the entire map. These doesn''t actually do anything except add, exactly, detail, like the feeling of gravel and grass, so you don''t need a whole lot of them, and you can just aswell go with only one or 2 for the entire map. Set the first texturestage to the base-texture, and the second to the detail, and let the multitexturing do it''s job. This is afaik what most ppl do. I know i do, and it looks good

--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.
SoaringTortoise
SoaringTortoise
I had it going like that a while back, but I wasn''t able to get serious detail for things like roads, artificial paving or cliff faces :-(

To be clearer, I am using my terrain engine for both outdoor terrain (which your method will do perfectly), as well as cave/dungeon type stuff. My method works perfectly well for both environments, except for the problems above.

Learning to fly is easy, but as a tortoise, the landings are really rough.
Always prey on the weak, the timid and the stupid. Otherwise you'll just get your butt kicked
For a tortoise, this is extremely hard to do, but when you get it right... the expression on their faces ...
tok_junior
tok_junior
Then i strongly recommend you write 2 different renderers. One for use outside, and one for use inside.
For inside use, you would probably be better of modelling the geometry instead of generating it with a heightfield. That way you''d also have total control of the texturing.

--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.
SoaringTortoise
SoaringTortoise
For the kind of interior I''m using, the height-field is quite fine because it models rivers/cave walls etc very nicely. Then, if I really need to get a truly vertical structure going, I just use meshes.

If I was going for a 1st-person shooter kind of thing then I''d definitely re-work the entire project.

Learning to fly is easy, but as a tortoise, the landings are really rough.
Always prey on the weak, the timid and the stupid. Otherwise you'll just get your butt kicked
For a tortoise, this is extremely hard to do, but when you get it right... the expression on their faces ...
tok_junior
tok_junior
Hmm.. Perhaps you could use a stretched base-texture with details, and generate separate detailtextures for the roads and stuff when building the map? You can then draw these in a second pass, using alpha to make the smooth transitions.

--
MFC is sorta like the swedish police... It''''s full of crap, and nothing can communicate with anything else.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.