Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Ultimate Terrain/Landscapes

Author
Message
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 24th Feb 2007 04:12
I am going to attempt to make a terrain system that makes up for what Advanced Terrain is lacking. I already have experience making a terrain system. I have a thread on here for that if you would like to look at it.

I have ideas of how to make a terrain system that above and beyond what AT currently is. I dont know all the issues that everyone here has with AT. But I would like to start this project out gathering information as to the limitations/problems as well as what AT does right(benefits).

So far what I am going to make includes.

1. scaling.
2. multiple detail maps. lake beds will have one detail map, Mountian tops will have yet another. (these detail maps will blend into one another smoothly, no abrupt changes)
3. fast culling.
4. texture splating.
5. ability to use seperate shaders on seperate areas.
6. real time land deformations (bomb explodes the terrain gets a crater).

If anyone would like to post any ideas of what I should include please feel free to post. Also any ideas of how to achieve this would be welcome, I am open to any ideas.

This project isnt going to be done instantly, but when it is finished I am going to post all the media/source, so that anyone can adapt it to their projects.

The way I figure it is we dont have super mega-budgets, so we all should help each other out as much as we can. And this is kinda like my way to contribute.

Thank you.
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 24th Feb 2007 05:00
Real-time hardware and shader lighting is a must have.

I have no signature...
Braude Interactive
17
Years of Service
User Offline
Joined: 1st Aug 2006
Location: Sheffield, UK
Posted: 25th Feb 2007 17:47
sounds great! Also some of the ease of use of matrices would be a bonus, ie. A well explained way of manipulating the terrain. Something like, set terrain height num,x,z,height.


Are you gonna do it as a dll, or will it write over existing terrain objects?

Also, if you do it as a dll, can we please use the terrain objects as an object! Not as some other wierd entity! I would really like to be able to use object commands on the terrain!
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 1st Mar 2007 21:28
Progress so far are, build terrain from a heightmap, for some reason I am having difficulties changing the vertex diffuse's. I am doing this terrain system different from my last one, for some reason I could easily change the diffuse settings, but for some reason its being stubborn now.

I'll post a demo when I get the vertex diffuse setting correct. Also the next step is to get multiple detail maps implemented, based on the height of the polys.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 2nd Mar 2007 01:20
Well I got it working now, I here is a screenshot of the terrain in action.

1. applied one detail map so far.

2. Shader lighting + normal mapping of the detail layer.

3. vertex coloring.

More to come later. I have to figure out the rest now, such as smooth transitions from one detail layer to the next,(mountain's will have one detail map, roads will have another detail map.

Thank you.

Attachments

Login to view attachments
TinTin
18
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 2nd Mar 2007 01:40
Your engine looks preaty cool at the moment, although the landscape looks unrealistic.

There is an excelent book 'Texturing & Modeling a procedural approach' by Ebeert, Musgrave, Peachey, Perlin & Worley that has some superb suggestions on how to generate ultra realistic landscapes using noise functions. There is also a section on creating LOD landscapes so that the area around the player has higher detail that areas farther away.

Also try applying higher detailed textures close to the player or even a grass effect for the floor.

It's only the things you don't need that are readily available.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 2nd Mar 2007 04:13
@tin tin, thank you I will definatly look for that book and anything I can find out about terrain. The colormap isnt that great, but its all for test/development purposes.

Major breakthrough. I now got the terrain split up into 100 different sections. So now I can show/hide, and dbp auto culling will take care of the sections that are out of sight. Massive fps boots. Also I can additinaly apply a diffenet detail map/shader to each chunk now.

Attached is a pick of the terrain split up with just diffuse based coloring.

Attachments

Login to view attachments
AtomR
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Portugal
Posted: 2nd Mar 2007 11:28
GIEF Terrain System with multiple detail map.

Good job so far.. i'll definatelly be waiting for this one.

Why can we see the tile splits? Did u do it deliberately just for the purpose of showing it tiled or is it something u still need to work out?

Altho i'm not a fan of LOD terrain feature i admit it's an awesome feature to keep up the FPS so if u can implement it, it'd be great.

Keep up the good work m8.

Take care
AtomR
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd Mar 2007 12:01 Edited at: 2nd Mar 2007 12:04
Green Gandalf made an excellent terrain texture blender, you should definately check it out...

http://forum.thegamecreators.com/?m=forum_view&t=97827&b=1

It uses a colour mask image, and each element (red, green, blue) represents a texture.


Good guy, Good guy, Wan...
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 2nd Mar 2007 12:08
@atom R. I deliberately posted a pic with the tile splits so that people can see it.

@van b. Thank you for the link, I will definatly check this out.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 3rd Mar 2007 05:25
here is an update. New screenshot

Got culling working now + shader lighting + detail bump mapping + image blending

Attachments

Login to view attachments
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 3rd Mar 2007 05:41
David w, I recommend you convert your code in the form of a plugin for better use.

Im working on a C++/DBP Wrapper to allow you to use your DarkBASIC Professional commands in DarkBASIC Professional. It should be ready soon.

Looking forward to this.

Cheers,

-db


Enter my forums here.
Epimetheus
20
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Naples, Florida
Posted: 3rd Mar 2007 05:56
Excellent work!

I look forward to this project's completion.
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 3rd Mar 2007 06:06
Quote: "
4. texture splating.
5. ability to use seperate shaders on seperate areas.
"


How do you hope to do these? because last time I checked when creating a memblock terrain you can only have 2 textures, and you cannot use multiple shaders on the same limb, and having the shader effect change over to the next limb would look pretty ugly. Also meshes created via memblocks cannot have welded/shared vertecie can they? because if they don't it will run alot slower than a mesh that does.

max ballwinkle
17
Years of Service
User Offline
Joined: 27th Nov 2006
Location: in a pineapple under the sea
Posted: 3rd Mar 2007 10:37
wicked sick ....i could use some of that for my box


B-A-L-L-W-I-N-K-L-E
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 4th Mar 2007 03:14
@dark coder, Just have faith that I know what I am doing and that I have a plan to get it all done. I wouldnt put that in my post if I didnt think I could find a way to do it.

Thank you.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 4th Mar 2007 10:55
Quote: "because last time I checked when creating a memblock terrain you can only have 2 textures"
You can add as many stages up to 8 as you like. Just change the fvf format accordingly and setup your shaders to use the proper stages.

Quote: "you cannot use multiple shaders on the same limb"

While this is true, you can run more than one technique in a shader. So you can have one shader do different things on the same limb.

Quote: "Also meshes created via memblocks cannot have welded/shared vertecie can they? because if they don't it will run alot slower than a mesh that does."
While this is true, he can save the model file in a format which does use indexing (such as .x) and when it is reloaded it will run faster.

Nothing he has said is too far fetched in DBP, It will just take some time and effort. I similar plans for my level editor when I get to it.

david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 4th Mar 2007 11:24
@lost in thought. That is exactly what I am doing, saving it as a .x file. I plan on making a shader that does, up to 5 stages, no big deal. I'm already further along with this than I was on my old terrain system and I dont have nearly as much time into this as I did the last one. But then again I know alot more about how it all works.

This is already more advanced anys, cause 1. I can use a shader now, 2. It culls itself, 3. The polygon count is half, 4. The colormap appears more detailed now.

Thank you.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 5th Mar 2007 05:46
here is a test file for ya'll to try out. let me know what you think, and the fps please.

thank you.

Attachments

Login to view attachments
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 5th Mar 2007 05:58
Quote: "You can add as many stages up to 8 as you like. Just change the fvf format accordingly and setup your shaders to use the proper stages."

Isn't multitexturing supposed to be possible without the use of shaders?

Tempest (DBP/DBCe)
Multisync V1 (DBP/DBCe)
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 5th Mar 2007 09:12 Edited at: 5th Mar 2007 09:29
Quote: "Isn't multitexturing supposed to be possible without the use of shaders?"


In DBP ... not without using the blending commands and etc. However they are limited to only 1 texture index per stage for the entire model (the entire object had to be textured with 1 image and you can only use 1 image for the other stage as well). DirectX gives you access to every surface of the model's blending, but DBP does not. Shaders can use the image data from each individual surface and allows multiple blending types per shader, so it is very much more flexible. You can also set different shaders to seperate limbs of an object, or the same shader with different settings. You cannot use the DBP commands per limb ... which also sucks.

[edit] Also that code runs from 30-45fps here. Seems like the culling could be a little better, what are you using now?

[edit2] Also just noticed that you aren't using culling in the shader 0_o Adding cullmode = CCW; to the end of the technique of my terrain and blending shaders almost doubled the fps in most cases. It can actually slow the shader doen if the majority of the poly's are going to be drawn, but this is hardly ever the case with terrains unless you are flying overhead.

TinTin
18
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 5th Mar 2007 10:50
A little bit off topic but the more I visit these pages the more I find people commenting on how limited the DBP environment is or the fact that it dosn't support whats regarded as basic commands or the ones that it does support dont work as expected. There are some exceptional coders out there, contributing like David W here, improvements to the system, It would be nice if TGC would take note and fix the problems with DBP before everyone decides to develop their own version of the language.

It's only the things you don't need that are readily available.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 6th Mar 2007 02:18 Edited at: 6th Mar 2007 02:19
Just posting a quick screen. I just got gg's terrain blender working on this terrain system.. Van B. beat me to it on his. LOL.... Anyways, it supports 3 layers, I am going to add support for 2 more so thats count it 5 layers. When I finish that I am going to add normal mapping support. This project is coming along great. The only thing though is Van B. is giving me some good competition now. lol.....

Attachments

Login to view attachments
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 6th Mar 2007 06:48
That looks excellent!

I have no signature...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Mar 2007 12:49
Quote: "That looks excellent!"


Indeed!

Looks like the "competition" is hotting up nicely.

Quote: "I am going to add support for 2 more so thats count it 5 layers"


Hope you show us the code.
Sixty Squares
17
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 6th Mar 2007 12:54 Edited at: 6th Mar 2007 13:08
Looks beautiful! I can't wait until its done

TinTin
18
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 6th Mar 2007 15:45
Yeah David, that looks lots more realistic.

Here's another idea for you, pre-calculate the following for each surface poly. A) the height above sea level. B) the angle from horizontal.

Then use the result to look up a 2D Array for a texture.

Anything steeper than 50degrees cant be grass, anything above 1000m is snow covered, Sea level depending on angle can be Cliff, Rock or Sand etc



Lookng forward to the next installment...

It's only the things you don't need that are readily available.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Mar 2007 16:43
Quote: "Then use the result to look up a 2D Array for a texture."


Excellent idea.

Quote: "Lookng forward to the next installment..."


Me too.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 7th Mar 2007 05:08
gg = green gandalf

I didnt really do to much today other than optimize the code. I got 100 more fps and double the poly count. So I suppose thats a good thing. NO MORE JAGGED EDGES (unless the incline is to steep). Also switched from writing to the screen to writing directly to memblocks for faster load and vertex manipulation times. Load time is not cut in half. About 7-9 seconds on my machine. If I cut the poly count in half its about 4-5 seconds. Added a more accurate ground height function. Made a function to automatically generate a rgb map. (though it is still best to generate it and then doctor it up in a paint program). I tried to get per-pixel lighting working by modifying gg's shader but no luck. I am successful with normal mapping though. I could probably get the lighting working the way I got the normal mapping working. But its kinda a work-around so I dont like it, so unless gg can add lighting to his shader then I will have to do it that way.

Anyways I'm done ranting on. Here is a couple pics.

Attachments

Login to view attachments
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 7th Mar 2007 05:10
And another one.

Attachments

Login to view attachments
Johaness
17
Years of Service
User Offline
Joined: 20th Sep 2006
Location:
Posted: 7th Mar 2007 08:00
That is so sweet!!
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Mar 2007 12:19
Quote: "I could probably get the lighting working the way I got the normal mapping working. But its kinda a work-around so I dont like it, so unless gg can add lighting to his shader then I will have to do it that way."


Should be fairly straightforward to include both lighting and normal mapping with the blending.

I'll have a look sometime this week, possibly this evening - but it might save time (and prevent me going off at a tangent) if you posted the shader code you've already written. It might just need a simple fix.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 7th Mar 2007 13:39
That'd be great GG, maybe we should make a new thread about this, so we can all impart advice - I'd love to see normal mapping on this though, even it it is just based on the source textures luminance.


Good guy, Good guy, Wan...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Mar 2007 20:53
@Van B

Quote: "maybe we should make a new thread about this"


Good idea. Perhaps you could set it up with a title something like "Terrain Showcase and Tutorials" and kick it off with some of your screenshots plus a few related links? The rest of us can then join in with our offerings.


Quote: "I'd love to see normal mapping on this though, even it it is just based on the source textures luminance"


This has been on my "to do" list for some time. My initial "spec" would be the following:

1. Three detail maps.
2. Three corresponding normal maps.
3. One rgb blend map.
4. Altitude and gradient modifiers (see TinTin's post).
5. One directional light.
6. Ambient light.
7. Specular lighting.
8. Specular map?

Anything else?

I would test it on an Advanced Terrain object initially but it would be helpful to have other terrain objects for testing too. Any offers?
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 7th Mar 2007 21:29 Edited at: 8th Mar 2007 00:12
@Van B. I am fine with starting a new thread. I would like to compare notes with Van b. to see what steps he is taking to get his terrain up and running. Are you generating your terrians using memblocks, or AT. or some other method. What size textures do you find best, frame rate, load times. Thank kinda stuff, unless you dont want to give away any secrets, then thats fine also. I am willing to tell you exactly how I am doing it, then perhaps we can combine what your doing and what I am doing and get the best results. a.k.a. fastest load times, best frame rates etc....

@GG I already deleted my sad attempt to modify your shader. so I dont have it anymore. Just modify the one you currently have and everything should be fine. I think the best bet here is a fast efficent shader, that is not bogged down with alot of stuff. Its already fast, but I dont want to see to much of an impact on performance just so it can have some extra features. That being said, I think at a minimum, it should include normal + lighting. Which is pretty much everything from your list lol. I saw your fog shader, also, what would it take to make that be compatable with this? Is that even possible? Anways, perhaps we can have 2 shaders 1 with fog and 1 without fog. That way it will still be supported if we want to use it.



Well thank you.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Mar 2007 22:43
@david w

I'm working on a version now. It won't include fog.

The problem with my fog shader is that it uses set camera to image which may slow things down too much. However, once I've got the rest working I'll have another look at it - there might be a simpler way of doing things that I've overlooked.

It would be nice to have that fog effect as well though ...

Don't worry about the prototype - I'll just use one of my own terrains to get things started.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Mar 2007 01:03
I'll make a new thread tomorrow. I can provide DBO's and DDS mask files, I have my test generating these for faster loading (created internally with memblocks and simple dot'ing for the masks). I'll look into making a little test, so people can mess around with this stuff. My current world is huge, so I'll make a fresh little one that won't take all day to load . I think this technique will easily kick advanced terrains ass, more people should be adopting it, let's show them how terrains can look in DBPro.


Good guy, Good guy, Wan...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Mar 2007 01:30
Quote: "I think this technique will easily kick advanced terrains ass"


You may well be right. My first attempt at getting all this to work on AT is not working as it should.

Looking forward to doing more testing - with different objects/terrains tomorrow.

Just looked at the time. "Tomorrow" is "today" already! Must go.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 8th Mar 2007 01:59 Edited at: 8th Mar 2007 02:32
I think you all are right. Lets show people how to make a real terrain.

@Van b. I dont know exactly how large you world is, but mine is very large. 10,000 x 10,000. After tweaking my code today. I have successfully gotten the load time down to 2.5-3.5 seconds on my pc I ran from a hard disk and a flash drive. On my laptop I get 2.6-3.3 seconds (flash drive). That is loading all media, assembling and changing the verts, texturing + shading + sky and water. I made a timer to tell me how long it took me to load my level. I get around 300 fps desktop, 60 fps laptop.

@gg. I have abandoned A.T. completely. Shaders dont work quite right with it. If you can get it to work on a simple plain/cube then it will work with my terrain object. Good luck.

BTW.

my system specs desktop are athlon 64 x2 3800 2.00, 1.5gb ram, ati 1950 512mb. windows xp.

my system specs laptop are turon 64 x2 1.56, 2bg ram, nivida 6150 64mb(max is 322 shared). windows vista.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 8th Mar 2007 02:56
here is a taste of what this is all about.

tell me what your results are on your pc.

if your load time says 3433 then that means 3.433 seconds and so on and so forth

thank you

Attachments

Login to view attachments
Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 8th Mar 2007 04:02 Edited at: 8th Mar 2007 04:04
david - My load time was 1.728, this is on my laptop, I will give er a go on my desktop later.

The laptop specs are:
AMD Turion64 Mobile 2.2Ghz
ATI Radion XPress 200M 128MB
512MB RAM

I am working on a similar project and I would like to share thoughts with you guys. I use yahoo for mail and my hotmail address for IM. I am online most of the time so add me if you are interested.

Quit planning to make a game and make a game.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 8th Mar 2007 04:10
what was your frame rate?
Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 8th Mar 2007 05:15
I was getting a pretty steady 75 FPS

Quit planning to make a game and make a game.
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 8th Mar 2007 06:06 Edited at: 8th Mar 2007 06:07
I ran it and I got anywhere from 150 fps to about 75 fps.
Your culling seems to work really well, because as I approached big hills that covered the screen (and surrounding terrain) my FPS rose.

load time was just over 6 seconds, but I think I had some downloads going and an AIM window or 2.

My specs:

AMD Athlon 64 3200+
Geforce 6800GT 256MB
1.5 GB RAM

I have no signature...
sigi
20
Years of Service
User Offline
Joined: 17th Sep 2003
Location:
Posted: 8th Mar 2007 07:35
load time: 5050
fps: 265

AMD Athlon64 X2 4600 / 2 GH Ram / Geforce 6800 Ultra / WinXP Home SP2 / DX 9.c
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Mar 2007 11:42
Brilliant demo.

On my ageing and crumbling system I got:

load time 4386
fps 18-27

Looking at that landscape I'm not convinced that bump-mapping will add very much - standard per-pixel lighting might be sufficient (and certainly much less of a strain on resources).

My attempt at including bump-mapping with the blending using A.T. has temporarily stalled. Shaders can be used with A.T. but some extra fiddling about is usually necessary. If you're using standard objects with limbs then there should not be a problem.

My present implementation uses altitude and gradient (as suggested by someone a few posts back) to control the blending of four textures (grass, sand, gravel and rock). This has the advantage that you should not get those obvious changes of texture at fixed altitudes (I realise you can change that in the rgb map anyway - I was trying to reduce the texture count). The downside is that you can't directly choose the texture for a particular region. None of this is set in stone though and as soon as I get an acceptable version running I'll post the code.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 8th Mar 2007 11:47
It if auto-textures that is perfectly acceptable. I mean the best thing to do is just supply the textures and then let it do its thing. We could always have 2 versions or the shader. 1 that lets you manually texture, I could include the height to rgb function that Im using with it. And 1 that will auto texture for you. I also have an Idea of how we can add at least 1 more texture layer. What About loading a fourth texture, and then when the shader encounter black then it will blend that texture? Just a thought. Thank you.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Mar 2007 12:13
That could easily be applied to the shader as is I think - like set the output colour to a base texture, then black will represent that texture - personally I'd rather save that for shadow casting and fake lighting .

Remember that if your using limbs, or multiple objects - you can choose your own textures, replace ones that are not needed. For example, a sand texture might only really be needed near the water, so if a terrain has no water, then it can substitute sand for something else, like snow - you tend not to see sand and snow together, but - sand, grass, rock go together like grass, rock, and snow - all using the same shader and even possibly the same mask, just different textures to suit. I just don't think the performance hit of adding more layers is worth loosing the ability to render shadows on the terrain, really this depends on your terrain makeup though, for mine, having unique textures is no big deal because each terrain is a seperate object.

Ahh, incidently, when I said 2048x2048, I meant 2048x2048 tiles - a tile being about a square metre on my scale, it takes several minutes to get from one end to another - so its 204800 x 204800. I'm using a very basic culling system that just checks around the camera location and creates or loads the terrain when needed. I'll check your demo tonight, be interesting to see how different it is for performance compared to mine.


Good guy, Good guy, Wan...
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Mar 2007 12:13
Yes, it auto-textures.

OK, the shader IS working - it was A.T. that was the problem.

However, the auto-texturing is not very exciting and needs more thought if it's going to be acceptable. I think I still need the rgb map for the main blending and just use the altitude/gradient idea as a refinement. But the basic idea of combining normal mapping and blending is working and I'm currently using 8 textures and achieving an fps of about 20 (i.e. much higher on all your systems).

Can't test it properly till I have a suitable terrain object to play with. I'll rummage around and see what I can find.

However, must get on with something else now.
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Mar 2007 18:22
1.547 seconds to load, 120fps average.

I think that the memblock terrain method affects culling, like it won't cull a memblock object like it would a loaded object - that's why I'm gonna look into spitting out .X files instead, as I think these would have better culling, and better performance too as vertices can be shared properly. It would be tricky to make a .X exporter that works from a memblock, because of the shared vertices, but with a heightmap that shouldn't be a problem. When I get this working I'll post a snippet, it might save a few valuable frames.

Looking forward to seeing the new shader GG, sounds like you got it nailed. If time is a factor maybe you could post the code for us eager terrain terrorists, I plan to make a demo (with code) tomorrow so I could incorporate your changes and save you a job if you'd like. Maybe this is something that should feature in the next newsletter, like the 3 of us contributing to an article on how to get decent terrains with these techniques, the 3 of us could easily over-power Batvink .


Good guy, Good guy, Wan...

Login to post a reply

Server time is: 2024-05-17 06:36:28
Your offset time is: 2024-05-17 06:36:28