Terrain detail areas

Blitz3D Forums/Blitz3D Programming/Terrain detail areas

abacadabad(Posted 2003) [#1]
Hi everyone,
Im getting a headache trying to figure out how to apply a texture to a terrain, and then apply a deatil texture on top of that which is only visible in certain areas while still allowing ambient light to cast shadows on the areas not covered by the detail map (sorry about the confusing description! :-p) I have tried using a lightmap, and it works perfectly for allowing the detail texture to be shown in certain places but the areas not covered in deatil texture aren't affected by ambient light. I also tried to set the mask flag and have the main texture (not the deatil one) with black masked areas as to allow the the deatil to show through, but with no effect :-( Any ideas/suggestions would be greatly apprecaited, as its driving me crazy!

Thanks!


Stevie G(Posted 2003) [#2]
Not sure if this'll help but have a look at textureblend command - the add might work for you here.


PaulJG(Posted 2003) [#3]
Here's the 2 methods I was thinking about implicating for my terrain routine.

1.. Fade out the detail texture when you enter a certain area, before reappearing with a new one

2.. Different surfaces, but that means splitting up my terrain.

You can adjust the surface vertex colours to help shade certain areas - much like a lightmap.

Although I've got a good little program that combines a lightmap with a large base texture.. cant remember what its called (installed on my work comp) - if ya want I can find out ?.

I've got my terrain working with just one detail texture and a basic terrainmap underneath - which does make it look good, but like you - I want to have different sections with different textures, so I'll be interested in any advice given by fellow forum members.


abacadabad(Posted 2003) [#4]
Hey thanks for youre replies :-)

Stevie, I tried all the textureblends but anything but multiply means ambient light doesnt affect the other texture :-(

Paul, I ddint think of fading out the texture, ill def inately have a look! Also, would verticie colour work on terrains? I tried it ages ago (perfect for what I want) but ended up writing a more complex way of painting pixels depending on the height of the terrin beneath them. That would be very cool if you could explain how I could colour the vertexes on terrain, thanks again!

:-)


PaulJG(Posted 2003) [#5]
abac.

Righty, here's some info from my experiences:

Spent the last couple of months taking a look at terrains and different methods of creating them.

I wrote my own mesh terrain routine, that would load in the base texture - read through the height (from a lightmap) - combine a lightmap with the current texture.. which got rid of the need for a seperate lightmap/base texture. (which I think is what your doing)

Good points.. you can treat it as a mesh, and paint surfaces/vertexes however ya like.

Bad points.. slower than blitz terrains, more surfaces than you can shake a stick at !.

So.. now I'm back with blitz terrains, suffering with the same problems as you. No way of adding different surfaces or playing with the vertexcolor command :(

(also stuck with a square patches !!)

But I did find this lil program: http://www.delphigl.de/projects/terrtexgen.html

Great program.. a real gem !.

So now I'm looking at how well I can put 2 blitz terrain meshes side-by-side without any gaps.

The next experiement is to have 2 layers of detailed textures that I can fade in and out as you cross over into a new patch.


abacadabad(Posted 2003) [#6]
hey!
I took a look at that prog, it excellent! Unfortunately the fading in and out of detail isnt really suited to what I need (islands with smooth undetailed blues of water flowing into sand and then deatiled grass). Heres a pic of what I have managed to do so far, and Im *really* happy with the result (still got to work on the blue of the deep water, the sky as well) considering this shows about 1/1000 total map size and each map eventually will be created at random with hundreds of individual, random islands -- except, no ambient lighting! (which is crucial for the project). Give us a yell if you want me to send you a zip file of the source code and files :-), and feel free to adapt it/use it and hopefully fix these damn ambient lighting woes!

[img]http://www.imagestation.com/picture/sraid87/p2ae6d3c7e5278c2f8a1e3bef6b61d1a5/faa39bd3.jpg.orig.jpg[/img]


PaulJG(Posted 2003) [#7]
Here's where my proggie is at:



If ya look hard enough at the grass you'll notice the detail texture.. looks good :)

But, like you - I want to use different textures on different places.

Although.. there is another way ;)

Serious Sam uses an overlayer texture to create its detailed texture. So its not actually on the ground.. but on a seperate object just above it !.

I've got an idea about combining robs ideas for realtime shadows with it... have a sort of small object underneath you that moves around with you - following the contour of the landscape.

If you was to put all the detailed tile textures onto one big texture - you could then scroll to the new one when needed.. this should not only work - but also allow the whole terrain to get away with just one layer of texturing. :) should be a hell of a speed up !!.


abacadabad(Posted 2003) [#8]
Hey Paul, taht does look good :-)
Im intrigued how the extra large texture would work, how would you go around doing that. It would be very cool if it was one huge mother texture, becuase you could paint on it in realtime, allowing heaps of cool effects!


PaulJG(Posted 2003) [#9]
I'm using a 1024x1024 texture, I think thats about as big as I can comfortably get without causing too many problems for other cards - thats why I was thinking about joining different terrains.. so I dont have to stretch it anymore, or use a bigger texture size.

My base texture (the first texture) is stretched across the whole terrain.. this is the one with the combined lightmap - so in theory.. YES, you could add things like bomb blasts and skidmarks directly to the texture - although, remember its stretched !.. so its not gonna look as good as it should.

(I think 1 pixel on the actual texture = 4 or 5 pixels on the landscape)

Also I seem to remember the other guys saying something about not all cards support directly writing to the texture. :(