Josh Posted October 20, 2023 Share Posted October 20, 2023 Not sure what's going on here, but a lot of model thumbnails look like this. Material previews do not have this problem and look normal Quote 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 More sharing options...
Josh Posted October 20, 2023 Author Share Posted October 20, 2023 I wonder if its because the model thumbnail is rendered using an ortho projection.... Quote 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 More sharing options...
Josh Posted October 20, 2023 Author Share Posted October 20, 2023 This example shows the problem. This occurs with an ortho camera when the near range is less than zero and the object is behind you. I'm not even sure this is a bug, it might just be an unexpected mathematical outcome, but I think I can prevent it from happening: #include "UltraEngine.h" #include "Components/Motion/Mover.hpp" #include "Components/Player/CameraControls.hpp" #include "Components/Player/FirstPersonControls.hpp" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto cl = ParseCommandLine(argc, argv); RegisterComponent<Mover>(); RegisterComponent<CameraControls>(); RegisterComponent<FirstPersonControls>(); //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); world->SetEnvironmentMap(LoadTexture("materials/environment/default/diffuse.dds"), ENVIRONMENTMAP_DIFFUSE); world->SetEnvironmentMap(LoadTexture("materials/environment/default/specular.dds"), ENVIRONMENTMAP_SPECULAR); auto plg = LoadPlugin("Plugins/FITextureLoader"); auto model = LoadModel(world, "https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/DamagedHelmet/glTF/DamagedHelmet.gltf"); auto camera = CreateCamera(world); camera->SetDepthPrepass(false); camera->SetClearColor(0.125); camera->Move(0, 0, -2); camera->SetProjectionMode(PROJECTION_ORTHOGRAPHIC); camera->SetRange(-100, 100); camera->SetZoom(125); camera->AddComponent<CameraControls>(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } Quote 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 More sharing options...
Solution Josh Posted October 20, 2023 Author Solution Share Posted October 20, 2023 Much better now: Quote 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 More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.