Dreikblack Posted April 28, 2023 Share Posted April 28, 2023 In full 2D works fine but in 3D it's a black background in Pixmap area where should be transparent pixels. Probably Vulkan things this time too? Just want to be sure if it will be fixed later in Ultra or i'm missing something. #include "UltraEngine.h" using namespace UltraEngine; void drawPixel(shared_ptr<Pixmap> pixmap, const int x, const int y, unsigned int color) { if (pixmap && x >= 0 && x < pixmap->size.width && y >= 0 && y < pixmap->size.height) { pixmap->WritePixel(x, y, color); } } void drawCircle(shared_ptr<Pixmap> pixmap, const int centerX, const int centerY, const int radius, unsigned int color) { int x = 0; int y = radius; int delta = 1 - 2 * radius; int error = 0; while (y >= 0) { drawPixel(pixmap, centerX + x, centerY + y, color); drawPixel(pixmap, centerX + x, centerY - y, color); drawPixel(pixmap, centerX - x, centerY + y, color); drawPixel(pixmap, centerX - x, centerY - y, color); error = 2 * (delta + y) - 1; if (delta < 0 && error <= 0) { ++x; delta += 2 * x + 1; continue; } error = 2 * (delta - x) - 1; if (delta > 0 && error > 0) { --y; delta += 1 - 2 * y; continue; } ++x; delta += 2 * (x - y); --y; } } int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto world = CreateWorld(); auto framebuffer = CreateFramebuffer(window); auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 0, -3); auto default_font = LoadFont("Fonts\\arial.ttf"); auto ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); auto ui_camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); ui_camera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); ui_camera->SetRenderLayers(2); ui_camera->SetClearMode(CLEAR_DEPTH); auto panel = CreatePanel(0, 0, 200, 200, ui->root); auto pixmap = UltraEngine::CreatePixmap(100, 100); drawCircle(pixmap, 50, 50, 25, Rgba(100, 50, 150, 255)); panel->SetPixmap(pixmap); panel->SetColor(0.1f, 0.15f, 0.1f, 1); while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { auto ev = WaitEvent(); ui->ProcessEvent(ev); } world->Update(); world->Render(framebuffer); } return 0; } Link to comment Share on other sites More sharing options...
Josh Posted April 28, 2023 Share Posted April 28, 2023 I think this is something I just never programmed in the behavior for... 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 April 28, 2023 Author Share Posted April 28, 2023 Pixmap seems to ignores alpha chanal at all: drawCircle(pixmap, 50, 50, 25, Rgba(100, 50, 150, 255)); drawCircle(pixmap, 50, 50, 30, Rgba(100, 50, 150, 0)); drawCircle(pixmap, 50, 50, 35, Rgba(100, 50, 150, 133)); btw slider has issue in fisrt and last position. Also i wonder how triangles button are made, no problem with their background. No source here: here https://github.com/Leadwerks/UltraEngine/tree/main/Source/Classes/GUI Same 3 circles with no 3D World behind UI for comparison: Link to comment Share on other sites More sharing options...
Solution Josh Posted September 7, 2023 Solution Share Posted September 7, 2023 Fixed in next build... 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