Dreikblack Posted July 8, 2023 Share Posted July 8, 2023 Example: #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, 1920, 1080, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.6); camera->SetFov(90); camera->SetRotation(54.736f, 45, 0); camera->SetPosition(0, 4, 0); auto sz = framebuffer->GetSize(); // Load a font auto font = LoadFont("Fonts/arial.ttf"); // Create user interface auto ui = CreateInterface(world, font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); // Create ui camera auto uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition(float(framebuffer->GetSize().x) * 0.5f, float(framebuffer->GetSize().y) * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); //Create light auto light = CreateBoxLight(world); light->SetRange(-100, 100); light->SetArea(100, 100); light->SetRotation(35, 35, 0); light->SetColor(2); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer, false); } return 0; } Quote Link to comment Share on other sites More sharing options...
Dreikblack Posted July 8, 2023 Author Share Posted July 8, 2023 Probably it's just a background of GUI that full black now Quote Link to comment Share on other sites More sharing options...
Josh Posted July 8, 2023 Share Posted July 8, 2023 It's the GUI background you are seeing. What was the behavior before? Did panels use alpha blending? #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, 1024, 768, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0,0,1); auto sz = framebuffer->GetSize(); // Load a font auto font = LoadFont("Fonts/arial.ttf"); // Create user interface auto ui = CreateInterface(world, font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(1,0,0,0); // Create ui camera auto uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetClearMode(CLEAR_DEPTH); uiCamera->SetRenderLayers(2); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer, false); } 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...
Dreikblack Posted July 8, 2023 Author Share Posted July 8, 2023 2 minutes ago, Josh said: What was the behavior before? Did panels use alpha blending? GUI background used to be transparent with: ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); Quote Link to comment Share on other sites More sharing options...
Josh Posted July 8, 2023 Share Posted July 8, 2023 I think so too. The transparency example seems to work fine in the current build: https://github.com/UltraEngine/Documentation/blob/master/CPP/Material_SetTransparent.md Investigating.... 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 July 8, 2023 Solution Share Posted July 8, 2023 The vertex alpha was being set to 1.0 in base_vert.glsl. It should work fine 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...
Dreikblack Posted July 8, 2023 Author Share Posted July 8, 2023 Does not work for me. I did update and shaders compiling. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 8, 2023 Share Posted July 8, 2023 Did you sync the project to get the new shader? You don't need to recompile shaders, although that won't hurt anything. 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...
Dreikblack Posted July 8, 2023 Author Share Posted July 8, 2023 I don't know if i can do sync manually in another way but there is no warn button to do it (just green check symbol) Quote Link to comment Share on other sites More sharing options...
Josh Posted July 8, 2023 Share Posted July 8, 2023 try again, I think I did not upload earlier. 1 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...
Dreikblack Posted July 8, 2023 Author Share Posted July 8, 2023 After new update and syncing background is still black / not transparent Quote Link to comment Share on other sites More sharing options...
Dreikblack Posted July 8, 2023 Author Share Posted July 8, 2023 Recompiling shaders helped though. Quote 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.