Jump to content

Josh

Staff
  • Posts

    23,093
  • Joined

  • Last visited

Blog Comments posted by Josh

  1. This is the code I used to make the tessellation comparison screenshot:
     

    #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, 1.5, 0);
        camera->SetRotation(90, 0, 0);
        camera->SetWireframe(true);
    
        world->SetAmbientLight(1);
    
        //Create a box
        auto p1 = CreatePlane(world, 1, 1, 1, 1, MESH_TRIANGLES);
        p1->SetPosition(-0.75, 0, 0);
    
        auto p2 = CreatePlane(world, 1, 1, 1, 1, MESH_QUADS);
        p2->SetPosition(0.75, 0, 0);
    
        auto mtl = CreateMaterial();
        mtl->SetTessellation(true);
        p1->SetMaterial(mtl);
        p2->SetMaterial(mtl);
        camera->SetTessellation(20);
    
        //Main loop
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
        {
            if (window->KeyDown(KEY_UP)) camera->Move(0, 0, 0.01);
            if (window->KeyDown(KEY_DOWN)) camera->Move(0, 0, -0.01);
    
            world->Update();
            world->Render(framebuffer);
        }
        return 0;
    }

     

  2. 10 hours ago, SpiderPig said:

    It's so annoying how you can spend months getting something to work then realise there is a 5 minute method that is so much better.

    This happens to me when I am working too much / too hard. Some of my biggest wastes of time were when I was in crunch mode and I went in a wrong direction.

    You might also want to check out the cubesphere shape:
    https://www.ultraengine.com/learn/CreateCubeSphere?lang=cpp

    • Thanks 1
  3. I will add sliders. Right now I am trying to get the basic structure down. Now using a property grid in the side panel. This lets me fit more stuff into the interface, and it also will make it easy to add new functionality with an extension. For example, you could add a "Quake Texture" group for files loaded from a Quake WAD package, and add special Quake-specific properties to be edited there.

    image.thumb.jpeg.fdb2df05ef968a13fcd5b0436d75ea1f.jpeg

    • Like 2
  4. I've got embedded assets displaying now. You can open a material or texture that is packed into a model file, view, and modify it. glTF and OBJ supports embedded materials, glTF supports embedded textures, and there are some other obscure formats like Quake MDL that do this as well.

    Embedded files show their name in square brackets and link back to the file they are embedded in. You can use this to modify materials embedded in a glTF, or use it to extract materials and textures from a model and save them as a standalone file.

    image.thumb.jpeg.7b36e44d3391f8457c0fe7f24594b033.jpeg

    image.thumb.jpeg.f2628578367cda72a3afc4e3211275fa.jpeg

    • Like 6
  5. I believe most graphics drivers will automatically move textures that haven't been used in a while into "virtual memory", i.e. they write it to a file to unload it from VRAM. There is no good reason to keep texture data in system memory, and Ultra doesn't ever do that.

    I'll keep this in mind and we can revisit it if it will make an improvement.

×
×
  • Create New...