Jump to content

Ultra Engine testing


Josh
 Share

Recommended Posts

Preprocessor needs to be updated. 

Preprocessor/main.cpp at main · UltraEngine/Preprocessor (github.com)

Change:

stream->WriteLine("			if (c->" + m.name + " != NULL && c->" + m.name + "->As<Entity>()) j3[\"" + m.name + "\"] = c->" + m.name + "->As<Entity>()->GetGUID();");

To (I think):  

stream->WriteLine("			if (c->" + m.name + " != NULL && c->" + m.name + "->As<Entity>()) j3[\"" + m.name + "\"] = c->" + m.name + "->As<Entity>()->GetUuid();");

I would do a pull request but I'm going to bed now.

The change will make this actor work.

#pragma once
#include "UltraEngine.h"
#include "../ComponentSystem.h"
using namespace UltraEngine;

class FPSPlayer : public Component
{
    UltraEngine::Vec3 camrotation;
    UltraEngine::Vec2 mouseaxis;

public:
    std::shared_ptr<UltraEngine::Camera> camera;
    float lookspeed = 200;
    float movespeed = 3.5;
    float maxaccel = 40;
    float maxdecel = 15;
    float mousesmoothing = 3;
    float runspeed = 2;
    float jumpstrength = 8;
    float lunge = 1.5;
    float eyeheight = 1.7f;

    FPSPlayer::FPSPlayer()
    {
        mouseaxis = UltraEngine::Vec2(0);
    }

    virtual void Start()
    {
        UltraEngine::Assert(camera);
        camera->SetRotation(UltraEngine::Vec3(0, entity->rotation.y,0));
        camera->SetPosition(entity->position.x, entity->position.y + eyeheight, entity->position.z);
        camrotation = camera->GetRotation();

        entity->SetPhysicsMode(PHYSICS_PLAYER);
        entity->SetMass(10);
        entity->SetCollisionType(COLLISION_PLAYER);
    }

    virtual void Update()
    {
        if (ActiveWindow() != NULL)
        {
            if (mouseaxis.x == 0 && mouseaxis.y == 0)
            {
                ActiveWindow()->GetMouseAxis();
            }

            //Camera look
            Vec2 newaxis = ActiveWindow()->GetMouseAxis();
            Vec2 mousedelta = newaxis - mouseaxis;
            mouseaxis = newaxis;
            camrotation.x = Mix(camrotation.x + mousedelta.y * lookspeed, camrotation.x, 1.0f / mousesmoothing);
            camrotation.x = Clamp(camrotation.x, -90.0f, 90.0f);
            camrotation.y = Mix(camrotation.y + mousedelta.x * lookspeed, camrotation.y, 1.0f / mousesmoothing);
            camera->SetRotation(camrotation, true);

            //Movement 
            float accel = maxaccel;
            Vec2 movement;
            movement.y = (ActiveWindow()->KeyDown(KEY_W) - ActiveWindow()->KeyDown(KEY_S));
            movement.x = (ActiveWindow()->KeyDown(KEY_D) - ActiveWindow()->KeyDown(KEY_A));
            if (movement.x != 0.0f and movement.y != 0.0f)
            {
                //Adjust speed on each axis if both are in use
                movement *= 0.7071f;
            }
            movement *= movespeed;
            float jump = ActiveWindow()->KeyHit(KEY_SPACE) * jumpstrength;
            bool crouch = ActiveWindow()->KeyDown(KEY_C);
            if (entity->GetAirborne()) jump = 0;
            if (crouch == false and ActiveWindow()->KeyDown(KEY_SHIFT) and !entity->GetAirborne())
            {
                movement *= runspeed;
            }
            if (jump > 0 and crouch == false)
            {
                movement *= lunge;
                accel *= 100;
            }

            //Set input
            entity->SetInput(camrotation.y, movement.y, movement.x, jump, crouch, accel, maxdecel);
        }

        //Adjust camera position
        static float current_eyehight = eyeheight;
        if (entity->GetCrouched())
        {
            current_eyehight = 1.8f * 0.5f - 0.1f;
        }
        else
        {
            current_eyehight = eyeheight;
        }
        camera->SetPosition(Mix(camera->position.x, entity->position.x, 0.5f), MoveTowards(camera->position.y, entity->position.y + current_eyehight, 0.1f), Mix(camera->position.z, entity->position.z, 0.5f));
        camera->SetPosition(entity->position.x, MoveTowards(camera->position.y, entity->position.y + current_eyehight, 0.1f), camera->position.z);
    }
};
//Create Player Actor
auto actor = CreateActor(player);
actor->AddComponent<FPSPlayer>();
actor->GetComponent<FPSPlayer>()->camera = camera; // Assign camera actor...

 

Would be nice if this got cleaned up before the big release also...

1>D:\Ultra Engine\Include\Classes\Scripting\DynamicValue.h(114,43): warning C4244: 'return': conversion from 'const double' to 'float', possible loss of data
1>D:\Ultra Engine\Include\Classes\Scripting\DynamicValue.h(115,74): warning C4244: 'return': conversion from 'T' to 'float', possible loss of data
1>        with
1>        [
1>            T=Tu
1>        ]
1>D:\Ultra Engine\Include\Classes\Scripting\DynamicValue.h(120,48): warning C4244: 'return': conversion from 'int64_t' to 'int', possible loss of data
1>D:\Ultra Engine\Include\Classes\Scripting\DynamicValue.h(121,74): warning C4244: 'return': conversion from 'T' to 'int', possible loss of data
1>        with
1>        [
1>            T=Tu
1>        ]
1>D:\Ultra Engine\Include\Classes\Scripting\DynamicValue.h(122,11): warning C4244: 'return': conversion from 'float' to 'int', possible loss of data
1>D:\Ultra Engine\Include\Hub\RegKeys.h(2,10): warning C4067: unexpected tokens following preprocessor directive - expected a newline
1>D:\Ultra Engine\Include\Classes\Loaders\GLTFModelLoader.h(19,2): warning C4099: 'UltraCore::GLTFImage': type name first seen using 'class' now seen using 'struct'
1>D:\Ultra Engine\Include\Classes\Loaders\GLTFModelLoader.h(18): message : see declaration of 'UltraCore::GLTFImage'
1>D:\Ultra Engine\Include\Classes\Loaders\GLTFModelLoader.h(222,25): warning C4099: 'UltraCore::GLTFModelLoader': type name first seen using 'class' now seen using 'struct'
1>D:\Ultra Engine\Include\Classes\Loaders\GLTFModelLoader.h(222): message : see declaration of 'UltraCore::GLTFModelLoader'
1>D:\Ultra Engine\Include\Classes\Pathfinding\NavTile.h(8,24): warning C4099: 'UltraNavigate::NavMeshDebugger': type name first seen using 'class' now seen using 'struct'
1>D:\Ultra Engine\Include\Classes\Graphics\Mesh.h(6): message : see declaration of 'UltraNavigate::NavMeshDebugger'
1>D:\Ultra Engine\Include\Classes\Pathfinding\NavMeshDebugger.h(6,25): warning C4099: 'UltraNavigate::NavMeshDebugger': type name first seen using 'class' now seen using 'struct'
1>D:\Ultra Engine\Include\Classes\Pathfinding\NavMeshDebugger.h(6): message : see declaration of 'UltraNavigate::NavMeshDebugger'
1>D:\Ultra Engine\Include\Classes\Physics\PhysicsWorld.h(78,10): warning C4244: 'initializing': conversion from 'uint64_t' to 'int', possible loss of data

 

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

Terrain - SetHeight bug:

#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(0.125);

    //Sunlight
    auto light = CreateDirectionalLight(world);
    light->SetRotation(45, 35, 0);
    light->SetColor(2);

    //Create terrain
    auto terrain = CreateTerrain(world, 512);
    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);

    //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;
                    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;
                            terrain->SetHeight(x, y,  terrain->GetHeight(x,y) + 0.005 * strength);
                        }
                    }
                }
            }
        }
        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}
 	Terrain_test_d.exe!std::vector<class std::shared_ptr<class UltraEngine::Model>,class std::allocator<class std::shared_ptr<class UltraEngine::Model> > >::operator[](unsigned __int64)	Unbekannt
 	Terrain_test_d.exe!UltraEngine::Terrain::UpdatePatchBounds(void)	Unbekannt
 	Terrain_test_d.exe!UltraEngine::Terrain::Finalize(void)	Unbekannt
 	Terrain_test_d.exe!UltraEngine::World::Render(class std::shared_ptr<class UltraEngine::Framebuffer>,bool,int)	Unbekannt
>	Terrain_test_d.exe!main(int argc, const char * * argv) Zeile 87	C++
 	[Externer Code]	

you get this error as soon as you try to modify the terrain with SetHeight: Expression: vector subscript out of range

 

  • 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

Update

  • Fixes a texture loading error. The reason for this problem is I got more strict to prevent mipmaps with dimensions less than 4x4 from being used when a compressed format is in use.
  • Lua initialization will no longer be triggered by loading Leadwerks map files.
  • 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

17 hours ago, SpiderPig said:

Also if you can get rid of these too it would be nice - 

Those errors only show if there is at least one other obvious error somewhere.  In this case it's this line;

auto = 0;

Done, I just had to include the Vulkan memory allocator library as a C++ header, instead of placing it in an extern "C" block.

Will include in the next update.

  • 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 rewrote my premake script and it all works. This adds flexibility to on how to configure more complex projects. Only thing is that you'll have to build your own preprocessor to acuminate any changes as it works based on the location on the project, not the soultion.

This example will generate a project and put the executable within the "Game" folder. Run ./premake5.exe vs2022 in PowerShell within the directory.UltraPremakeTest.zip

-------------------------------------------------------------------------
--  Example Premake Script for Ultra Engine 1.0 (Early Access)
-------------------------------------------------------------------------
UltraEnginePath = "D:/Ultra Engine"
ToolsPath = UltraEnginePath.."/Tools"
GameDir = "Game"

workspace "UltraPremake"
	location "./"
	startproject "UltraPremake"
	configurations { "Debug", "Release"}

	filter {"system:windows", "configurations:*"}
		architecture "x86_64"

    project "UltraPremake"
        location "./"
        language "C++"
        cppdialect "C++17"
        staticruntime "off"
        editandcontinue "on"
        flags { "MultiProcessorCompile" }
        conformancemode (false)

        -- Game Location
        targetdir("%{GameDir}")
        debugdir ("%{GameDir}")

        -- OBJ Output Location
        objdir "%{prj.location}/%{cfg.buildcfg}_%{cfg.architecture}/%{cfg.system}"

        -- Include Directories
        includedirs
        {
            -- Engine
            "%{UltraEnginePath}/Include",
            "%{UltraEnginePath}/Include/Libraries/Box2D",
            "$(UniversalCRT_LibraryPath)",
            "%{UltraEnginePath}/Include/Libraries/freetype/include",
            "%{UltraEnginePath}/Include/Libraries/OpenAL/include",
            "%{UltraEnginePath}/Include/Libraries/RecastNavigation/RecastDemo/Include",
            "%{UltraEnginePath}/Include/Libraries/RecastNavigation/DetourCrowd/Include",
            "%{UltraEnginePath}/Include/Libraries/RecastNavigation/DetourTileCache/Include",
            "%{UltraEnginePath}/Include/Libraries/RecastNavigation/DebugUtils/Include",
            "%{UltraEnginePath}/Include/Libraries/RecastNavigation/Recast/Include",
            "%{UltraEnginePath}/Include/Libraries/RecastNavigation/Detour/Include",
            "%{UltraEnginePath}/Include/Libraries/sol3/include",
            "%{UltraEnginePath}/Include/Libraries/Lua/src",
            "%{UltraEnginePath}/Include/Libraries/enet/include",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dTinyxml",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dExtensions",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dlkSolver",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dJoints",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dModels/dVehicle",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dModels/dCharacter",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dModels",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dParticles",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dNewton",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dCore",
            "%{UltraEnginePath}/Include/Libraries/newton/sdk/dCollision",
            "%{UltraEnginePath}/Include/Libraries/NewtonDynamics/sdk/dVehicle/dMultiBodyVehicle",
            "%{UltraEnginePath}/Include/Libraries/NewtonDynamics/sdk/dVehicle",
            "%{UltraEnginePath}/Include/Libraries/NewtonDynamics/sdk/dMath",
            "%{UltraEnginePath}/Include/Libraries/NewtonDynamics/sdk/dgCore",
            "%{UltraEnginePath}/Include/Libraries/NewtonDynamics/sdk/dgNewton",
            "%{UltraEnginePath}/Include/Libraries/NewtonDynamics/sdk/dAnimation",
            "%{UltraEnginePath}/Include/Libraries/NewtonDynamics/sdk/dgTimeTracker",
            "%{UltraEnginePath}/Include/Libraries/NewtonDynamics/sdk/dContainers",
            "%{UltraEnginePath}/Include/Libraries/NewtonDynamics/sdk/dCustomJoints",

            -- Game
            "%{prj.location}/Source"
        }

        files
        {
            "%{prj.location}/Source/**.h",
            "%{prj.location}/Source/**.hpp",
            "%{prj.location}/Source/**.cpp",

            "%{prj.location}/Source/**.ico",
            "%{prj.location}/Source/**.rc",
        }

        -- Global Defines:
        defines
        {
            "_NEWTON_STATIC_LIB",
            "_CUSTOM_JOINTS_STATIC_LIB",
        }

        -- Shared PCH
        pchheader "UltraEngine.h"

    ---------------------------------------------------------
    -- Windows Exclusive
    ---------------------------------------------------------
    filter {"system:windows", "configurations:*"}
        systemversion "latest"
        entrypoint "mainCRTStartup"
        pchsource "%{prj.location}/Source/UltraEngine.cpp"

        libdirs 
        { 
            "%{UltraEnginePath}/Library"
        }
            
        defines
        {
            "NOMINMAX",
            "_HAS_STD_BYTE=0",
        }

        -- Preprocessor
        prebuildcommands
		{
			"\"%{ToolsPath}/preprocessor.exe\""
		}

    filter {"system:windows", "configurations:Debug"}            
        links 
        {
            "UltraEngine_d.lib"
        }

    filter {"system:windows", "configurations:Release"}
        links 
        {
			"UltraEngine.lib"
        }            

        filter "configurations:Debug"
            defines
            {
                "DEBUG",
                "_DEBUG"
            }	
            kind "ConsoleApp"
            targetsuffix "_d"
            runtime "Debug"
            symbols "on"
    
        filter "configurations:Release"
            defines
            {
                "NDEBUG"
            }

            -- UPX compression
            postbuildcommands
            {
                "\"%{ToolsPath}/upx.exe\" \"%{GameDir}/%{prj.name}.exe\""
            }
        	kind "WindowedApp"
            runtime "Release"
            symbols "off"
            optimize "on"
    ---------------------------------------------------------
    ---------------------------------------------------------

 

UltraPremakeTest.zip

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

17 minutes ago, Josh said:

I don't know what that means?

I expect the editor to load all the component .hpp files under "Source/Components". If so, would there be an option to have it look for the component header files elsewhere? It would be disappointing if these things were hardcoded.  

Sorry for me wanting to break the mold and be a Ultra power user!

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 do not know yet. In any case, the components are included into the source by the precompiler, so it's not hard to change the location if needed. I think the precompiler will search subfolders of "Components" as well.

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

On 12/24/2022 at 11:48 PM, SpiderPig said:

Will test out the latest updates when I get home.  Do you have any examples for a basic geometry shader and/or custom fragment shader or are you still ironing out the shaders?

Custom shaders is not something Ultra is good at right now. The shaders are MASSIVE and Vulkan is extremely strict when linking shader modules.

Eventually, I envision a node-based shader editor that outputs an entire shader family.

  • 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

Update

  • Added package support. Zip archive support is built-in. Zlib was alreday included in the engine in FreeImage, and I couldn't figure out any way to pass a password to a DLL plugin without it being easily intercepted, so I made it native.
  • You must add the following search header path to your existing projects: "$(UltraEnginePath)\Include\Libraries\zlib"
  • 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

I was going to write you an example demonstrating the pure agony I've had making text with a drop shadowed but I can't nail it what's causing it. It'll work fine until I change something that has nothing to do with positioning and my shadow text will draw on top the colored text. 

This is one example of it. With this, it works file if the text is not absolutely white, but if you subtract 0.1 from it, it works as expected.

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

    // 2D
    auto m_spContextCamera = CreateCamera(world, UltraEngine::PROJECTION_ORTHOGRAPHIC);
    m_spContextCamera->SetDepthPrepass(false);
    m_spContextCamera->SetClearMode(UltraEngine::CLEAR_DEPTH);
    m_spContextCamera->SetRenderLayers(UltraEngine::RENDERLAYER_7);
    m_spContextCamera->SetPosition((float)framebuffer->size.x * 0.5f, (float)framebuffer->size.y * 0.5f, 0);

    // Create Text DropShadow;
    auto font = LoadFont("Fonts/arial.ttf");
    auto text_dropshadow = CreateSprite(world, font, "Hello World!", 128);
    text_dropshadow->SetRenderLayers(UltraEngine::RENDERLAYER_7);

    // The Z position should push this back.
    text_dropshadow->SetPosition(4 + 2, 4 - 2, 1.0f);

    // Color me black
    text_dropshadow->SetColor(0.0f, 0.0f, 0.0f, 1.0f);

    // Create Text
    auto text = text_dropshadow->Instantiate(world)->As<UltraEngine::Sprite>();
    text->SetPosition(4, 4, 0.0f);
    text->SetColor(1.0f, 0.0f, 0.0f, 1.0f);

    // If the text is ABSOULTE white, the drop shadow renders above this.
    text->SetColor(1.0f, 1.0f, 1.0f, 1.0f);

    // Nock it down by 0.1, and it's fixed.
    //text->SetColor(0.9f, 0.9f, 0.9f, 1.0f);

    //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)
    {
        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

Also noticed text sprites don't render correctly when drawn in 3D and I was having issues getting 3D interface to respond. 

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

Gave the package loader a go. I zipped the shaders folder so I can paste in the shader files from Leadwerks to make a hybrid project for testing. 

Notice this causing errors loading some things.

Skipping Plugin Loading...
Loading font "Fonts/arial.ttf"
Loading package "UltraShaders.zip"
Creating World...
Loading shader family "Shaders/PBR.json"
Loading shader family "Shaders/unlit.json"
Loading shader family "/PBR.json"
Error: Failed to read file "D:/UltraGame/game/sampleapp//PBR.json"
Deleting shader family "/PBR.json"
Deleting shader family "Shaders/unlit.json"
Loading shader family "Shaders/unlit.json"
Loading shader family "/PBR.json"
Error: Failed to read file "D:/UltraGame/game/sampleapp//PBR.json"
Deleting shader family "/PBR.json"
Deleting shader family "Shaders/unlit.json"
Loading shader family "Shaders/Sky.json"
Loading posteffect "Shaders/PostEffects/Refraction.json"

Edit: Doesn't seem to work if you do this. Right now, I have shaders from both engines joined in one folder.

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

Cool, I'll be sure to try these again when I can get back to my project.

Spent Christmas writing (hopefully) production code and I gotta say minus a few bumps along the way, it's been fantastic. I wrote everything I want all my games to do (Load Splash, Create Window, etc) within one class. Cameras not being tied to the world is such a game changer. I create all my cameras at start and point to it if I need it. In Cyclone, I had to consistently recreate a camera every time the world cleared.

Only thing still not working for me is the interface drawn in 3D. Last time I checked, it wasn't responsive and after I've I rebuilt the window with repositioning the 2D camera, it's position and size was all messed up and it stopped drawing the children widgets. I'll be sure to isolate the problem asap, but maybe we should retry the examples that are on this thread if we can find them.

Finally, something I've noticed is that you can't link static libraries. I ended up having to do some hackory of reconfiguring my premake script to include the files from my core static library and have my PCH file be a public header titled "pch.h". My PCH will only include the engine header if the preprocessor definition _ULTRA_ENGINE is set. Nothing you can do about it as I think the current library loading setting is probably essential to how the engine works. Just thought you'd like to know.

I think a nice thing to have is a collection of examples showing how to do certain things. These would be something above a level above raw API examples and would help people to see how they would do X. This should have everything in one cpp file like the API examples.

Some ideas include:

  • How to safely destroy and rebuild the window to change displays and modes. (I've written a class that does this already.)
  • Drawing text with a drop shadow (Like I've written above. It's pretty simple, but it should be on the books.)
  • Using ParseCommandLine for loading and saving settings. It can go into how to apply those settings to the world and camera to make it more than an API example.
  • Using a thread to load a scene while displaying a loading screen / loading bar. (I want to know how to do this please! :P)
  • Simple networking. (Thinking of an example where a client and server is created. Then a map is loaded to the scene is loaded with the players being represented by  floating boxes which are actually just a camera with the CameraControls Component attached. This can ether with the included enet, Steamworks or both)

So far so good. We'll eventually get all these Early Access bumps flattened out. :)

  • Like 2

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

31 minutes ago, SpiderPig said:

I wonder if you should change SetRenderLayers() to SetRenderLayer()?  Seeing as we're assigning the object to a specific layer it might make more sense.  ^_^

I was under the impression that an entity can be set to multiple layers. If the information is false, then yeah it doesn't make sense.

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

enum RenderLayer
{
	RENDERLAYER_NONE = 0,
	RENDERLAYER_0 = 1,
	RENDERLAYER_1 = 2,
	RENDERLAYER_2 = 4,
	RENDERLAYER_3 = 8,
	RENDERLAYER_4 = 16,
	RENDERLAYER_5 = 32,
	RENDERLAYER_6 = 64,
	RENDERLAYER_7 = 128,
	RENDERLAYER_ALL = 255
};

I took a look and they are powers of two so it appears you are correct.

Link to comment
Share on other sites

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

×
×
  • Create New...