Jump to content

Josh

Staff
  • Posts

    23,145
  • Joined

  • Last visited

Posts posted by Josh

  1. You would probably want to use to cameras to render this, first drawing everything under the transparent window, then applying the post-effect, then rendering the window in another pass. Honestly, it sounds pretty hard to set up in a general-purpose way.

    • Thanks 1
  2. 15 minutes ago, SpiderPig said:

    Are there actually many asset sites that deal in GLTF?  Every time I download something it's FBX.  So if I ever have to re-download it, technically FBX is the source file.

    Every SketchFab model is available in glTF format. glTF is the only file format I know of that supports a PBR material system. FBX does not.

    The channel splitting and compression stuff PBR materials require is pretty complex:
    https://www.ultraengine.com/learn/pbrmaterials

    For trees it might not matter, but if you get into metal surfaces I think you might start to appreciate the glTF export process more.

  3. It sounds like you are moving a lot of work from the Ultra editor into Blender, and you are setting up a very specific scene in Blender so it works with your export process. This is fine if it works for you.

    Note that Blender's DDS file format support is 15 years outdated and they seem uninterested in fixing it, so it does not support artifact-free texture compression (BC7 and BC5 for normal maps). DXT-compressed texture data looks blocky and often develops a greenish tint that look especially pronounced in dark areas:

    object_lips_dxt1_renorm.png.0118c234102394832a9bcdc99648f50e.png

    Interestingly, I came across a neural network designed specifically to remove these artifacts:
    https://github.com/n00mkrad/cupscale/releases/
    https://developer.valvesoftware.com/wiki/Restoring_Texture_After_DXT_Compression
    https://drive.google.com/file/d/1WXBNdlqDWV10a3L1_U7zuNkSpN9aBF0M/view?usp=sharing

    My point is, if you want artifact-free compressed textures, PNG textures in Blender aren't going away, and you need some post-export step to convert them to BC7 and BC5 DDS files. This tool is the easiest way to do that for glTF files:

    For your purposes, it sounds like it's not the file format that matters so much, but the export process you have set up. If so, you could probably export glTF files just as easily using the same process, but if your current approach is working then by all means use it.

    In my view, there is no need for any "source file" anymore because glTF is the source file, as well as the final game-ready file.

    Fortunately, the export capabilities of the engine are quite good, so even if data does get sent into a proprietary format, it can still be saved as a glTF or OBJ without much trouble...

    • Like 1
  4. The reason it is tied to the terrain is because each instance's position is determined programmatically, and not stored in memory. The x and z position are calculated by the instance number, and the y position is based on the terrain heightmap elevation.

    There is no position for each instance stored in memory, which is why each instances consumes only one bit.

    Without the terrain, how would the algorithm figure out the position of each instance?

  5. The effect in the editor is part of the Windows compositor. To have this effect in your game you would need to blur the screen, then use that texture in the background of the layer on top. I'm not sure what the best way to do this would be.

    • Thanks 1
  6. 59 minutes ago, Dreikblack said:

    Also LoadCursorFromFileW() does not load an icon from zip. But it's WinUser class tho.

    Something like this might help:
     

    const int guardbandSize = 8;
    FILE* fs = fopen("action.ani", "rb");
    fseek(fs, 0,SEEK_END); int dwSize = ftell(fs); fseek(fs, 0,SEEK_SET);   
    char* memory = new char[dwSize + guardbandSize];
    fread(memory, 1, dwSize, fs); memset(memory + dwSize, 0, guardbandSize);
    fclose(fs);
    cursor = (HCURSOR)CreateIconFromResource((PBYTE)memory,dwSize,FALSE,0x00030000);        
    delete memory;

     

  7. No need to:

    #include "UltraEngine.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 light
        auto light = CreateBoxLight(world);
        light->SetRange(-10, 10);
        light->SetRotation(15, 15, 0);
        light->SetColor(2);
    
        //Create camera
        auto camera = CreateCamera(world);
        camera->SetClearColor(0.125);
        camera->SetPosition(0, 0, -3);
        camera->SetFov(70);
    
        //Create scenery
        auto box = CreateBox(world);
    
        auto cone = CreateCone(world);
        cone->SetPosition(1.25, 0, 0);
        cone->SetColor(0, 0, 1);
    
        auto sphere = CreateSphere(world);
        sphere->SetPosition(-1.25, 0, 0);
        sphere->SetColor(1, 0, 0);
    
        //Create camera and texture buffer
        auto texbuffer = CreateTextureBuffer(256, 256, 1, true, 0);
        auto cam2 = CreateCamera(world);
        cam2->SetClearColor(1, 1, 1);
        cam2->SetRenderTarget(texbuffer);
        cam2->SetMSAA(2);
    
        //Create material
        auto mtl = CreateMaterial();
        auto tex = texbuffer->GetColorAttachment();
        mtl->SetTexture(tex);
        box->SetMaterial(mtl);
        cone->SetMaterial(mtl);
        sphere->SetMaterial(mtl);
    
        //Main loop
        while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
        {
            //Orient the texturebuffer camera
            cam2->SetPosition(0, 0, 0);
            cam2->Turn(0, 1, 0);
            cam2->Move(0, 0, -3);
    
            world->Update();
            world->Render(framebuffer);
        }
        return 0;
    }

     

  8. 0.9.5

    • Today's bug fixes included.
    • Added Texture::GetIndex(). (Returns the OpenGL texture name / id, only use this in a rendering hook).
    • Added Texture::GetHandle() (Returns the OpenGL bindless sampler handle).
    • Like 1
    • Thanks 1
  9. There are some questions that need to be decided.

    • How much info should a brush instance share with the original?
    • Should texture mapping be updated on a brush that came from a prefab?

    The behavior we are seeing right now is a result of not having decided these questions.

×
×
  • Create New...