Best way to make ground
-
- Posts: 6
- Joined: Thu Mar 20, 2008 9:04 am
- Location: Sweden
Best way to make ground
Hi. I'm working on a car game where you drive around in a city (like GTA). I'm wondering which way is the best to create the ground. Using a terrain node with a flat heightmap, a hills plane mesh with no hills or just a very big and very thin box.
/Peter Welzien
If you use a hill plane mesh then consider how many tiles you need in it. You probably only need a very large quad, so 1 tile (though very large quads can be inefficient for rendering, at least on PS3 this is true, i shouldn't think it's limited just to that and probably applies to PC as well).
So i'm not sure what would be best, i suggest you experiment. Try out each of the suggestions you made, though a box probably isn't worthwhile as that's definetly got more polygons in it than you need, so i guess a hill plane mesh with 1 tile is better than the box. So a flat heightmap, a hill plane mesh with a single tile and a hill plane mesh with more tiles. Then see which gives the best framerate.
Also it depends how you want to texture the ground i guess... If you've just got a hill plane mesh with one tile then you can just have a texture on it, un-repeated. So if it's a really big quad you'd probably get a very bad quality result as the texture would be stretched over it all. If you have multiple tiles then you can repeat the same texture which would give you a better quality result.
So i'm not sure what would be best, i suggest you experiment. Try out each of the suggestions you made, though a box probably isn't worthwhile as that's definetly got more polygons in it than you need, so i guess a hill plane mesh with 1 tile is better than the box. So a flat heightmap, a hill plane mesh with a single tile and a hill plane mesh with more tiles. Then see which gives the best framerate.
Also it depends how you want to texture the ground i guess... If you've just got a hill plane mesh with one tile then you can just have a texture on it, un-repeated. So if it's a really big quad you'd probably get a very bad quality result as the texture would be stretched over it all. If you have multiple tiles then you can repeat the same texture which would give you a better quality result.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
You can also repeat the texture on a 1-tile hillplane. Simply change the texture coords or use the texture matrix. 1 tile will result in very bad shading, though, and a strong seam in the middle where the two triangles meet. However, driving around on a flat plane is also not so interesting, so you might want hills?
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
If you really want to emulate GTA, then I wouldn't bother with a hill plane.
I'd just use the same geometry for the ground and buildings, as you'll want to drive on top of buildings and bridges in exactly the same way as you drive on the ground.
For anything remotely similar to GTA, I'd go with a 3d party physics engine.
I'd just use the same geometry for the ground and buildings, as you'll want to drive on top of buildings and bridges in exactly the same way as you drive on the ground.
For anything remotely similar to GTA, I'd go with a 3d party physics engine.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
-
- Posts: 6
- Joined: Thu Mar 20, 2008 9:04 am
- Location: Sweden
I'm a newbie as far as 3D-programming is concerned. I don't really know what you mean by "same geometry". Should I have the ground and all the buildings in one large model? At the moment every building is a different model and I use IrrEdit to place them on the ground and then I just load the scene.rogerborg wrote:I'd just use the same geometry for the ground and buildings, as you'll want to drive on top of buildings and bridges in exactly the same way as you drive on the ground.
For anything remotely similar to GTA, I'd go with a 3d party physics engine.
As far as physics engines goes, I'm looking at Newton and True Axis at the moment. They both have a vehicle model. But I haven't had the time to do a thorough comparison of the both and decide on which to use.
/Peter Welzien
-
- Posts: 6
- Joined: Thu Mar 20, 2008 9:04 am
- Location: Sweden
I've made a simple scene in IrrEdit, consisting of a terrain node, a mesh and two lights. It looks ok in IrrEdit, but when I load the scene in my program I don't get any shading.
How it looks in IrrEdit:
How it looks in my program:
I set up the device with the following code:
And load the scene with smgr->loadScene(filename);
What am i missing?
How it looks in IrrEdit:
How it looks in my program:
I set up the device with the following code:
Code: Select all
SIrrlichtCreationParameters params = SIrrlichtCreationParameters();
params.DriverType = video::EDT_OPENGL;
params.WindowSize = irr::core::dimension2di(1024, 768);
params.Bits = 16;
params.Stencilbuffer = true;
params.Fullscreen = false;
params.Vsync = true;
params.EventReceiver = this;
device=createDeviceEx(params);
driver=device->getVideoDriver();
smgr=device->getSceneManager();
What am i missing?
/Peter Welzien
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
I guess that light attenuation and other things are not stored into the .irr file. Hence, the light is not properly set up in Irrlicht. Try to add a 3d vector attribute to your light nodes in the .irr file named 'Attenuation', with values (0,1/radius, 0). This should restore the old Irrlicht 1.3 values for attenuation.
-
- Posts: 6
- Joined: Thu Mar 20, 2008 9:04 am
- Location: Sweden
This is probably what everybody tells you but something similar to GTA is veery hard to do if you're new to this. But if you think its mor fun to learn this stuff while aiming at a very big goal then by all means go for it. Just be prepared that you might not reach it.
There is some projects scattered around this forums that you might look at. I was really overwhelmed when i started with 3d so just stay on track and be prepared that every little thing takes some getting used to:)
Erik
There is some projects scattered around this forums that you might look at. I was really overwhelmed when i started with 3d so just stay on track and be prepared that every little thing takes some getting used to:)
Erik
-
- Posts: 6
- Joined: Thu Mar 20, 2008 9:04 am
- Location: Sweden
I've never done any 3D-programming before. Mostly I do this because I think it's fun to learn new things. My intention is not to make a new GTA. I just want to make a small town (just roads and few houses) and a car that I can controll. This will let me learn about both 3D and physics.
When/if I get this working, I might continue and add computer controlled cars or movable objects that you can hit (dustbins, street lights, fences, etc.). And from there maybe continue with more advanced lighting (street lights, car lights, etc.) and shadows.
When/if I get this working, I might continue and add computer controlled cars or movable objects that you can hit (dustbins, street lights, fences, etc.). And from there maybe continue with more advanced lighting (street lights, car lights, etc.) and shadows.
/Peter Welzien