Jump to content

Ultra Engine testing


Josh
 Share

Recommended Posts

4 hours ago, reepblue said:

I just updated my project, and it just copied the $PROJECTNAME.vcxproj file without renaming and overriding the old project. I had to redo my fix for my preprocessor and I ended up just deleting everything regarding the components for it to compile again.  

I know project files will probably not change much after the release, but I also had to redefine my external libraries. I would suggest a dedicated directory for external libraries, that all projects have included but that could cause some issues. 

You can use the Diff tool to see what changed in the project files. I could also add a list of files that should never be updated, like $PROJECTNAME.vcxproj and main.cpp. You would have to manually add any changes like additional include header folders, but that would still probably be easier.

What did you modify in the preprocessor? You can submit improvements to the repository through Github for inclusion in the official build.

2 hours ago, SpiderPig said:

Is the Basis plugin meant to be missing?

I don't plan to support raw Basis files. KTX2 includes Basis compression and is a better format. All mentions of the Basis plugin should be removed from the documentation, although you can still use it if you want.

  • 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

7 hours ago, Josh said:

What did you modify in the preprocessor? You can submit improvements to the repository through Github for inclusion in the official build.

I didn't modify anything with the application itself. I had to change the pre-build path to add a set of quotes around it in the solution. I forgot My install path is currently "D:\Ultra Engine" which causes issues due to the space. I've forgot I did this before recompiling my project.

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

I am experimenting now with the render to texture feature, and noticed something weird or maybe it is wanted that way, i don't know.

If i create a TextureBuffer like this:

auto screenBuffer = CreateTextureBuffer(512, 512);
auto rendercamera = CreateCamera(world);
rendercamera->SetFov(90);
rendercamera->SetRenderTarget(screenBuffer);

the actual textures for this buffer are not of size 512 * 512, but insead they are the same size as the main framebuffer. This leads to some issues later as you need to remap the texture coords to map to the correct space. 

image.thumb.png.c1f14d0bab9ba527c4c49523464a1bb8.png

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

Are you using refraction or any post-processing effects? Maybe the camera is creating the initial gbuffer at the size of the framebuffer instead of the size of the texture buffer.

  • 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

Indeed I am using a posteffect on the rendercamera. After removing it, it creates and uses the correct texture. Background: I  want to capture the underlying terrain, to build some simple Distantfield. therefore i need a pfx to just output the height below the water and there i use a custom posteffect for.

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

  • Josh changed the title to Ultra Engine testing

Here is my list of things to do:

 

  • Combine manual bone movement with animation
  • Animation should trigger shadow render
  • Terrain examples not working
  • Model:Copy does not work
  • Light:Instantiate does not work
  • Release final benchmarks
  • Write documentation introduction
  • Community and learn panels in client app
  • .bak files localtion
  • Replace all box2d example in docs
  • Finalize save/load system
  • Test multiple cameras
  • Texture scrolling
  • Lighting benchmark
  • Missing shader modules
  • Does GUI work in 3D?
  • TextureBuffer crashing
  • Tessellation - where is tess detail stored in shader execution?
  • Animation not triggereing shadow refresh
  • Refraction broken
  • Terrain tessellation depth broken
  • Different PBR models for SSR rendering
  • Engine initialization on AMD R480-580
  • Update forum skin
  • Upgrade to PHP 8.0
  • Update IPB
  • Addon to hide profile spam
  • FPS counter on benchmarks

 

  • 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

19 minutes ago, Josh said:

Does GUI work in 3D?

I might want to check this out for myself as I was getting weird issues when making an in-game console a few months ago.

Minus the AMD issue, looks like it's just little things left to do. I really think you can get the early access release out before Christmas. :)

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

16 minutes ago, reepblue said:

I might want to check this out for myself as I was getting weird issues when making an in-game console a few months ago.

Minus the AMD issue, looks like it's just little things left to do. I really think you can get the early access release out before Christmas. :)

With the working texturebuffer and the camera—>setrendertarget it should work very good.

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

1 hour ago, reepblue said:
1 hour ago, Josh said:

Does GUI work in 3D?

I might want to check this out for myself as I was getting weird issues when making an in-game console a few months ago.

I have noticed with 3D GUI that the borders of the buttons don't line up, and on LoadGame I'm holding the mouse down and you can see the triangles that make up the background mesh.  I think there are various issues like this with other widgets too.  Haven't tested with a small fresh project though, if you'd like an example I can put one together for you tonight.

1679619648_3DGUI.png.3659f220bf9c31296d8cf03b4eb80317.png

Link to comment
Share on other sites

This shows a 3D GUI:
https://www.ultraengine.com/learn/CreateInterface?lang=cpp

It's best to use the SetRenderLayers() command to control which camera sees the UI sprites. Then you can have a 3D camera followed by a 2D camera that displays the GUI:
https://www.ultraengine.com/learn/Interface_SetRenderLayers?lang=cpp
https://www.ultraengine.com/learn/Entity_SetRenderLayers?lang=cpp

To make a GUI appear on a panel in-game, or to render to a sprite to display in VR, you would use a TextureBuffer for both of those situations.

  • 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

small update: 

image.thumb.png.7589cad91df68a3d95281208d068b52c.png

This is more or les an adaption of the Leadwerks-Water, but instead of my previous screen it doesn't need a modified refraction shader. you can see a  (realtime) generated alpha mask for the water on the left bottom (generated via a texturebuffer and top-down camera rendering the whole covered terrain space), this texture is used in a custom water-shaderfamily which supports animated textures (normals) and calculates the alpha level based on the generated alpha texture. With that it should be possible to add foam as well. and later generating a distance field based on this map to animate waves, foam and other interactions in realtime.

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

A small addition to your TODO-List (if you consider it):

  • fix ssr in combination with refraction (too dark environment and the reflection of refracted surfaces is broken):
  • image.png.f85027c308f0a8530dd7dc2b158b970a.png
  • add the removed animated texture feature (would make some things a lot easier)
  • cleanup the shaders (remove experiment values etc.)
  • maybe add some more hooks: (just a few ideas, but these would alter the flexibility of the engine a lot)
    • BEFORE_TRANSER / RENDER and AFTER_TRANSFER / RENDER
    • BEFORE_CAMERA_RENDER / AFTER_CAMERA_RENDER
    • BEFORE_PFX_RENDER / AFTER_PFX_RENDER
  • Add a way to get the internal shader index of a texture.
  • Maybe consider adding more than just one matrix for user defined values in shaders. Some complicated shaders need a lot of input values and storing them in textures might be a bit complicated.

 

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

On 12/5/2022 at 6:32 PM, Josh said:

I don't plan to support raw Basis files. KTX2 includes Basis compression and is a better format. All mentions of the Basis plugin should be removed from the documentation, although you can still use it if you want.

Are there any tools available to convert to KTX2?  I can't seem to find any...

Link to comment
Share on other sites

Our KTX2 plugin supports saving:
https://github.com/UltraEngine/PluginSDK

The only reason to use KTX2 is if you are making a game that will also run on mobile or mobile VR headsets. For PC games DDS is best. The less extreme Basis compression can be quickly transcoded into PC or mobile compressed formats, which is good because then the same texture files can be used on either platform.

The extreme Basis compression is very efficient, about three times smaller than JPEG, but it is very lossy. You already don't use JPEG for textures because of artifacts, so why would you use Basis / Crunch to do the same thing? That's my conclusion on it.

  • 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

Update

  • Mostly fixed terrain cracks when tessellation is in use. There is still room for future improvement, but it's probably good enough to release now

Untitled.thumb.jpg.71b9da76672df9d840273fa6386e90e2.jpg

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

using namespace UltraEngine;

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

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

    //Create a world
    auto world = CreateWorld();
    world->SetAmbientLight(0);

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

    //Create a camera
    auto camera = CreateCamera(world);
    camera->SetFov(70);
    camera->SetPosition(0, 100, -100);
    camera->SetRotation(45, 0, 0);
    camera->SetClearColor(1, 0, 1);
    camera->SetTessellation(8);
    
    //Sunlight
    auto light = CreateDirectionalLight(world);
    light->SetRotation(45, 35, 0);
    light->SetColor(2);

    //Create terrain
    auto terrain = CreateTerrain(world, 512);
    terrain->LoadHeightmap("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Terrain/512.r16");
    terrain->SetScale(1, 100, 1);

    //Create base material
    auto ground = CreateMaterial();
    auto diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_diff_4k.dds");
    auto normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/river_small_rocks_nor_gl_4k.dds");
    ground->SetTexture(diffusemap, TEXTURE_DIFFUSE);
    ground->SetTexture(normalmap, TEXTURE_NORMAL);
    terrain->SetMaterial(ground);

    //Create paint material
    auto rocks = CreateMaterial();
    diffusemap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k.dds");
    normalmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k_dot3.dds");
    auto dispmap = LoadTexture("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/Rocks_Dirt_Ground_2k_disp.dds");
    rocks->SetTexture(diffusemap, TEXTURE_DIFFUSE);
    rocks->SetTexture(normalmap, TEXTURE_NORMAL);
    rocks->SetTexture(dispmap, TEXTURE_DISPLACEMENT);
    rocks->SetDisplacement(1.5);

    //Camera controls
    auto actor = CreateActor(camera);
    actor->AddComponent<CameraControls>();

    //Main loop
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        if (window->MouseDown(MOUSE_LEFT))
        {
            auto mousepos = window->GetMousePosition();
            auto pickinfo = camera->Pick(framebuffer, mousepos.x, mousepos.y);
            if (pickinfo.success)
            {
                if (pickinfo.entity == terrain)
                {
                    iVec2 pos;
                    pos.x = Round(pickinfo.position.x) + terrain->resolution.x / 2;
                    pos.y = Round(pickinfo.position.z) + terrain->resolution.y / 2;
                    int radius = 20;
                    auto mtl = rocks;
                    if (window->KeyDown(KEY_CONTROL)) mtl = ground;
                    for (int x = pos.x - radius; x < pos.x + radius; ++x)
                    {
                        for (int y = pos.y - radius; y < pos.y + radius; ++y)
                        {
                            float strength = 1.0f - Vec3(x, y, 0).DistanceToPoint(Vec3(pos.x, pos.y, 0)) / float(radius);
                            if (strength <= 0.0f) continue;
                            float wt = terrain->GetMaterialWeight(x, y, mtl);
                            wt += 0.1f;
                            terrain->SetMaterial(x, y, mtl, wt);
                        }
                    }
                }
            }
        }

        camera->SetWireframe(window->KeyDown(KEY_R));

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

 

  • 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

40 minutes ago, klepto2 said:

That works great, though all other geometry is not rendered with tessalation enabled.

I just ran the example here and it displayed with no problems, with tessellation enabled or disabled:

https://www.ultraengine.com/learn/Camera_SetTessellation?lang=cpp

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...