Jump to content

Ultra Engine testing


Josh
 Share

Recommended Posts

@SpiderPig I fixed the problem you pointed out. There is still an issue that if you keep typing so the text pushes the original text out of the visible range of the frame, the line of text disappears. It seems to be a culling issue but I can't see why it would be happening, yet.

  • 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

Awesome!  Noticed this in my project and managed to reproduce it in this program.  I've only noticed this on a sphere so far (a red sphere to be precise), sometimes these white pixels pop up for a single frame.  (It took a bit but I managed to take a picture of one! :P)  More noticeable if the camera moves but this sphere spins.  It might be at the UV seam perhaps?  Thought I'd mention it at least.  Project is up to date.

WhiteSpots.png.9f0bb8c860f88da4feed50b78ac58894.png

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


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

    //Create a window
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, 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);

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

    world->SetEnvironmentMap(LoadTexture("Materials\\Environment\\Storm\\diffuse.dds"), ENVIRONMENTMAP_DIFFUSE);
    world->SetEnvironmentMap(LoadTexture("Materials\\Environment\\Storm\\specular.dds"), ENVIRONMENTMAP_SPECULAR);

    //Create a light
    auto light = CreateLight(world, LIGHT_DIRECTIONAL);
    light->SetRotation(35, 45, 0);

    //Create a box
    auto box = CreateSphere(world);
    box->SetColor(1.0f, 0.0f, 0.0f);

    auto floor = CreateBox(world, 10.0f, 0.1f, 10.0f);
    floor->SetPosition(0.0f, -1.0f, 0.0f);

    //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)
    {

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

 

Link to comment
Share on other sites

Here's an example that shows the problem right away. I'll switch to 32-bit floats and see if it goes away:

#include "UltraEngine.h"


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

    //Create a window
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, 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,1,1);
    camera->SetFOV(70);
    camera->SetPosition(0, 0, -2);

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

    world->SetEnvironmentMap(LoadTexture("Materials\\Environment\\Storm\\diffuse.dds"), ENVIRONMENTMAP_DIFFUSE);
    world->SetEnvironmentMap(LoadTexture("Materials\\Environment\\Storm\\specular.dds"), ENVIRONMENTMAP_SPECULAR);

    //Create a light
    auto light = CreateLight(world, LIGHT_DIRECTIONAL);
    light->SetRotation(35, 45, 0);

    //Create a box
    auto box = CreateSphere(world);
    box->SetColor(1.0f, 0.0f, 0.0f);

    auto floor = CreateBox(world, 10.0f, 0.1f, 10.0f);
    floor->SetPosition(0.0f, -1.0f, 0.0f);

    //Main loop
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        camera->UpdateControls(window);
        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

 

  • 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

I made a console for my game and after using it a few times it crashes.  I've reproduced the error here.  If you press 'P' to set the text and then press 'TAB' to show the widget, it will crash.  But no crash if you press 'TAB' first and then 'P'...

#include "UltraEngine.h"


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

    //Create a window
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, 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, 1, 1);
    camera->SetFOV(70);
    camera->SetPosition(0, 0, -2);

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

    //Create a light
    auto light = CreateLight(world, LIGHT_DIRECTIONAL);
    light->SetRotation(35, 45, 0);

    //Create a box
    auto box = CreateBox(world);

    auto textbox = CreateTextArea(10, 10, 100, 25, ui->root);
    textbox->SetHidden(true);


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

        if (window->KeyHit(KEY_P)) {
            textbox->SetText("Testing");
        }

        if (window->KeyHit(KEY_TAB)) {
            textbox->SetHidden(!textbox->GetHidden());
        }

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

 

Link to comment
Share on other sites

Ok, my error is gone. I think it might be due to some issues with the vlkan sdk configurator. There i had accidently enabled some validation layers and after resetting it to the defualt everything seems to work correctly.

 

  • Like 1
  • Confused 1
  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

Now that the error is gone :) this actually works:

image.thumb.png.1ded85fa5e105314ca82e0b638a5dac0.png

Note: The cubemap has currently just a fixed camera and light position, but it is rendered in realtime to the PBR materials :)

  • Like 2
  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

I think this is the shader Khronos uses to generate diffuse cubemaps from an HDRI:
https://github.com/KhronosGroup/glTF-IBL-Sampler/blob/master/lib/source/shaders/filter.frag

I'm not sure how fast it will be. When I was converting high-res HDRIs with the utility it was very slow.

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

Another update.

  • All the recent bug posts I replied to are fixed.
  • VXRT is temporarily disabled. If you uninstall the application you can select another branch that has the previous build with VXRT.
  • 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

I'm thinking about adding a feature to mark a volume as "indoors", meaning any pixels in that volume won't be affected by the skybox in the PBR reflection. If you had a house on stilts and added a 7-sided brush, it would create a volume inside the building that went all the way up into the rafters. The inside of the house would be dark, the outside would be bright, directional lights would still come through the door and windows, and there would be a soft shadowed area underneath the house. It could include a padding parameter to control how sharp the transition is.

Untitled.png.ab65f824552b71082137210b265b3f16.png

  • Like 1
  • Upvote 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

you mean like this: image.thumb.png.2a9d174e4f748cdd8736d1b026dbc700.png

It is currently distorted because of the render to cubemap. Rendering it as a post effect would be better for those outer atmosphere sequences. Then it would be also possible to support multiple planets etc.

Here is another shot with a small 64*64 irradiance map: for the diffuse layer. the generation slows the whole process down a lot, rendering to higher resolution will bring it down to less than 20 fps which is far too slow. But i have ideas how to make this with just the pre computed textures instead of sampling the generated cubemap. 

image.thumb.png.0762b6a81f67267a3013bc326c561d8b.png

  • Like 2
  • Upvote 1
  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

The IBL is generated this way, and it is generated now with a size of 64*64 and a sample size of 0.125 which is a good compromise for realtime use.

In theory the atmosphere can be used for full atmospheres viewed from space and from ground (with fluent transition) . So yes, the planet will become smaller and smaller.

@Josh: I found a small bug with the GetVKTexture() Method. I am trying to render into the mipmaps (which works fine) but when using textures with mipmaps the imageview array just contains 9 levels instead of 10. not including the main level and at the first index of this array is just the first miplevel not the actual highest res one.

  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

Mipmap 0 is the image view for the image. That is the full-resolution image.

I'm pretty sure I fixed it. It was just like that because originally I did not realize each mipmap had its own imageview.

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

If you create a texture with a size of 512 you have 10 image views, but the array just contains 9. 

512*512 -> not in array

256*256 - 1*1 are in the array.

here is some hints from the debug:

image.thumb.png.cfee884d1b5ce8b2b08b06ce9740cf5f.png

on the left you see all provided imageviews in the VKTexture. On the right you see the missing main imageView of the texture (marked yellow).

and here is the result in NSight:

image.thumb.png.1fa6f8327017a0ddc5e5174253a22824.png  

at the bottom you can see that the actual mipmapsize is 10 not 9. and the toplevel mipmap is not rendered.

  • Intel® Core™ i7-8550U @ 1.80 Ghz 
  • 16GB RAM 
  • INTEL UHD Graphics 620
  • Windows 10 Pro 64-Bit-Version
Link to comment
Share on other sites

On 9/20/2022 at 1:47 AM, Josh said:

I'm thinking about adding a feature to mark a volume as "indoors", meaning any pixels in that volume won't be affected by the skybox in the PBR reflection. If you had a house on stilts and added a 7-sided brush, it would create a volume inside the building that went all the way up into the rafters. The inside of the house would be dark, the outside would be bright, directional lights would still come through the door and windows, and there would be a soft shadowed area underneath the house. It could include a padding parameter to control how sharp the transition is.

I think this is a good idea.  I think the ray tracing is great and looks superb but I can't see my self using it in a large procedurally generated world.  Just because it needs that extra processing power, and I'm greedy and want it to do other things :P

I'm taking a look at the physics stuff now and want to setup my own player controller.  The KinematicJoint example crashes a few moments in and in my game, passing a model to it makes it return nullptr.  Is there still some work to do on physics?

Link to comment
Share on other sites

  • Josh changed the title to Ultra Engine testing
  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...