Jump to content

Ultra Engine testing


Josh
 Share

Recommended Posts

Final steps:

  • The SSR shader needs to detect and calculate indirect lighting based on whether the material that wrote each pixel uses PBR, Spec/Gloss, or classic shading. These each use a different calculation of specular reflection.
  • Clean shader code up a bit.
  • Make sure the spec/gloss appearance is correct. A lot of Sketchfab models use this glTF extension.
  • ASyncRender will be renamed to AsyncRender
  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

14 hours ago, Josh said:

Update

  • Fix for textures not loading correctly from plugins, may fix validation error
  • Fixed shader family reloading issue

Works :)

10 hours ago, Josh said:

Final steps:

  • The SSR shader needs to detect and calculate indirect lighting based on whether the material that wrote each pixel uses PBR, Spec/Gloss, or classic shading. These each use a different calculation of specular reflection.
  • Clean shader code up a bit.
  • Make sure the spec/gloss appearance is correct. A lot of Sketchfab models use this glTF extension.
  • ASyncRender will be renamed to AsyncRender

Nice :)

I would like to add some small thing to the list:

if you clean up the shader code, then you might consider to reanable the mappingscale feature (currently SetMappingScale has no effect, pbr and terrain)

Also if possible: readd the animation texture feature with volume textures, this would make life a lot easier.

and minor feature request: add some more methods to access some major properties:

  • Camera:
    • GetMatrix() (projection, view, etc.)
    • GetFrustumn
  • Terrain: 
    • a way to get the heightmap texture (not only the pixmap) --> support for gpu based heightmap generation
    • a way to get  / set the alpha mask for each material --> better support for serialization 

 

  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

In the latest version, the UI is not rendered correclty:

image.thumb.png.949a0bbd52aedc43b3d9a2269d60046c.png

There are 100 items in the list and below are 2 tabbers. If you look closely the tabbers are visible, but only the text in a dark grayish color.

#include "UltraEngine.h"
#include "ComponentSystem.h"

using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    //Get the displays
    auto displays = GetDisplays();

    //Create a window
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);

    //Create a world
    auto world = CreateWorld();

    //Create a framebuffer
    auto framebuffer = CreateFramebuffer(window);

    //Create a camera
    auto camera = CreateCamera(world);
    camera->SetClearColor(0.125);
    camera->SetFov(70);
    camera->SetPosition(0, 0, -3);
    camera->SetViewport(200, 0, framebuffer->size.x -200, framebuffer->size.y);

    auto uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC);
    uiCamera->SetRenderLayers(RENDERLAYER_1);
    uiCamera->SetClearMode(CLEAR_DEPTH);
    uiCamera->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2);
    auto ui = CreateInterface(world, LoadFont("Fonts/arial.ttf"), iVec2(200, framebuffer->size.y));
    ui->SetRenderLayers(RENDERLAYER_1);

    auto sz = ui->root->ClientSize();
    auto listbox = CreateListBox(5, 5, sz.x - 10, 200, ui->root, LISTBOX_DEFAULT)->As<ListBox>();
    auto tabber = CreateTabber(5, 205, sz.x - 10, sz.y - 205, ui->root)->As<Tabber>();
    tabber->AddItem("Settings", true);
    tabber->AddItem("Output");

    for (int i = 0; i < 100; i++)
    {
        listbox->AddItem("Item " + String(i));
    }

    //Create a light
    auto light = CreateBoxLight(world);
    light->SetRotation(35, 45, 0);
    light->SetRange(-10, 10);

    //Create a box
    auto box = CreateBox(world);
    box->SetColor(0,0,1);

    //Entity component system
    auto actor = CreateActor(box);
    auto component = actor->AddComponent<Mover>();
    component->rotation.y = 45;

    //Main loop
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        if (PeekEvent())
        {
            auto ev = WaitEvent();
            ui->ProcessEvent(ev);
        }

        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

 

  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

On 12/20/2022 at 11:40 AM, klepto2 said:

In the latest version, the UI is not rendered correclty:

Did this same code work correctly in previous builds?

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

3 hours ago, klepto2 said:

yes, it worked correctly. 

This is not the complete solution, but you can call uicamera->SetDepthPrepass(false) and it will probably look right. This is something you should do anyways, as there is no reason to do a depth prepass when lighting is not in use.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Also, the reason your example is kind of laggy is because it only evaluates one event per loop.  Change your code to this to fix it:

        /*if*/ while (PeekEvent())
        {
            auto ev = WaitEvent();
            ui->ProcessEvent(ev);
        }

 

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I think what we will do is enable purchases in a few days, so people who are hanging out on the forum can get the new engine, and then wait a couple of weeks for the email blast and big announcements to go out. Most normal people are probably very busy during Christmas.

  • Like 2

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

3 minutes ago, Josh said:

I think what we will do is enable purchases in a few days, so people who are hanging out on the forum can get the new engine, and then wait a couple of weeks for the email blast and big announcements to go out. Most normal people are probably very busy during Christmas.

That's a good idea. Also the forum people will probably be more understanding of any problems they might encounter.

i now hate love C++

Beeeeeeeeeeeeeep~~This is a test of the emergency signature system~~Beeeeeeeeeeeeeep

RX 6800XT | i5-13600KF | 32GB DDR5 | 1440p is perfect

Link to comment
Share on other sites

4 minutes ago, IceBurger said:

That's a good idea. Also the forum people will probably be more understanding of any problems they might encounter.

Problems?

Crash Fail GIF by Red Bull

  • Haha 2

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

3 hours ago, Josh said:

I think what we will do is enable purchases in a few days, so people who are hanging out on the forum can get the new engine, and then wait a couple of weeks for the email blast and big announcements to go out. Most normal people are probably very busy during Christmas.

Hopefully the transition will go smoothly. I would like to put money down for the year with my early adoption discount. 🙂

Under the weather right now so hopefully I'll feel better by then.

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Creating a panel seems to disable transparency on the ui roots widget...

#include "UltraEngine.h"
#include "ComponentSystem.h"


using namespace UltraEngine;


int main(int argc, const char* argv[])
{
    auto displays = GetDisplays();
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
    auto world = CreateWorld();
    world->RecordStats();

    auto framebuffer = CreateFramebuffer(window);

    auto camera = CreateCamera(world);
    camera->SetClearColor(0.125);
    camera->SetFov(70);
    camera->SetPosition(0, 2, -3);

    auto font = LoadFont("Fonts/arial.ttf");
    auto ui = CreateInterface(world, font, framebuffer->size);
    ui->SetRenderLayers(RENDERLAYER_1);
    ui->root->SetColor(0, 0, 0, 0);


    auto ui_cam = CreateCamera(world, PROJECTION_ORTHOGRAPHIC);
    ui_cam->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2, 0);
    ui_cam->SetRenderLayers(RENDERLAYER_1);
    ui_cam->SetClearMode(CLEAR_DEPTH);

    auto panel = CreatePanel(10, 10, 100, 100, ui->root);

    auto light = CreateDirectionalLight(world);
    light->SetRotation(35, 45, 0);
    light->SetRange(-10, 10);

    auto floor = CreateBox(world, 1000.0f, 0.1f, 1000.0f);

    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {

        world->Update(120);
        world->Render(framebuffer);
    }
    return 0;
}

 

Link to comment
Share on other sites

UltraEngine has a Legacy-Importer which can load the Leadwerks files (map, mat. tex, etc.) while not everything is supported right now you already can load maps created with the Leadwerks Editor. but keep in mind, that the Legacy materials and models will use a different shader family, so you might not get PBR out of the box in Leadwerks maps.

  • Like 1
  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

Update

Make sure you update your project with the updated shader files.

DDS loader will now skip mipmaps smaller then 4x4 when a compressed format is used.

SSR is working with specular / gloss shader family now. The equation is a little different, so that has to be account for in the final SSR pass:

image.thumb.jpeg.cc8ed46ed345fd5e6d76b152d5313fcb.jpeg

This is a good model for testing the specular/gloss extension: https://sketchfab.com/3d-models/valley-of-kohoutovice-1-08eb64a5f54a4f8c9d2eb2f313c3b651

I will do some more testing now, but I think 1.00 is finished.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

2 hours ago, Josh said:

I will do some more testing now, but I think 1.00 is finished.

I'll check out this RC build tonight. I think it's important to double check Leadwerks compatibility is perfect.

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Did a clean reinstall like you said.  I mucking around with UI and have noticed if I simply re-run the program below seconds apart I get a different draw order (or transparency?) each time.  Project is up to date with new shaders.

DrawIssue1.png.3cabb47dca62d4a21ecdcfdcce439889.pngDrawIssue2.png.414fb8e46c01bf4758c2cf032fa0a44d.pngDrawIssue3.png.27277de2f356350d534fc8f7dd936103.png

#include "UltraEngine.h"
#include "ComponentSystem.h"


using namespace UltraEngine;


int main(int argc, const char* argv[])
{
    auto displays = GetDisplays();
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
    auto world = CreateWorld();
    world->RecordStats();

    auto framebuffer = CreateFramebuffer(window);

    auto camera = CreateCamera(world);
    camera->SetClearColor(0.125);
    camera->SetFov(70);
    camera->SetPosition(0, 2, -3);

    auto font = LoadFont("Fonts/arial.ttf");
    auto ui = CreateInterface(world, font, framebuffer->size);
    ui->SetRenderLayers(RENDERLAYER_1);
    ui->root->SetColor(0, 0, 0, 0);



    auto ui_cam = CreateCamera(world, PROJECTION_ORTHOGRAPHIC);
    ui_cam->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2, 0);
    ui_cam->SetRenderLayers(RENDERLAYER_1);
    ui_cam->SetClearMode(CLEAR_DEPTH);

    auto panel = CreatePanel(10, 10, 100, 100, ui->root);

    auto p2 = CreatePanel(5, 5, 75, 75, panel);
    p2->SetColor(1, 0, 0);

    auto p3 = CreatePanel(5, 5, 50, 50, p2);
    p3->SetColor(0, 1, 0);

    auto light = CreateDirectionalLight(world);
    light->SetRotation(35, 45, 0);
    light->SetRange(-10, 10);

    auto floor = CreateBox(world, 1000.0f, 0.1f, 1000.0f);

    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {

        world->Update(120);
        world->Render(framebuffer);
    }
    return 0;
}

 

Link to comment
Share on other sites

@SpiderPigThanks for the example, that was an easy fix. Update is available now.

The reason this was kind of tricky to get right is because Ultra does not draw 2D graphics in the order they are supposed to appear. It uses the depth buffer to determine which object should be in front of another, just like the rasterizer does in regular 3D rendering. That means it does not have to switch materials when drawing a batch, and makes it really fast with complicated interfaces.

  • Thanks 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...