Just a few work-in-progress shots of the game I’m working on:
Those shots were taken just before my recent upgrade, so that would be running on a GeForce 4 MX 440. I’ve just grabbed a Radeon 9550 so I’m spending time updating a lot of the code to take advantage of some new features.
Very nice terrain-renderer!
The real headache begins when you start adding thousands of trees :-*
I started adding in more and more AI units and saw the framerate drop lower and lower…
Thanks for the comments though. I’ll post some more pics when I’ve got some better features working.
great work, looks brilliant, just a question are you using JOGL, LWJGL, JAVA 3D or something else?
Dare I mention GL4Java? Turns out the new Radeon I have has REAL trouble using the GLEventListener - it can’t use SetDCPixelFormat correctly! So, as part of my upgrade, I’m porting the whole bundle to JOGL.
The terrain looks really nice
[img*]http://vault101.co.uk/mace/20040511b.jpg[/img*]
Are those very far away bits part of the terrain or part of the skybox?
Those far away hills really are far away hills. The skybox doesn’t have any terrain in the textures. I’m satisfied with the skybox for now, until I want to add in effects such as moving clouds. I hear that’s easier to do using a skydome.
well, if you are going not going to to put building and whatnot that will interfer with the line of sight between the player and the skydome, then they will notice you are using a skydome and your just rotating it around
For a skybox, all you really need to do is modify the top of the skybox because, if you implemented the skybox right, the user should never reach the front/right/back/left of the skybox. I think thats what they did for Hitman (the first one), but thats just me making observations…
DP
Very, very nice. I’m impressed. First thing I must ask is how big is you sky texture. coz it looks big, detailed.
I’m using skybox that is positioned around camera coordinates every frame, so that player couldn’t possibly reach it.
Secondly, how much texture units do you use? How much detail textures for terrain?
Hmm, view distance is pretty big if that hills in the distance are real terrain. In my project I’m not letting to draw anything that is 100 openGL units far away, how about you?
hvor2, the skybox is made up of 5 textures, each 512 x 512 in size. As far as I can make out, that’ll take up about 3.75 MB on the graphics card. If I need to, I’ll reduce this to 256 x 256, taking up a total of 940 KB.
Every skybox (in an FPS) should be drawn at the current camera position, and I draw this one tight against the camera. The downside is I can’t get fog to be applied to the texture, but that’s ok if the textures are created correctly.
The terrain screenshots are from when I had the GeForce 4 Ti 4200. There are 2 detail textures in the terrain in those shots, but I’m going over the terrain code again because it wasn’t efficient enough. It was split up into ‘chunks’ and had a simple level-of-detail algorithm, but it can be written to run a lot faster!
Wow, that looks absolutely amazing. Hopefully one day I will understand OpenGL enough to create something so pretty.
Peter, I saw your image on the IOTD. I don’t have to mention how good it looks or how I am impressed, don’t I ;)?
You mentioned that
... In this test there are over a thousand of each tree, plant and grassy clump. (over 3,000 foliage objects)
The cost of drawing all the foliage (in terms of frames per second) is really minimal...
- What are numbers (fps) and on what machine?
- I presume that you have some nice LOD system and that you write only sprites for distant trees, grass, plants etc?
- Also, in your world there are 3000 foliage objects, but you certainly have frustum culling so you draw some 500 of them each frame? Multyplied by some 30 polys for each tree, 2-3 for plant is around 20,000 polys without LOD, and I dont know, maybe 4-5,000 with LOD?
- Am I right or you have some other magical rendering tricks?
Thanks for your comments Hvor!
I checked out your Monstrumo site (as both our efforts are of the ‘first-person hack/slash’ variety) and it looks like you’re strides ahead at the moment in terms of NPCs (models and anims) and general gameplay. I’ve been focussed on the terrain for a good while now and although I’ve got physics and AI in the works, it’s not all rolled together yet.
So, to the questions:
There are a number of different techniques in use here and I’m working on pushing the terrain through at even faster speeds right now. On a 2.4Ghz PC with a Radeon 9550 (256Mb) it was running about 20fps for the screenie.
I’m using a semi-developed CLOD system (chunked LOD I believe) and the far plane is pushed way out for that screen shot.
Doing some tests, sending all the verts to the card for the whole terrain one by one at every frame drops the rate to about 2 fps (to be expected) wrapping the entire terrain with no LOD in a single display list draws about 20fps (no foliage) which is equally shocking.
I’ve done some tests (screenshots soon) using a mixture of quadtree-type implementation with CLOD and the terrain alone draws at around 100 fps.
Well I haven’t sat and done the maths yet but yes the foliage objects are removed using frustum culling and on average about 10% of the total foliage in the map is drawn at any one time. I should really sit and calculate this stuff soon but my first goal was get it running at a ‘kind-of-playable’ speed and then worry about performance later.
As I’ve hinted above, you’re nearly there but there are some funky tricks in the works that I’ll be boasting about soon!
Oh and all the foliage ? Currently loading one of each model onto the graphics card in a display list and then calling the display list multiple times for each bit that needs drawn. You lose a tiny bit doing all those translates, but gain a HUGE amount by having the calls preloaded on the card.
Yes, it seems that you efforts in terrain rendering are on good path. As you noticed, after I implemented simple terrain rendering, I went to draw and animate models, to round up all aspects of game into some gameplay, to add sounds and so on… So my terrain is basics, really. Currently foliage is rendered with display lists (grass) or glDrawArrays (trees). On my machine (2.0Ghz Radeon 7500) it runs with ~30 FPS, without terrain ~50 FPS.
Terrain is triangle strips, and it is 128 x 128 vertices. Every 2 vertices i test to frustum culling and to distance from camera. It is still less costly with all that calculations then to draw whole terrain (drops to ~18 FPS). I intend to do larger terrains, so I am seriously inversigating methods of LOD for terrain rendering.
I’ve done some tests (screenshots soon) using a mixture of quadtree-type implementation with CLOD and the terrain alone draws at around 100 fps.
That sounds great!
So you are doing display lists, too? I will soon try to render distant trees like sprites (1 polly), with 2-3 distance based LOD models each tree (10 - 50 - 500 polys) and see what is performance boost…
Cheers!
Seeing as how there’s some interest in the terrain and foliage in this game, I’ve posted a few new screenshots and a movie here:
http://vault101.co.uk/screenshots/
Hvor, framerate is now up to 60fps with over 9,200 foliage objects in the world (avg 400 drawn per frame)
Pete
Nice screenies and movies It’s looking very good. When do we get to play it?
Thanks! I’m hoping to get a huge test going at the start of January amongst friends : LAN + pizza + multiplayer test.
After that all going well there’ll be some kind of simple ‘hack-em-up’ level available for download. No promises though. Like most on this forum (from what I can tell) I code this when I have time.
It looks very promising! I really want to try it.
You build your trees in your code or made them in some modeling tool (which format?) By the look of them, they are code- made. When I make some models in milkshape3d and load them into game, all over graphics impression was much much better.
And I am impressed with sun effect.
So your terrain is made of chunks, how many and what size are they?
—> Like most on this forum (from what I can tell) I code this when I have time.
You are right about that
Good luck, keep us posted, and yes, your web page look great too!