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
19
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 17th Jul 2007 05:31
@Ian T. Well since you are using bryce and this is a terrain thread, I'm just assuming that you are making landscape's also. Anyways, the method that I am using(there is example code a few pages back). I have a pre-made mesh, that is 100x100 units. I just line them up 10 wide and 10 deep. The vertexs match up perfectly, so when I read from the memblock that I load the heightmap into everything is already lined up, so I dont have to mess with the edges of the individual pieces. I just adjust the vertex's Y value to the corresponding heightmap position. Its really simple. Say world size is 1000x1000 and the heightamp is 1000x1000 then its a direct read from the pixel data. Also if the world size is bigger you just change your ratio in the code to adjust. I just keep it all multiples of 10. I end up with a terrain that is basically seamless.

Anyways to anwser you question. I think the problem you are experiencing if that your using meshes that are not identical. for example say you place 2 meshes side by side and mesh 1 has 100 vertexes and mesh 2 has 50 vertexes. The problem is as soon as you change the vertex Y data you can never match them up again. The only real option in a case like this is to make all edges the same Y value and the vertex's that are directly connected to that edge. In this case you would then see a square outline but you would not see the "holes" that would otherwise be there if you have 2 non-conforming meshes side by side.

One other option would be to sacrafice the ability to have 2+ seperate objects and this would solve your problem but then you would have only 1 object. I myself thought about this option also. First you would set up your mesh objects in the desired locations, then you would combine all the objects into one large object save the mesh, then delete all mesh objects, reload your mesh, and then weld all the vertex's together and delete any duplicate vertex's. Then you can safely manipulate your non-conforming mesh object's Y value any way you want, and you will never get a hole.

I hope that does something for you otherwise its still a nice read lol. I'm such a bad speller/grammar person. LOL. At least I think I know what I'm talking about LOL..

Good Luck
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 17th Jul 2007 15:11
Thanks; we seem to have been working on very similar systems. If you developed your entire terrain as one mesh beforehand, that would of course explain why the edges map up. Personally I have not been able to get Bryce meshes to match up on the edges regardless of what I do. However, I'll try just compiling the meshes directly from a height map using a simple grid object, that may work far better. Cheers.
Mobiius
Valued Member
22
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 18th Jul 2007 18:34
@Ian T: If your using heightmaps, just make sire that all the edges of the heightmaps match up. that way the terrains will match up. It took my a while to figure that out. But if your using bryce then it probably wont work the same unless you export the heightmap and import that into AT.

3700+ Athlon 64 - Geforce 7600 Gs - 512MbDDR RAM - 40Gb + 250Gb Hdd - Windows XP (SP2)
Alquerian
19
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 18th Jul 2007 23:38
Quote: "@Ian T: If your using heightmaps, just make sire that all the edges of the heightmaps match up. that way the terrains will match up."


This is almost correct. There are 2 reasons why this doesn't work perfectly, firstly there is a suspected bug in DBP with ATs that may clip one or more pixels from your terrain on certain sides. Secondly, you need to make sure that you have at least 3 pixels of the same height on both images (or the calculations to make 2 terrains of not the same greyscale height) to match them up correctly.

Visit the Wip!
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 19th Jul 2007 17:29
@David_W

I'm actualy going to use a mesh that halfs it's resolution every 64 units. so closest to player is a 64,64 mesh each 1 unit square, arround this is another mesh twice as big as the first with the sections 2 units square and the middle 32x32 sections missing, this is repeated several times to create massive mesh.

Although I've been looking into creating cliffs, I don't think vertical is possible from a height map although, using a procedural terrain generating function, I'm sure I can figure a way of detecting large height diferencies between ajoining points and recursivley generating points between them, this should give almost vertical with nice rounded tops and bottoms.

The above method, however, will probably require me to develop a R.O.A.M. engine, something I think VBP won't be able to do while maintaining high frame rates.

I'm toying with the idea of developing the terrain engine in C++ along with all the procedural noise functions and creating a 'dll' that can be called from DBP...

This command would create the terrain using the specified noise offset to a certain position, this would allow the user to select where on the texture they start.
Make_Terrain obj,detail level,noise type,x_pos,z_pos

This command would keep the terrain centered around the camera and update the procedural heightmap to match.
Move_Terrain obj,Cam_X,Cam_Y,Cam_Z

everything else would be internaly used by the dll.

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 20th Jul 2007 00:35
@Alquerian, Mobiius - Alq's got the right idea about terrains, you have to set a buffer size to make Advanced Terrains match up, and advanced terrain objects don't work well for me anyway, which is why I'm going to all the trouble of stitching them manually. Honestly three pixels' worth, or even two pixels of repeating data is enough to make the seam noticeable when encountered in the game world, and thus unacceptable. Right now I'm just planning on adding per-pixel mesh editing to my world editor, I can take care of the seams manually then. Thanks for your tips, however.
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 20th Jul 2007 17:28
Brainwave number 0x100FF93
don't know why I never thought of doing it this way round before.

Usin a mesh similar to Ian_M's (you know, it's grid is smaller at the viewpoint and gets larger the farther away it gets).
if I increment through all the vertices in this mesh, extracting their X & Z, I can use these to locate a point on the heightmap to set their height. mutch easier than trying to calculate the poition from the number of the vertice.

Who said beer was bad (hic)

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 25th Jul 2007 13:43 Edited at: 30th Jul 2007 13:47
Oooh Progress is soooooooooo sloooooooooow.
Terrain Engines are so damn infuriating. You fix one bit and another bit stops...

I think I've nailed my matrix movement issues.. you can walk forever and never reach the end. (Ok within the limits of a float!)

The demo (exe attached) only uses a 64x64 standard matrix, the full blown app uses a progressive LOD matrix with 20000 polys (think thats the limit) the overal size is 10 times the current view distance (although I quite like the claustophobic eerieness of the demo!). I havn't implemented any shaders yet so the demo uses its test texture that shows the grid.

The new problem is the procedural function. I've modified the scales and it appears some strange artifacts have appeared (I'm testing a standard Perlin2D function) the Full App will use multiple procedural functions (Perlin, RMF, fBM, Hetero etc..) depending on height, slope and view distance.


Enjoy the beginings of an infinite terrain.

Constructive comments welcome...

I'm thinking of starting my own thread for this, to make it easier to post updates and the like.

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
Commander in Chief
19
Years of Service
User Offline
Joined: 15th Apr 2006
Location: Carbondale, PA, USA
Posted: 25th Jul 2007 18:17
Wow, this looks really good, I can't wait for it to get the next update

---PlasmaArts---
www.plasmaarts.co.nr - www.plasmaarts-games.co.nr
Epimetheus
21
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Naples, Florida
Posted: 26th Jul 2007 05:53
Great work Tin Tin!
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 30th Jul 2007 11:58
Thanks Guys, It's currently not quite up to spec yet (I seem to be running in circles fixing bit's)

There are some excelent bit's of info on this forum and some of the others have made excelent progress with their engines.

There now appears to be a problem with the scaling, the height seems to fix on integer values i.e set vertex height 1.2 would result in a vertex with a height of 1. I said appears, I now need to check to make sure.

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Jul 2007 13:18 Edited at: 30th Jul 2007 13:19
Quote: "the height seems to fix on integer values i.e set vertex height 1.2 would result in a vertex with a height of 1."


Yes, that sort of bug is irritating - and very easy to introduce, even with explicit typing. You just have to introduce a spelling error and use copy-and-paste and there you have it, as in the following example:



and "Lo and behold!" camHeight has an integer value.

But I'm sure you know all this. Good luck.
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 30th Jul 2007 13:44
Yeah GG,
I've checked the code for typos (didn't find any)
here is my sample code, the X# and Y# are floats that point to a position on the procedural this is calculated to match the actual grid X,Y (simple and it works ok) but Height# isn't. I think it may be the Abs function thats causing the problem, but I'm not sure.



Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Jul 2007 14:12
Hmm ...

Looks like you need to see exactly what values are being returned by Perlin2D and abs(Perlin2D) - and what values Perlin2D expects to receive.

Have fun.
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 30th Jul 2007 14:25
Doing that now GG (Great Minds eh!!!)

Wondering if it's possible to output this info to a seperate window when in fulscreen exclusive mode?

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
david w
19
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 17th Oct 2007 04:19
I really dont want to revive this thread but. I realize I never posted the completed project. Well here it is. Good luck to anyone who wants to use this. LOL. Its solid but there are a few things I could never get quite right.

@GG if your still interested I would like you to make up another quick shader for me that blends like this one if its possible. I have an idea on how to make objects from meshes, and I think a blending shader will do nicely.

Good luck.
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 18th Oct 2007 13:20 Edited at: 18th Oct 2007 13:25
Welcome back DavidW, What's wrong with reviving this thread,? It's full of useful information on terrain generation.

I downloaded your app but it refuses to work, (even the compiled exe you supplied), I've not spent any time looking into why. I get an error on one of your commands SC_setupObject 222,2,2 on line 96. - could not understand command. Is there a Dll required to run this?

Go Create...

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Oct 2007 13:36
@TinTin

Looks good and works fine, if slowly, on my dinosaur PC.

@david w

Quote: "I would like you to make up another quick shader for me that blends like this one if its possible."


Hmm? You could use the same one of course.

Seriously though, what changes did you have in mind? I seem to be busy with various shader queries at the moment and I'm probably going to start a shader challenges thread where questions like this ought to make good challenges.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th Oct 2007 13:50
Hehe, I'm still using that first colour mask shader you did, albeit expanded to allow 6 textures, but it's working out to be perfect for my needs. I'll have to remember to send you a copy of the terrain editor I'm working on now, direct terrain moulding and painting, should be very nice once it's done - working out a lot like the C&C Generals editor if you've ever seen that.

Anyhoo, will check out Davids new demo later, nice to see people still working on this, I'm only just getting back to it myself.

We're going down... in a spiral to the ground...
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 18th Oct 2007 15:52
LOL @ GG, Is that an Intelisaurus PC. hehe

I'd kill myself if I weren't dead already

Go Create...

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 18th Oct 2007 16:35 Edited at: 18th Oct 2007 16:36
Wow - I'm not alone in the battle for "Pretty" and "Fast" and "Big Terrains" - Great job guys. I'm way behind you guys in some respects - as I haven't broken down to writing my own terrain engine - though it may come to that. Also - I'm using DarkGDK more these days - and it doesn't have "advanced Terrain" persay - so I can't use it like in DBPRO where they are objects and you can move em around - via object position.

My biggest issue - is rather simple - want a Editor/Engine that is WYSIWYG in the dev environment and the game - So if I model a terrain, I just want to be able to load it and it look identical AND have reasonable Frame Rates. (To much to ask I know)

I can ALMOST do this with T.Ed. but for huge terrains, without some sort of poly reduction algorythm, it basically chows FPS if I go more than 64x64 vertice per tile x 9 on my humble vid card. So, if I have a 3x3 tile set, 64x64 vertices - I'm ok - but for huge terrains like I want in Iron Infantry - they are very "triangular".

The link in my sig leads to my Iron Infantry WIP page - and the Gallery currently has landscapes at the top - (Currently working on them) - and it shows T.Ed. Loader implemented - like in the often called "Lava pics" and the night scene - and I'm using DbPro's Advanced Terrain for the other shots. (Like the one with the heli in it near the top of the gallery)

Well - I hope something comes of this thread - because some shots are amazing, and Tin Tins Demo was extremely low poly and Fast. Want to try to get the look I'm after - "Flight Sim sorta in Air" but decent enough for FPS, Tanks, and stuff when on the ground.

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th Oct 2007 17:08 Edited at: 18th Oct 2007 17:11
I honestly don't think GDK users are missing anything regarding the advanced terrain plugin - they might be fairly fast, but they are far too limited, and every AT looks the same!. I think adjusting the vertices in a terrain object is the way to go, along with one of GG's shaders - I mean there's one posted in this thread that automatically textures itself, so steep cliffs get a cliff texture, flat areas get grass texture. One neat bonus with using vertice adjusting is that it's easy to make changes to the terrain, really you'd just have to change the heightmap array and update the terrain, this would be very tricky to replicate with AT.

The shader I'm using references 2 mask images and uses each images RGB colours to decipher which texture to use where, so I'm opting for manually painting the terrain with the textures, along with a shadow layer because black on the mask image is actually black on the terrain, it's a neat little system. But one of the major draws for me in this method is the fact that because my mask resolution is bigger than the heightmap res (heightmap is 512x512, mask is 1024x1024), the shading is actually exagerating the detail of the terrain. Like traditional lighting works on a vertice basis, you can only really blend between the vertices - but the mask shader method affords more detail - 4 times the detail in my case. It'll make all the difference when casting shadows from buildings and adding paths, also you can push performance on these terrains if you can disable DX lighting, last time I checked disabling lighting boosts performance by around 20%.

You should definitely check the shaders posted in this thread, see if you can get them working in DGDK.

We're going down... in a spiral to the ground...
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 18th Oct 2007 18:57 Edited at: 18th Oct 2007 19:05
Some ideas for your terrain generator:

A. Possibly using parabola segments instead of straight edges between vertices - doing that would make a very realistic terrain.

B. Being able to change the X and Z offsets of a vertex as well as Y position. (In the heightmap, maybe use a different color diffuse for each direction)

C. Support for polar coordinates.

D. Being able to apply a different detail map to each tile.

E. Able to apply matrix transformations to vertices.

F. A function for returning the height of the ground at any one X-Z coordinate pair.

G. Ability to store inactive terrains in memory, so that they can be activated quickly.

H. The following commands:

Set current terrain(terrain number)
Set vertex position(TileX,TileZ,X,Y,Z)
Set tile texture(TileX,TileZ,Image Number)
Set matrix curvature(Reimann metric tensor)
Get vertex X position(TileX,TileZ)
Get vertex Y position(TileX,TileZ)
Get vertex Z position(TileX,TileZ)
Randomise Terrain(max,min)


Omit as necessary

I suppose I better explain the set matrix curvature function. A value of 0 creates your heightmap as if projected from a 2D plane (like DB matrices and AT). A value of 1 projects it from a sphere (like a planet) and a value of -1 projects it from a saddle, or 2D hyperbola.

I can't be bothered to invent a signature
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 18th Oct 2007 19:33
@Van B - thanx - grabbed it. Thanx Green Gandalf. Now I have a noob question. How did you make that DDS where you could color RGB "Canvas" and then "Draw" on the Alpha Channel. (I Saw thee dds and how Roads are supposed to work - very cool - want to try to get roads and stuff with this if possible.)

TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 18th Oct 2007 22:42 Edited at: 18th Oct 2007 22:45
Got it working on my home PC

AMD 64 X2 +3800
2gb Ram
Nvidia 7600 GT Pci-e 512mb

That looks nice David, and damn its fast.
It's got lines visible, I guess this is where your segments meet.
Camera clips through the terrain though, should be easy to fix.

Go Create...

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Oct 2007 23:16
@jason p sage

Quote: "Now I have a noob question. How did you make that DDS where you could color RGB "Canvas" and then "Draw" on the Alpha Channel."


Not 100% sure which shader demo you are talking about - I've posted a few on this theme.

Anyway, if I recall correctly, for the single "rgba.dds" image I started by creating two images: one an RGB "Canvas", the other a black and white image for the roads. I then used the DX9 SDK utility "DxTex.exe" to combine the two - just open the rgb image and then open the other image onto the alpha channel of the rgb image (you might need to check that DxTex is using the image format you want). Then save the new image - DxTex.exe automatically saves it as a DDS file. Somewhat roundabout - but simple really.

I think I posted a better "roads" terrain blending shader somewhere on this thread which allows you to use a separate image for the roads.
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 19th Oct 2007 00:46 Edited at: 19th Oct 2007 01:00
Thanx for the info and I'd like to find that road shader!

however - from the concise style you wrote the 3 image one with the alpha "Road" - if that isn't the right one - the code looks easy enough to be my first "Shader" hack where I ALMOST know what'as going on - by adding additional Textures. I'm sure the key to speed with shaders is keeping calcs down and not to to much "logic" - though I'm a noob with shaders for sure.

Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Oct 2007 01:50
Quote: "Thanx for the info and I'd like to find that road shader!"


I think it's the one I posted around 23rd April. It uses 4 textures for the terrain, plus one for the layout of the roads, plus one more for the road texture. It doesn't use the alpha channel and is easier to get working unless you have specialist imaging/painting software.

It's looking more and more as if I need to document all this properly.
david w
19
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 19th Oct 2007 13:15
Wow I am suprised by the amount of posts. Anyways I look forward to seeing any progress on any terrain.

@calcyman I am sure I can do those functions fairly easily. I'll see what I can do this weekend.
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 19th Oct 2007 19:28
Whoa! Your portals.exe looks a lot better than any Advanced Terrain.

I think that in a few weeks AT would be considered as obsolete as DBP matrix terrain!

I can't be bothered to invent a signature
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 19th Oct 2007 20:17
I saw this guys home made terrain generator named "Typhoon" - WOW - not a game engine - just a terrain engine - but WOW.

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Oct 2007 14:27
Hey guys, just thought I'd revive this thread with a screenie of my terrain editor, just love the way the rock at the bottom right looks.

We're going down... in a spiral to the ground...
tatts
19
Years of Service
User Offline
Joined: 13th Jan 2006
Location: Ontario,Canada
Posted: 28th Oct 2007 14:41
now that looks good yeah the rock does look good, really like the sharpness of the pic it's very clear.

WindowsXP/SP2, Pentium 4 2.66 GHz, 1GB DDR Ram, Geforce 6600 256MB
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Oct 2007 14:56
Van B - Is that using the Shader technique?

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Oct 2007 15:08
Yeah that's one of the first shaders GG did, changed so it uses 6 textures over 2 mask textures - but I can actually paint right onto the terrain, it's a really cool editor already . It uses a manual shading system, rather than using DX lighting which is based on vertices, it uses the mask images which are twice the resolution.

Unfortunately each map is 8mb, gonna have to look into some sort of compression technique.

We're going down... in a spiral to the ground...
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 28th Oct 2007 15:29
Is it fast is it fast!???

Ive always looking for terrains wich are fast.. And i havent found none!

Well expect advanced terrain but its bad IMO! It looks always same and is so limited.

[center]
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Oct 2007 15:45 Edited at: 28th Oct 2007 15:56
Haven't done any speed tests with the adjusted shader, but the last test I did was pretty damn fast on my PC, like just 3 textures but a bigger terrain ran at about 1000fps on my PC. There's actually a demo of that posted in this thread somewhere, you should check it out.

I'm using a mesh that is flattened to the heightmap data, it get's repositioned and updated so you don't have to have the whole terrain object, just a reasonable view distance.

EDIT: Just did a static FPS test at 800x600 and it runs at 560fps, but there is quite a bit of optimizing left to do.

We're going down... in a spiral to the ground...
calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 28th Oct 2007 17:25
@Van B - I can't get over how realistic that looks, is that using Green Gandalf's famous texture-blending shader?

All of these different terrain engines look amazing, but in different ways.

I don't suppose any of you have tried integrating the code from each of them to create a hybrid engine? Now that would look impressive!

Your signature has been erased by a hyper-intelligent pan-dimensional being (a mod)
jason p sage
18
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Oct 2007 17:35
Quote: "I don't suppose any of you have tried integrating the code from each of them to create a hybrid engine?"


Speaking for myself - terrains being the topic of the last couple monthes - I can say "Sort of..."

I'm currently taking Visigoth's Basic technique to mesh a USGS (Satellite Hieght info) and turn it into a Global "Database" of various resolution Meshs. We discovered recently that DBO loads more than 10 times faster than Direct.X and making the mesh in memory! Like a 0.08 Load time!

I'm working on making the Meshes reasonably seamless worldwide - and I'm planing on using either Van B's approach (more textures than four per texture if possible) Green Gandalf's various shader solutions - like the one based on height OR like Van B is using a color map - though the height/angle variation might be easier in my situation - as a way to globally texture many meshs - using a limited amount of textures/Shaders variations at one time.

I am convinced for HUGE terrains - mother nature does a better job at drawing - not to mention HUGE terrains mean HUGE amounts of modeling. I'm also convinced that hand rendered stuff - for smaller areas - has limitless possibilities as well

Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 28th Oct 2007 22:01
@Van B

Is there anyway you could post demo of your terrain

Because it looks HOT!

[center]
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Oct 2007 22:09
Yeah, will do that once I've got a whole terrain designed, will be a good excuse for a speed test.

We're going down... in a spiral to the ground...
Oneka
21
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 28th Oct 2007 22:35
Looks very good, do you plan on having support for editing multiple terrains at once?

Also, what happens if the user's computer does not support shading? is there an alternative method used to remedy this?


Making dreams possible, one line at a time...
Roxas
19
Years of Service
User Offline
Joined: 11th Nov 2005
Location: http://forum.thegamecreators.com
Posted: 29th Oct 2007 01:39
Yes i was thinking too about the shaders My comp only supports sm 1.4

[center]
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 29th Oct 2007 10:31
I think the shader can run in non-2.0 cards, never tried it though but I will do, I think I can force it to use the shader 1.0 method.

I think the only thing I could do for non-shader cards is to use vertice colouring to mimic the base colour of each texture type then use a detail texture - wouldn't look too great but at least it would run. Any other method would run like crud on an older card, like using layers of terrain, if your card can't support the shader then there's no chance of it handling multiple terrains.

I'm not quite sure what you mean by multiple terrains Oneka, like this system is using a kinda tablecloth terrain, it gets moved around with the camera and then moulded onto the heightmap, so there's no need for multiple terrains. Currently the heightmap is 512x512, which should be pretty big, big enough for an RTS at least.

We're going down... in a spiral to the ground...
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 30th Oct 2007 11:35
@VanB maybe Oneka means will you be able to edit more than one terrain at a time so...
One 512x512 heightmap for a costal terrain and another 512x512 heightmap for a mountain terrain, in the editor at the same time...
I can only see the benifit of this if you intend stiching these terrains together in some way sort of like a grid of 512x512 terrain patches to give massive terrains.

Who knows... hehe

Go Create...

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Oct 2007 13:00
Ahh, well the terrain moves around to suit the scene, so there's no need for several terrains, plus that would kill the performance - I mean I'm not even sure if you can use that size of terrain as a single limbed object.

I have 2 meshes, one that is fine for RTS games, but also one that's better for first person, hopefully my editor will be good for a few different genre's.

We're going down... in a spiral to the ground...
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 30th Oct 2007 13:23 Edited at: 30th Oct 2007 14:56
My terrain engine (will it ever get finished) has evolved, I now have a base heightmap that gives the general layout of the island the scale is massive, each individual pixel represents 1km^2. The engine then generates a procedural texture from this and neighboring pixel heights to get twice the detail. I repeat this several times till I get a 10x10cm resolution per pixel.
The end result is quite satisfying and the undelying mesh is scrolled with the player, View distance is quite far and detail is high plus there is only a slight delay (hardly noticable) when the procedural edges get redrawn when the player moves a set distance.

I have the Mesh, Player Movement, Procedural update all working at the moment, still trying to get my procedural function to generate suitable terrain results then I'll focus on the shader aspect. I'll probably look into modifying GG's shader to support my requirements.

Here is some code to help explain...

Go Create...

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 30th Oct 2007 14:53
Sounds like a freakin huge terrain system TinTin! - hope you get it finished. Do you have any plans for automated foliage or trees?, I suppose the main drawback with generated terrain is the lack of control.

Never really messed with perlin or fractal terrain much, except for Stoked which is really more like a randomly generated terrain, like it makes a big blob then carves pathways into it. I do plan to have automated starter terrains that can then be edited to suit.

One thing I would suggest is using 2 contrasting grass textures then mixing them up randomly, if you do that then it can really help break up repeating textures. My terrains are mostly grass so I just have a grass texture that is more 'foliagey' and that's got random values all over the terrain. I kinda work with a 56-bit image, shading layer then 6 texture layers, stored as bytes, then I just break that into 2 seperate memblock images. Not sure how you'd do this with GG's automatic texturing shader though.

We're going down... in a spiral to the ground...
TinTin
19
Years of Service
User Offline
Joined: 16th May 2006
Location: BORG Drone Ship - Being Assimilated near Roda Beta (28)
Posted: 30th Oct 2007 15:13 Edited at: 30th Oct 2007 15:22
@VanB, It's Massive, There is plans for foliage & trees etc. using the modified shader, if you remember a while back about modifying the texture depending on hight and angle, I also intend using distance from viewer to create blades of grass etc.. close to the player and just use textures for distant LOD's

I also intend using a texture like my main heightmap to designate areas of forestation, fields, towns, roads etc. Individual colours can be used to place specific models of buildings, large bolders etc...

I've been looking into a materials system to make texturing look more realistic and eliminate the repeat this should automaticaly call the correct shader dependant on view distance.

The lack of control isn't relative, You can generate your own base heightmap however you want it, the engine only uses the procedural function to fill in the finer detail although this could probably be adapted to use a tileable map also, My function changes it's output depending on angle and height of the current areas so you get gentaly undulating hills on the plain and jagged outcrops in the mountains etc..

*note: my previous post example uses 3 matrix to display the terrain and update the individual heightmaps (disabled above) the current engine is using a ROAM mesh that smoothes drastic changes with a more detailed mesh, the procedural function automaticaly fill's the height values of these extra points.

Go Create...

Cyberspace was becoming overcrowded and slummy so I decided to move. These nice chaps gave me a lift.
Green Gandalf
VIP Member
20
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Oct 2007 19:04
Quote: "One thing I would suggest is using 2 contrasting grass textures then mixing them up randomly, if you do that then it can really help break up repeating textures. My terrains are mostly grass so I just have a grass texture that is more 'foliagey' and that's got random values all over the terrain. I kinda work with a 56-bit image, shading layer then 6 texture layers, stored as bytes, then I just break that into 2 seperate memblock images. Not sure how you'd do this with GG's automatic texturing shader though."


You can do that easily using fractal cloud images like the one that I often use as a source of noise in some of my shaders - see attached image. That image consists of three separate black and white fractal cloud images coded in the red, green and blue channels respectively. I often use only the red component. You could try using that to control the blending between up to 6 textures. For example:

1. use the red component to blend between two grass textures;
2. use the green component to blend between two gravel textures;
3. and blue between two rock textures.

You would just need one more image to control the relative amounts of the "red", "green" and "blue" images.

By making the noise image cover a larger area than the base textures you can reduce the repetitive effects of the images.

The attached noise image is seamless so it should be ideal for what you want. If you need a higher resolution one I can create one fairly easily.

And yes, I'm sure it can be done in a shader. However, if it is for a fixed terrain texture it would be more efficient to pre-calculate the blending into a single large image - or at least do some of the blending beforehand. (I vaguely recall one of your demos did something along those lines. )

Login to post a reply

Server time is: 2025-08-09 02:06:20
Your offset time is: 2025-08-09 02:06:20