Results 1 to 10 of 16

Thread: Jengine - OpenGL 3.3/4.x engine & JUI progress

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524

    Jengine - OpenGL 3.3/4.x engine & JUI progress

    Hi All,

    I've been out of the general loop for quite some time due to personal reasons but I thought I'd give you a little snapshot of the framework/engine (call it what you will) that I've been working on.

    "Jengine" (oh how creative) is a fully OpenGL 3.3/4.x 'core' targeted code base that is basically a mash-up of concepts I like from various engines / 3D applications.

    So there's no immediate mode people; say goodbye to GLBegin, it's the end for GLEnd, no more ancient fixed function pipeline.

    Everything from the UI (JUI for those of you who remember) down to the 3D rendering code is all shader based, utilizing the core profiles of GL3.3/4.x only.

    There's no GL2.x/ES code paths for simple reasons : I am but one man. I don't have the time to back-port techniques in the time-frame I'm working to. Plus many techniques including various culling operations are all GPU bound and would require pretty much implementing from scratch all the old CPU methods for such things and finally, I got a new capable graphics card and I do this for my own enjoyment

    Ok, here's a screenie of the basic interface, with Terrain, Sky and Camera nodes slapped into the scene-graph :

    J - Raster.jpg

    The 'Sky' node is capable of various techniques including sky-boxes, domes as well as approximate atmospheric scattering for planetary atmospheres. (still deciding on features here, not sure if I want the engine to render from outer-space so this may be replaced entirely)

    The 'Terrain' node is still under development but here you can see a displacement map loaded (height-field) along with textures. Will also supports normal-maps and light-maps in release, but still deciding upon lighting systems to use for the terrain. Anyway, it can page in tiled terrain of theoretically infinite size, what you see here is actually a 32768 x 32768 tiled terrain made up of a single channel 32bit floating point displacment map (for 'Y' resolution) along with a lower resolution tiled diffuse map.

    Oh and it uses the latest techniques for tesselation added in GL4.0. Based upon various Nvidia white-papers on the subject, here's a better view of it in operation :

    J - Tess Wire.jpg

    In the case of GL 3.3, "Jengine" currently just uses a lower resolution mesh than is produced by the tessellation which matches the GL 4.0 performance on my system.

    If I end up implementing a classic LOD scheme then I'm not sure what to go for yet.

    I'd make the engine exclusively GL4.x but it's pretty much only the tesselation I'm using so far and it seems a shame to cut out so many 3.3 cards just for that.

    Anyway, there's tons of other stuff that I won't go into detail about just yet that include : MRT deferred render, full GPU skinning (skeletal animation), Variance Shadow Maps, Physics intergration (currently using newton) as well as all the sandwich fillings like a streaming virtual file system, networking (*anything* in the engine can be serialized) font sub-system, compositing manager for future effects, OpenAL and Path-finding / Steering algorithms (I've ported+improved open-steer) to mention a few.

    ---

    JUI (the windowing interface) has come along in leaps and bounds. Everything or nothing about it can be threaded, it has loads more widgets and also makes use of an FBO rendering mode that in turn allows for full compositing aka compiz on posix systems.

    Utilizing FBO's and minimizing re-draws solves many problems, but that's another story

    Hope you're all well!

    Johnny
    Last edited by phibermon; 13-06-2011 at 12:58 PM.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  2. #2
    Those are very exciting developments. Since I have not much time to develop my engine, I might aswell give this one a try when it's more or less finished.

    Is it easy to set up and tear down the framework? Would like to see some code examples that show how everything fits together.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  3. #3
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Yes, quite a lot of the engine can be used stand-alone with minimum dependencies, here's some various snippets so you can see the coding style :

    Window Initialization

    WindowMan := TJWindowMan.Create(JDefaultWindowMan);
    WindowStartupProperties := JDefaultWindow;
    WindowStartupProperties.FullScreen := false;
    WindowStartupProperties.GLMajorVersion := 4;
    WindowStartupProperties.GLMinorVersion := 1;
    WindowStartupProperties.GLCoreProfile := true;
    WindowStartupProperties.GLForwardCompatible := false;

    WindowStartupProperties.OnCreate := @OnWindowCreate;
    WindowStartupProperties.OnDestroy := @OnWindowDestroy;
    WindowStartupProperties.OnExecute := @OnWindowExecute;
    WindowStartupProperties.Threaded := false;
    JWindow := Windowman.Createwindow(WindowStartupProperties);

    Scene & JUI Initialization

    Scene := TJScene.create(JWindow.ImageMan,JWindow.ShaderMan, JWindow.ModelMan);
    SceneView := TJSceneView.create(JWindow, Scene);

    JUIWindowMan := TJUIWindowMan.Create(JWindow);

    JUIWindowMan.Theme := TJUITheme.create;
    JUIGlobal.WindowMan := JUIWindowMan;

    JUIWindowMan.AttachJViewPort(SceneView);
    JAPTaskbar := TJAPTaskbar.Create(JUIWindowMan);
    JAPSceneTree := TJAPSceneTree.Create(JUIWindowMan, Scene);

    Example Render Loop

    FCamera.Look;
    {Set Shader Uniform buffers}
    FJWindow.ShaderMan.ModelViewMatrix := FCamera.ModelViewMatrix;
    FJWindow.ShaderMan.ProjectionMatrix := FCamera.ProjectionMatrix;
    FJWindow.PrimativeRenderer.Grid(vec3(-128,0,-12);
    FScene.DoRender;


    -----

    You may of noticed that JWindow contains the image, model and shader managers.

    While this might seem like an odd design decision it's simple enough : JWindowMan supports multiple windows across multiple monitors that the user might want to have their own resources/contexts. So everything that is specific to the context lives in JWindow. Shared contexts across multiple windows are handled by JWindowMan and you simply tell it which window you want to share with.
    Last edited by phibermon; 13-06-2011 at 01:26 PM.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  4. #4
    Looks pretty great! Too bad you're aiming for top of the line gfx cards only. I understand your reasoning, but you're targeting a small audience if you're planning to make a game with this engine eventually.

  5. #5
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    You are quite right, my reasoning doesn't make for a sound design decision in the present day but :

    there will come a day when it's no longer a problem

    I want to make an MMORPG so by the time I've finished? all this may very well be old news

    I secretly harbor the desire to get lots of developers on board and perhaps open up GL2.x/ES code paths (ok, so not so secret now)
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  6. #6
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    I wonder how compatible this might be on say iOS? Not to sound redundant, but it's the way a lot of developers are going these days.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •