Jump to content

Ultra Engine testing


Josh
 Share

Recommended Posts

Added UPX compression on release builds. As you can see, the changes to the Visual Studio project just slide right into your existing projects:

Untitled.thumb.png.4bc4cf37f138b69891247a494e7003c6.png

  • 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

C++ project template is now updated to use the entity component system, which I have not used in a year but it seems to work perfectly:

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

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

 

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

I was pulling old code from previous alphas last night to see what still worked. I noticed the canvas system was stubbed out when I wanted to refresh myself how to add text to the screen. I'm under the impression that this will be unavailable until official early access release?

I still have nvcompress and tga2dot for making textures until the official engine tools ship. I'm under the impression you've already made such tools and hopefully we can see those shortly.

Still, I'm very happy to see the fruits of your labor again after so long. 

 

  • Like 1

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

Canvas system was thrown away. I realized as I added more and more 2D rendering features, I was really just recreating a limited version of the 3D pipeline.

There are no 2D graphics in Ultra Engine.  :) There's just orthographic cameras.

If you want 2D graphics on top of 3D graphics, create a second camera, set the projection more to orthographic, and set the clear mode to only clear the depth buffer. There's a command called Entity::SetRenderLayer() that lets you control which camera can render which entity. So you can have all your entities in one world, with a the 2D camera set to only render entities with the RENDERLAYER2 flag.

You can render post-processing effects on top of or underneath the 2D graphics, so for example your health bar doesn't need to show a bloom effect unless you want. This is something Leadwerks and earlier versions of Ultra could not handle.

  • 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

Very informative, but I just want to create a simple fps counter and plot 5 dots on the screen for the time being. (Which I assume is just 5 box models with the camera in orthographic view.)

Does rendering widgets in the frame buffer work as of now?

Some insight on that would be helpful but I'll be sure to look into it more tonight. 

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

 

You still have sprites. Sprites are just another entity, but they can be convenient for 2D stuff.

If you just want FPS I recommend FRAPS.

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

9 hours ago, Josh said:

Canvas system was thrown away. I realized as I added more and more 2D rendering features, I was really just recreating a limited version of the 3D pipeline.

There are no 2D graphics in Ultra Engine.  :) There's just orthographic cameras.

If you want 2D graphics on top of 3D graphics, create a second camera, set the projection more to orthographic, and set the clear mode to only clear the depth buffer. There's a command called Entity::SetRenderLayer() that lets you control which camera can render which entity. So you can have all your entities in one world, with a the 2D camera set to only render entities with the RENDERLAYER2 flag.

You can render post-processing effects on top of or underneath the 2D graphics, so for example your health bar doesn't need to show a bloom effect unless you want. This is something Leadwerks and earlier versions of Ultra could not handle.

No dice. 

#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 * 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);
    camera->SetFreeLookMode(true);
    
    //Create a light
    auto light = CreateLight(world, LIGHT_DIRECTIONAL);
    light->SetRotation(35, 45, 0);

    //Create Interface (Crashes)
    //auto gui = CreateInterface(world, iVec2(framebuffer->size.x, framebuffer->size.y));
    //auto panel = CreatePanel(0, 0, 100, 100, gui->GetBase());
    //auto text = CreateLabel("Hello Ultra Engine!", 2, 2, 100, 32, panel);

    //Create HUD
    auto hud_camera = CreateCamera(world);
    hud_camera->SetProjectionMode(PROJECTION_ORTHOGRAPHIC);
    hud_camera->SetClearMode(CLEAR_DEPTH);
    hud_camera->SetRenderLayers(RENDERLAYER_2);

    auto font = LoadFont("Fonts/arial.ttf");
    auto test_sprite = CreateSprite(world, font, "Hello Ultra Engine!", 1);
    test_sprite->SetRenderLayers(RENDERLAYER_2);

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

    //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_DELETE) == false)
    {
        world->Update();
        camera->UpdateControls(window);
        world->Render(framebuffer);
    }
    return 0;
}

If I comment the SetRenderLayers call, the text doesn't render properly like I forgot to set the blend mode or something. Howver, no such call exists.

 

Edit:

Ok, I got it to render to the screen by setting the projection mode at creation. But the text is not drawing correctly.

    //Create HUD
    auto hud_camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC);
    hud_camera->SetRenderLayers(RENDERLAYER_2);
    //hud_camera->SetProjectionMode(PROJECTION_ORTHOGRAPHIC);
    hud_camera->SetClearMode(CLEAR_DEPTH);

 

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

12 hours ago, Josh said:

C++ project template is now updated to use the entity component system, which I have not used in a year but it seems to work perfectly:




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

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

Making custom components doesn't seem to work correctly. The solution doesn't call the preprocessor application and when it does, I get this error.

Quote

operable program or batch file.
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: The command "C:/Users/reepb/Documents/Ultra Engine/Client\\Tools\\preprocessor.exe
1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(147,5): error MSB3073: :VCEnd" exited with code 9009.

Also, I have to include the ComponentSystem.h with my components, but for some reason, the Mover doesn't need to.

Sorry for turning this thread into a bug report collection..

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

8 hours ago, SpiderPig said:

Will we be able to update the client app from with the app itself in the future?

I don't think so, but once it stabilizes updates will be very rare.

  • 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

Here is an example of 3D + 2D, although the text transparency is not working for some reason:

#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 * 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);

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

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

    auto cam2 = CreateCamera(world);
    cam2->SetClearMode(CLEAR_DEPTH);
    cam2->SetProjectionMode(PROJECTION_ORTHOGRAPHIC);
    cam2->SetRenderLayers(RENDERLAYER_1);
    cam2->SetRange(-1, 1);

    auto font = LoadFont("Fonts/arial.ttf");
    auto sprite = CreateSprite(world, font, "Hello world!", 48 * displays[0]->scale);
    sprite->SetRenderLayers(RENDERLAYER_1);
    
    //Main loop
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

 

  • 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

I get this when running the 2d sample. I get a bunch of shader module errors:

image.thumb.png.dbc6e27ba1b3cf2a604d340b97b1d9b0.png

Loading shader family "Shaders/PBR.json"
Error: Failed to load shader module "Shaders/DepthPass.frag.spv"
Error: Failed to load shader module "Shaders/DepthPass_Masked.vert.spv"
Error: Failed to load shader module "Shaders/PBR_dynamic.vert.spv"
Error: Failed to load shader module "Shaders/PBR_Animated_dynamic.vert.spv"
Error: Failed to load shader module "Shaders/DepthPass_dynamic.vert.spv"
Error: Failed to load shader module "Shaders/DepthPass_Animated_dynamic.vert.spv"
Error: Failed to load shader module "Shaders/DepthPass_Masked_dynamic.vert.spv"
Loading font "Fonts/arial.ttf"
Loading shader family "Shaders/Unlit.json"
Error: Failed to load shader module "Shaders/Unlit_transparency.frag.spv"
Error: Failed to load shader module "Shaders/Unlit_Tess.frag.spv"
Error: Failed to load shader module "Shaders/Unlit_Masked.frag.spv"
Error: Failed to load shader module "Shaders/Unlit_Masked_Transparency.frag.spv"
Error: Failed to load shader module "Shaders/Unlit_Tess_Masked.frag.spv"
Error: Failed to load shader module "Shaders/Unlit_Tess_dynamic.frag.spv"
Error: Failed to load shader module "Shaders/Unlit_Tess_Masked_dynamic.frag.spv"

  • 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

That is correct. Something is wrong with the transparency right now.

The shader families are HUGE and some combinations of shaders are currently missing.

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

Here how compute shaders will work. You add a hook to the world for rendering with this command:

virtual void AddHook(const HookID id, void Hook(const VkCommandBuffer, shared_ptr<Object>), shared_ptr<Object> extra);

So your code will look like this:

void func(VkCommandBuffer cbuffer, shared_ptr<Object> extra)
{
	//Vulkan code
}
  
world->AddHook(HOOKID_RENDER, someobjectthatholdsallmy info);

You can call Texture::GetHandle() and ShaderModule::GetHandle() to get the VkImage and VkShaderModule objects associated with these objects. These two GetHandle() methods MUST ONLY BE CALLED FROM WITHIN THE RENDER HOOK, which only gets called on the rendering thread. Any textures of shader modules you use in the rendering hook should be passed as member of the custom object you supply in the "extra" parameter.

The engine will automatically bind the "extra" object at the time this is called, so it won't get deleted if it goes out of scope while the frame it is being used in is still rendering.

So you will have access to the Vulkan command buffer that is currently being recorded, texture image handles, and the shader module handles. Is there anything else you need?

  • 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

Curious, can this render layering system work for view models if the viewmodel camera is parented to the main camera clearing the depth buffer? Since both the player and the model are in the same world and location, I don't see why this couldn't work with the lighting system.

If lights are a problem, I could just instance every light in my scene to render on the viewmodel layer. I want the viewmodel on its own layer so the player can have their fov at 90 and not have the viewmodel distort.

I'd have to give it a go tonight.

 

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

12 minutes ago, reepblue said:

Curious, can this render layering system work for view models if the viewmodel camera is parented to the main camera clearing the depth buffer? Since both the player and the model are in the same world and location, I don't see why this couldn't work with the lighting system.

I'd have to give it a go tonight.

Yes, that will work. That could be used to solve the issue of incomplete information for refraction in transparency, because the view model would get rendered after the transparency effect is drawn.

  • 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

 

20 minutes ago, reepblue said:

I want the viewmodel on its own layer so the player can have their fov at 90 and not have the viewmodel distort.

That's kind of interesting. Is this a common practice? I always thought the visible gun scale/angles were kind of hard to replicate from what I saw in AAA games.

https://totalcsgo.com/commands/fov-and-viewmodel#change-fov

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 once followed a tutorial in a different engine where you could create a shader that repositions the vertices of the model to always reflect the preferred fov. 

By default it looks ugly and I hate that I spent hours getting the placement of the model just right for Cyclone only to see screenshots of it distorted because the player wanted their for at 90 like they were playing Quake Arena or TFC.

This just looks really ugly, and IDK why people are ok with this trade off. 

I also think starting in Portal 2, Valve changed the pickup system in that game to have picked up props be rendered on the view model layer. So that's also something to look into.

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

SDK is now updated with fixed basic transparency, so text rendering works, and the hook stuff for custom rendering.

Note that Vulkan validation layers are currently disabled for a reason I don't want to explain in detail right now.

Untitled.thumb.jpg.6790bc40cfce75a7a53fb2aa34a97208.jpg

  • 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

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

×
×
  • Create New...