Jump to content

SpiderPig

Members
  • Posts

    2,296
  • Joined

  • Last visited

Posts posted by SpiderPig

  1. Just tried this out.  It works but doubles up on the texture uri's in the gltf file?  Is this intended?

    	"images": [
    		{
    			"uri": "PineLeaves_DIFF.png"
    		},
    		{
    			"uri": "PineLeaves_DIFF.dds"
    		},
    		{
    			"uri": "PineLeaves_NORM.png"
    		},
    		{
    			"uri": "PineLeaves_NORM.dds"
    		},
    		{
    			"uri": "PineTrunk_DIFF.png"
    		},
    		{
    			"uri": "PineTrunk_DIFF.dds"
    		},
    		{
    			"uri": "PineTrunk_NORM.png"
    		},
    		{
    			"uri": "PineTrunk_NORM.dds"
    		}
    	]

    I also can't load the converted images into GIMP.  I know it's a plugin issue, but I've not heard of this format.  Just checking it's all good?

    GimpError_001.png.bf7865b802d314c89c39a77b7cb5d91e.png

  2. Yeah that's a good approach.  Personally I like the idea of selecting which entities should have fixed visibily, especially for UI.  But enlarging the frustrum may have uses too.

  3. Oh I just have some simple meshes rendering to the UI camera, and I move them about, in and out of view for reasons too complex to explain.  I've mentioned before that especially in debug mode the culling is quite slow at the moment.  I thought If I could turn off culling for the UI camera it would probably solve the small issue, that's all.

  4. There's bloom.lua in the posteffects folder under the shaders folder in your project.  I think you add that to your camera as a post effect.

    For an emission shader I think you just need to change the shader from diffuse.shader to emission.shader in the material editor.  I haven't used Leadwerks in a while though.

    • Like 1
  5. I thought I'd better post this here as I think it's a bug.  Though I'm not sure...  I can't seem to get the mesh to collide with the falling cube - I think I got the collider in the right spot to catch the cube.

    #include "UltraEngine.h"
    #include "Components/Mover.hpp"
    
    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, 1, -5);
    
        camera->SetDebugPhysicsMode(true);
    
        //Create a light
        auto light = CreateBoxLight(world);
        light->SetRotation(35, 45, 0);
        light->SetRange(-10, 10);
    
        bool flip = true;
        float extents = 3.0f;
        vector<Vec3> verts;
        if (flip == false) {
            verts.push_back(Vec3(-extents, 0.0f, -extents));
            verts.push_back(Vec3(extents, 0.0f, -extents));
            verts.push_back(Vec3(0.0f, 0.0f, extents));
        }
        else {
            verts.push_back(Vec3(-extents, 0.0f, -extents));
            verts.push_back(Vec3(0.0f, 0.0f, extents));
            verts.push_back(Vec3(extents, 0.0f, -extents));
        }
    
        auto c = CreateMeshCollider();
        c->AddFace(verts);
        c->Finalize();
    
        auto pivot = CreateModel(world);//Works
        // auto pivot = CreatePivot(world);//Dosn't Work
        pivot->SetCollider(c);
        pivot->SetCollisionType(COLLISION_SCENE);
    
        world->SetCollisionResponse(COLLISION_SCENE, COLLISION_PROP, COLLISION_COLLIDE);
    
        //Main loop
        vector<shared_ptr<Entity>> cubes;
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) {
            if (window->KeyHit(KEY_SPACE) == true) {
                auto cube = CreateBox(world);
                cube->SetPosition(0.0f, 10.0f, 0.0f, true);
                cube->SetMass(1.0f);
                cube->SetCollisionType(COLLISION_PROP);
    
                cubes.push_back(cube);
            }
    
            world->Update();
            world->Render(framebuffer);
        }
        return 0;
    }

     

  6. The collider is not visible on a pivot.  I use pivots as the hubs for Collison patches on voxel terrain, mainly due to the fact it doesn't need a visible model.  The code below shows the problem but I have just found out it will work on a model even if it doesn't have a mesh.

    Should a pivot be used like this?  Or is is there any harm in using a model without a mesh assigned to it this way?

    #include "UltraEngine.h"
    #include "Components/Mover.hpp"
    
    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, 1, -5);
    
        camera->SetDebugPhysicsMode(true);
    
        //Create a light
        auto light = CreateBoxLight(world);
        light->SetRotation(35, 45, 0);
        light->SetRange(-10, 10);
    
        vector<Vec3> verts;
        verts.push_back(Vec3(-3.0f, 0.0f, -3.0f));
        verts.push_back(Vec3(3.0f, 0.0f, -3.0f));
        verts.push_back(Vec3(3.0f, 0.0f, 3.0f));
    
        auto c = CreateMeshCollider();
        c->AddFace(verts);
        c->Finalize();
    
        auto pivot = CreateModel(world);//Works
       // auto pivot = CreatePivot(world);//Dosn't Work
        pivot->SetCollider(c);
        pivot->SetCollisionType(COLLISION_SCENE);
    
        world->SetCollisionResponse(COLLISION_SCENE, COLLISION_PROP, COLLISION_COLLIDE);
    
        //Main loop
        vector<shared_ptr<Entity>> cubes;
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) {
            if (window->KeyHit(KEY_SPACE) == true) {
                auto cube = CreateBox(world);
                cube->SetPosition(0.0f, 10.0f, 0.0f, true);
                cube->SetMass(1.0f);
                cube->SetCollisionType(COLLISION_PROP);
    
                cubes.push_back(cube);
            }
    
            world->Update();
            world->Render(framebuffer);
        }
        return 0;
    }

     

×
×
  • Create New...