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


Submitted by XycsoscyX, posted on December 18, 2004




Image Description, by XycsoscyX



Just for some of the same old stuff, I opted to post new screenshots of my engine. I recently decided to look into deferred lighting, and this is the result. Overall, the performance is about equal to the standard lighting methods (rendering all the geometry per light pass), but it really shines with more light sources at once. I can zoom out of the stage and still get a constant frame rate, even with 17 lights showing at once. The frame rate is fixed (as is the logic/input update steps), I'm using 20 FPS currently because it provides a smooth rate of motion, without missing any user input. I also support a "pluggable" post processing step (though the steps themselves are currently fixed, I simply have to derive a new filter from my base class, and add it to the list manually). Here are some specs:
  • Plugable (insert system here), I use plugins for many things, including input, audio, logic, world data, mesh data, effects, etc.
  • Cross platform compatible base code, currently only supporting Win32, but versatile enough to support other OS's.
  • Plugable rendering system, using Direct3D v9.0 currently, with and OpenGL plugin in the works (it doesn't crash anymore, but still doesn't render anything yet).
  • Uses vertex/pixel programs for rendering, including a custom fragment parser/combiner: I use the parser for the mesh/world plugins, they store a fragment to transform the vertex positions into world space, and to retrieve the texture coordinates, normals, etc. The core engine then uses that base and works from there to perform transformations, per pixel lighting, etc. The only downside is that the transformations get split into two steps, instead of a single transformation. Deferred lighting reduces the waste greatly, by only requiring the geometry to be rendered once, but I am still working on optimizing this (I know I can easly just transform by the final transformation matrix, but it doesn't fit well into my implementation so far).
  • 3D Studio Max export plugins for everything, including static meshes, skinned actors (and animations), and the world data.
  • World data currently supports a portal visibility system, using author defined sectors for the world data.
  • Static meshes are meshes that aren't animated, like crates, chairs, etc.
  • Skinned actors use 3DMax's built in bone system.
  • Almost completely programmed from scratch. All my core libraries, math, file loading, error handling, UI, etc, are programmed by myself. Only a few 3rd party libraries are used currently, DevIL for image loading/saving, ZLib for ZIP archive support, OggVorbis for OGG audio file streaming, and TinyXML for loading UI elements (okay, maybe a handful, not just a few).

  • So far everything is working fine, without falling under my desired frame rate. Next step is the physical aspect, which is why I'm currently trying to implement a 3rd party physics library into my engine. I'm looking into ODE or Tokamak at the moment. I've implemented both before, just with unsatisfactory results, so now I am going to work on fine tuning either to see if I can get it working like I want (or at least close too). I'm also looking into HDR as a post processing effect, just for that added splash.


    [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.
     
    XycsoscyX

    December 19, 2004, 01:39 AM

    Just some updates, I have full screen glare (using a bloom effect) working, and I finally have a physics system implemented (using the Newton SDK). I also have worked a bit more on the audio system, including support for MP3, OGG, WAV, and a few other sound formats (in fact, all formats that the Audiere library can decode), streamed playback of background music, and 2D and 3D sample playback. I have also improved my transparent surface handling (working on reflection/refraction currently), but for now, I blend a lot better than simply adding the transparent surface. Using a MIN pixel operation, it procudes a more "glassy" look to the surface, and is a lot less intense than what is shown in the image (though I still support that for glowing type surfaces).

     
    Revvy

    December 19, 2004, 05:34 AM

    I dislike your unpronounceable name but I like the description. Is there a website anywhere?

     
    RAZORUNREAL

    December 19, 2004, 06:59 AM

    So are you saying you did all that between your image submision and that post? Or was it all mostly done and you just had to get it to work? Because that's not alot of time.

    I'm very interested in an implementation of deferred lighting that's as fast or faster than it's multiple pass equivalent. It's not the sort of lighting I'm hoping to do, but I do think it's a big step in the right direction. It's much more elegant than other ways.

     
    XycsoscyX

    December 20, 2004, 12:54 PM

    Whoa, I didn't really expect replies! =)

    As for a website, sadly no. I used to, but it was just a free site at GeoCities, and they started to really cripple the free sites, and it just wasn't worth the trouble to maintain it. I am looking into it getting it posted somewhere, once again.

    As for getting all the extra stuff working since posting it, yup. Actually, since I submitted it (which was a few days before it was actually posted). The glare, physics, and implementation of Audiere as a audio decoder are all in that time (though my DirectSound audio system was already there, I just added a streamed background music thread).

     
    XycsoscyX

    December 20, 2004, 01:04 PM

    As for the deferred rendering, I get a speed boost for more lights at one time. The problem with deferred lighting is that it becomes fill rate limited, since I am drawing quads for each light. I limit the quads using projected squares for the lights, and using the scissor test with them, and that speeds things up considerably, as long as the lights don't take up the entire screen (as in when you're inside the light area). I can typically render 4 or 5 times more lights at once with deferred lighting than with the multipass system, while still maintaining 20 FPS, but the framerate drops considerably with all large light sources.

    Of course, an easy way to overcome this is to perform as much processing in the geometry pass as possible (which I don't, yet, just for the sake of getting things to work). Also, using as few floating point framebuffer textures as possible is a must (I use 3 currently, color, position, and normal), using fewer of these (or 16bit color componenet textures instead of 32bit), can speed things up a lot too.

    Lastly, my tests are all with a Raedon9600, which more the low end of support for floating point textures and PS2.0 (what is the absolute low end for those things?), but I've still been able to keep 20FPS (my enforced framerate), and that's with lighting (diffuse and specular), physics/collision detection, and multiple full screen post processing effects, all at once (including glare, gamma correction, (sepia tone for the menu), depth of field, etc). The post processing effects also take up a lot of fillrate, especially glare and depth of field, since I'm using multiple samples for the bluring on each, but I'm happy with all the results, so far.

     
    This thread contains 5 messages.
     
     
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.