Jump to content

Ultra Engine Compatibility with Leadwerks Game Engine


Josh

1,753 views

 Share

As the first release of Ultra Engine approaches, it seems clear that the best way to maximize its usefulness is to make it as compatible as possible with the Leadwerks game engine. To that end, I have implemented the following features.

Native Loading of Leadwerks File Formats

Ultra Engine loads and saves DDS, glTF, and OBJ files. Other formats are supported by plugins, both first and potentially third-party, for PNG, JPG, BMP, TGA, TIFF, GIF, HDR, KTX2, and other files. Additionally, all Leadwerks file formats are natively supported without requiring any plugins, so you can load TEX, MDL, PHY, MAT files, as well as full Leadwerks maps. You also have the option to save Leadwerks game engine formats in more up-to-date file formats such as glTF or DDS files with BC5/BC7 compression.

Image1.thumb.jpg.746bef4c6cb739d8ed94dcf212221d4b.jpg

Testing a scene from the excellent Cyclone game (available on Steam!)

Classic Specular Shader Family

PBR materials are wonderful but act quite differently from conventional specular/gloss game materials. I've added a "Classic" shader family which provides an additive specular effect, which may not be realistic but it makes materials expect the way you would expect them to, coming from Leadwerks game engine. When Leadwerks MAT files are loaded, this shader family is automatically applied to them, to get a closer match to their appearance in Leadwerks.

Leadwerks Translation Layer

I'm experimenting with a Leadwerks header for Ultra Engine. You can drop this into your Ultra Engine project folder and then start running code with the Leadwerks API. Internally, the Leadwerks game engine commands will be translated into the Ultra Engine API to execute your existing code in the new engine. I don't think this will be 100% perfect due to some differences in the way the two engines work, but I do think it will give you an easy way to get started and provide a gentler transition to Ultra.

This code will actually work with both engines:

#include "Leadwerks.h"

using namespace Leadwerks;

int main(int argc, const char* argv[])
{
    Window* window = Window::Create();
  
    Context* context = Context::Create(window);
  
    World* world = World::Create();
    
    Camera* camera = Camera::Create();
    camera->Move(0, 0, -3);
    
    Light* light = DirectionalLight::Create();
    light->SetRotation(35, 35, 0);

    Model* model = Model::Box();
    model->SetColor(0.0, 0.0, 1.0);

    while (true)
    {
        if (window->Closed() || window->KeyDown(Key::Escape)) return false;

        model->Turn(0, Time::GetSpeed(), 0);

        Time::Update();
        world->Update();
        world->Render();
        context->Sync(false);

    }
    return 0;
}

I hope these enhancements give you a more enjoyable experience using Ultra together with the Leadwerks Editor, or as a standalone programming SDK.

  • Like 5
  • Thanks 1
  • Upvote 1
 Share

4 Comments


Recommended Comments

Leadwerks could load FBX models, is that possible with Ultra or will we need a plugin?

Will Leadwerks scripts work in Ultra?

Are we close to a release of Ultra? 

Thanks.

  • Like 1
Link to comment
10 hours ago, Thirsty Panther said:

Leadwerks could load FBX models, is that possible with Ultra or will we need a plugin?

Will Leadwerks scripts work in Ultra?

Are we close to a release of Ultra? 

Thanks.

The Leadwerks editor automatically converts FBX files to MDL, and that is what Leadwerks actually loads. You can load those, or you can use the included FBX to glTF converter to convert to glTF and load that.

Lua support is not finished yet. It will allow multiple scripts, much better debugging in VSCode, and the Lua garbage collector will work together with C++ shared pointers so that invalid pointer errors are a thing of the past. I will have to look into it further, but I think Leadwerks scripts can probably be remapped to Ultra, at least most of the way.

Ultra is nearly ready. At this point I am mostly just writing documentation and debugging.

  • Like 6
Link to comment

Is the flowgraph coming back when Lua support is added?

Thinking better to that happening, you need to finish the new editor first. Right?

Link to comment
22 minutes ago, DoomSlayer said:

Is the flowgraph coming back when Lua support is added?

Thinking better to that happening, you need to finish the new editor first. Right?

It requires the new editor, but everything has already been designed in anticipation of this. It will even work with the C++ entity component system.

  • Like 2
Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...