-
Posts
509 -
Joined
-
Last visited
Community Answers
-
Dreikblack's post in Prefab children at wrong places at map was marked as the answer
In the editor seems so, waiting for full update to be sure.
-
Dreikblack's post in 0.9.7 Editor wont start was marked as the answer
Try to delete or rename your %programdata%\Ultra Engine\settings.json.
-
Dreikblack's post in How to make entities in editor not being instances? was marked as the answer
void MakeModelUnique(shared_ptr<Model> model) { vector<shared_ptr<Mesh>> copiedMeshes; for (auto& lod : model->lods) { for (auto& mesh : lod->meshes) { copiedMeshes.push_back(mesh->Copy()); break; } } model->Clear(); for (auto& mesh : copiedMeshes) { model->AddMesh(mesh); } }
-
Dreikblack's post in Resaving a map in editor removes materials that were applied via script was marked as the answer
No longer relevant - saving now materials after creating as mat files
-
Dreikblack's post in How to save depth with object rendered with extra camera? was marked as the answer
Final working example:
#include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; 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 sz = framebuffer->GetSize(); int MAIN_LAYER = 1, OUTPUT_LAYER = 2, EXTRA_LAYER = 4, EXTRA_OUTPUT_LAYER = 8; auto light = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); auto backBox = CreateBox(world, 5); backBox->SetPosition(0, 0, 7); backBox->SetColor(0, 1, 0, 1); auto betweenBox = CreateBox(world); betweenBox->SetRenderLayers(EXTRA_LAYER); betweenBox->SetColor(1, 0, 0, 1); auto unlitShader = LoadShaderFamily("Shaders/Unlit.fam"); auto boxMat = CreateMaterial(); boxMat->SetShaderFamily(unlitShader); betweenBox->SetMaterial(boxMat); auto betweenBox2 = CreateBox(world); betweenBox2->SetPosition(0.5, 0.5, 0); betweenBox2->SetRenderLayers(EXTRA_LAYER); betweenBox2->SetColor(1, 0, 0, 1); betweenBox2->SetMaterial(boxMat); auto frontBox = CreateBox(world, 1); frontBox->SetPosition(-0.5, 0, -0.5); frontBox->SetColor(1, 1, 0, 1); auto mainCameraInput = CreateCamera(world); mainCameraInput->SetPosition(0, 0, -3); mainCameraInput->SetRenderLayers(MAIN_LAYER); auto mainTextureBuffer = CreateTextureBuffer(sz.x, sz.y); mainCameraInput->SetRenderTarget(mainTextureBuffer); auto mainSprite = CreateSprite(world, sz.x, sz.y); mainSprite->SetRenderLayers(OUTPUT_LAYER); auto mainMaterial = CreateMaterial(); mainMaterial->SetShaderFamily(unlitShader); mainSprite->SetMaterial(mainMaterial); mainMaterial->SetTexture(mainTextureBuffer->GetColorAttachment()); auto mainCameraOutput = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); mainCameraOutput->SetPosition(sz.x * 0.5f, sz.y * 0.5f, 0); mainCameraOutput->SetRenderLayers(OUTPUT_LAYER); mainCameraOutput->SetLighting(false); mainCameraOutput->SetClearMode(CLEAR_DEPTH); //red transporent boxes render part auto extraCameraInput = CreateCamera(world); extraCameraInput->SetPosition(0, 0, -3); extraCameraInput->SetRenderLayers(EXTRA_LAYER); extraCameraInput->SetMatrix(mainCameraInput->matrix); extraCameraInput->SetClearMode(CLEAR_COLOR); extraCameraInput->SetLighting(false); auto extraTextureBuffer = CreateTextureBuffer(sz.x, sz.y); extraTextureBuffer->SetDepthAttachment(mainTextureBuffer->GetDepthAttachment()); extraCameraInput->SetRenderTarget(extraTextureBuffer); auto extraSprite = CreateSprite(world, sz.x, sz.y); extraSprite->SetPosition(0, 0, -0.00001); extraSprite->SetRenderLayers(OUTPUT_LAYER); auto extraMaterial = CreateMaterial(); extraMaterial->SetShaderFamily(unlitShader); extraSprite->SetMaterial(extraMaterial); extraMaterial->SetTransparent(true); extraMaterial->SetTexture(extraTextureBuffer->GetColorAttachment()); extraMaterial->SetColor(1, 1, 1, 0.5); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
-
Dreikblack's post in Non-latin symbols not displayed was marked as the answer
Seems to be resolved at some point in beta branch
-
Dreikblack's post in Can't build after last update in beta steam branch was marked as the answer
After VS update i managed to build a projects
-
Dreikblack's post in Render crash if reCreateWorld same world was marked as the answer
This issue seems to be gone with Vulkan
-
Dreikblack's post in [C++] Editor doesn't show components was marked as the answer
Works for me with original .json from top post. Try to create new component via editor with + button
btw maybe some letter is not latin? Like Cyrillic 'C' instead of English one in folder and file name.
-
Dreikblack's post in Quake models in Editor was marked as the answer
Resolved this issue with Josh help via AddMod(quakepath) which "adds another folder and makes the engine think that folder is in the current dir"
-
Dreikblack's post in Brush and Face SetMaterial() does not work? was marked as the answer
Now in 1.03 it works for brush and face
-
Dreikblack's post in Help changing font color was marked as the answer
widget->SetColor(1, 0, 0, 1, WIDGETCOLOR_FOREGROUND);
-
Dreikblack's post in Ultra App Kit - table was marked as the answer
Edit button just for having 2 buttons in a menu:
add shared_ptr<Panel> contextMenu; to ListView.h
In ListView.cpp update Initialize method:
bool ListView::Initialize(const int x, const int y, const int width, const int height, shared_ptr<Widget> parent, shared_ptr<ListViewData> header, int columnCount) { bool isInit = Widget::Initialize("", x, y, width, height, parent, 0); itemSize = iVec2(width, getItemHeight()); ListView::columnCount = columnCount; initBlockCount += (columnCount * 2); ListView::header = header; contextMenu = CreatePanel(0, 0, 100, 40, gui->root); contextMenu->Hide(); auto editButton = CreateButton("Edit", 0, 0, 100, 20, contextMenu);//just for an example, no function auto removeButton = CreateButton("Remove", 0, 20, 100, 20, contextMenu); ListenEvent(EVENT_WIDGETACTION, removeButton, RemoveCallback, Self()->As<ListView>()); return isInit; } and MouseDown method:
void ListView::MouseDown(const MouseButton button, const int x, const int y) { contextMenu->Hide(); if (x >= 0 and y >= getItemHeight() and x < size.x and y < size.y) { int itemId = y / getItemHeight() - 1; if (itemId >= 0 and itemId < items.size()) { selectedItemId = itemId; Redraw(); if (button == MOUSE_LEFT) { if (pickItemListener) { pickItemListener(Event(EVENT_WIDGETACTION, Self(), selectedItemId)); } } else if (button == MOUSE_RIGHT) { contextMenu->Show(); contextMenu->SetShape(iVec2(x, y), contextMenu->GetSize()); } } } } Also add this function to same class:
bool RemoveCallback(const Event& ev, shared_ptr<Object> extra) { auto listView = extra->As<ListView>(); listView->removeSelectedItem(); listView->contextMenu->Hide(); return true; }
-
Dreikblack's post in Ultra Engine Client closes it self before full start (Windows 11) was marked as the answer
Tried newer version from here - https://github.com/UltraEngine/ultraengine.github.io/raw/main/files/UltraClient.exe and it worked . Found in a patch notes.
Probably main link should be updated? - https://ultraengine.github.io/files/UltraClient.exe