Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Jonas Eschenburg, posted on February 01, 2002




Image Description, by Jonas Eschenburg



These are screenshots of a project I've been working on for over two years now. I wanted to learn 3D programming and so I wrote a little 3D engine which I used to create a simple terrain renderer.

The landscape renderer evolved over time and I stuffed it with more and more features. Only recently I began adding game elements like enemies, weapons and sound. These features are still experimental and relatively quick hacks.

The upper picture has a bit of game action in front of a nice panorama view. You can see an enemy flying towards us that has just been hit by a missile.

The lower picture displays the CLOD triangle mesh and the texture tiling.

Terrain renderer features include:
  • Continuous Level of Detail (CLOD) using a binary triangle tree (based on the technique discussed at http://www.longbowdigitalarts.com/seumas/progbintri.html)
  • complete texturing using a combination of unique texturing (one big texture for a terrain patch) and a tile-based approach.
  • recently added: ground fog (used for enhanced visual quality and also speed improvement)
  • Other features include:
  • a skybox for the clouds
  • a Wavefront .obj loader for the models
  • an enemy AI that makes the enemies look almost intelligent ... against rocks
  • a font renderer using font textures made with glfont by Brad Fish
  • The program was developed in C++ under Linux. So far this is the only platform it works on, but porting should be relatively easy since I used only portable libraries:
  • SDL for basic system access and input
  • OpenGL for hardware-accelerated 3D graphics (Direct3D support should also be possible once I have made a Windows port, since I use my own 3D engine)
  • OpenAL for hardware-accelerated 3D sound
  • SigC++ for advanced inter-object communication
  • My ultimate goal is to create a modern version of the 80's classics Carrier Command and Midwinter, featuring enhanced graphics and gameplay. Multiplayer maybe.

    The only problem is that I will never be able to do that alone so I will eventually release the game as Open Source.

    As I haven't made a Windows port until now, only Linux users will be able to try the demo at:
    http://www.student.uni-augsburg.de/~eschenjo/landscape-demo.tar.bz2

    I hope you can get it to run. It depends on OpenGL and SDL 1.2.

    Check it out! And please report any bugs you find. I know there are some.

    Oh yes, as you probably noticed, my project is still lacking a decent name (I called it "landscape" but that doesn't sound very nice...)

    Have fun,
    Jonas Eschenburg


    [prev]
    Image of the Day Gallery
    www.flipcode.com

    [next]

     
    Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
     
    Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
     
    Jonas Eschenburg

    February 02, 2002, 03:25 PM

    Sounds like the texture drawing is a big slowdown.
    I get very high fps rates (~125) when there is no ground visible. Are you sure you get hardware acceleration?

     
    zed zeek

    February 02, 2002, 03:30 PM

    in this case joining up groups of 2 triangles i wouldnt use degenerants i dont think youll be passing less data (perhaps even more)

     
    Jonas Eschenburg

    February 02, 2002, 03:38 PM

    Also, I had quite a lot of trouble finding my opponents. They kept firing at me and I never even saw them. And if you can't see them, you can't hit back :(.

    Then they were behind you :)
    Try selecting one of them (G or T) and pressing F2. Now you look through your enemies eyes.

    You will see how stupid they are. For example you can reduce throttle to zero (0..9 controls throttle, 1 means zero) and wait until they overtake you :)

    Another trick if you can't find you enemy: Your gunsight will only show you enemies with a direct line of sight. So flying high will make them more visible for you.

    Jonas

     
    zed zeek

    February 02, 2002, 03:39 PM

    u can also LOD with brute force methods as well, though theyre not as fine tuned as what it looks like youre using here

    basically degenerants are tris that wont get drawn eg for the following u need 3 tri strips right? wrong u can do it in 1 strip
    ----->
    etc

    ABCDE vertices
    FGHIJ
    KLMNO

    heres the strip
    A,F,B,G,C,H,D,I,E,J,J,J,O,I,N,H,M etc

     
    Louis Howe

    February 02, 2002, 05:44 PM

    Thank you so very much! It makes sense to me. Thanks for your time.

     
    Lourens Veen

    February 03, 2002, 04:07 AM

    Erm, duh! I am actually running 2.4.14 and plan to switch to 2.4.17, rather unfortunate error. Yes, I'm sure I have hardware acceleration, there's no libMesaGL to be found on my system and the GL vendor string is quite sure about it being Radeon VE and hardware accelerated :). When I was still running 2.2 I also had hardware acceleration, so it's possible :).

     
    Lourens Veen

    February 03, 2002, 04:10 AM

    Yep, I'm sure about having hardware acceleration (see my other reply as well). What might be the problem is that the Radeon VE is a Radeon with one texturing unit less; instead of that you get dualhead and TV-Out. So if you draw each polygon six times then I can imagine things slowing down very fast. That's probably the problem then.

     
    disableddan

    February 03, 2002, 04:51 AM

    looks good! nice work!

     
    Jonas Eschenburg

    February 03, 2002, 04:59 AM

    At the moment I don't make use of multitexturing, so multiple texture units won't be used anyway.

    How much memory does your card have?

    It would be interesting to hear wether the framerate is very resolution dependent. Just tweak the parameters Game_xres and Game_yres in bin/landscape-vars, e.g. to 640x480.

    If it's still slow then it is probably the CPU's fault, otherwise it's likely to be a problem with the texture drawing.

    Thanks for your feedback, that's a big help for me!

    Jonas

     
    Lourens Veen

    February 03, 2002, 08:53 AM

    My card has 32MB memory. I'm not sure how X manages it though, I think it configures something like 8MB for textures. I tried running at 640x480. It gives higher framerates whith small amounts of polygons visible (ie when looking straight up to the sky I get about 250fps) but things still grind to a halt when large parts of the landscape slide into view.

    I'm not sure whether the hardware T&L of the Radeon is actually used in the drivers I have now, that could make a differenc. On the other hand, if this doesn't occur on a TNT2 then hardware T&L shouldn't make much of a difference.

    Is there a way to influence or view the polygon count? I'm wondering how the framerate is related to the number of polygons on screen. Perhaps you could make a second counter next to the fps one?

     
    Jonas Eschenburg

    February 03, 2002, 12:24 PM

    The counter is a good idea. I was just too lazy to do that until now.

    I can't think of an easy way to change the polygon count without recompiling (stupid lazy me ... hrmpf)

    Next thing I'll do is probably adding multitexturing. Would you mind me contacting you again?

    Jonas

     
    Lourens Veen

    February 05, 2002, 09:17 AM

    No, not at all. Feel free to mail me.

     
    This thread contains 42 messages.
    First Previous ( To view more messages, select a page: 0 1 ... out of 1) Next Last
     
     
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.