Jump to content

Dreikblack

Members
  • Posts

    538
  • Joined

  • Last visited

2 Followers

Recent Profile Visitors

10,386 profile views

Dreikblack's Achievements

Experienced

Experienced (11/14)

  • Posting Machine
  • Problem Solver
  • Very Popular
  • Conversation Starter
  • Collaborator

Recent Badges

196

Reputation

19

Community Answers

  1. In the editor: 1. Select empty 2. Left click on 2D view 3. Right click - menu with Create button appears for 1 sec and after that Zoom in/Out etc menu instead
  2. I have main input camera with render target to main sprite. Also i have extra input camera for transparent object that should looks same when they overlapping, targets to extra sprite. This sprite above main sprite. Both sprites are rendered to orthographic projection camera. Issue is that extra sprite (red rectangles) is not visible if i apply PostEffect or MSAA to main input camera. Not sure if it's a bug or there is a workaround. Tried apply MSAA to overlay camera - no MSAA effect then. Without MSAA: With it: #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; 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); mainCameraInput->SetMsaa(2); auto mainSprite = CreateSprite(world, sz.x, sz.y); mainSprite->SetRenderLayers(OUTPUT_LAYER); auto mainMaterial = CreateMaterial(); mainMaterial->SetShaderFamily(unlitShader); mainMaterial->SetTexture(mainTextureBuffer->GetColorAttachment()); mainSprite->SetMaterial(mainMaterial); 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); extraCameraInput->SetFogColor(0, 0, 0, 1); extraCameraInput->SetFogAngle(90, 91); extraCameraInput->SetFog(true); auto range = extraCameraInput->GetRange().y; extraCameraInput->SetFogRange(range * 0.98, range * 0.99); 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); extraSprite->SetShadows(false); auto extraMaterial = CreateMaterial(); extraMaterial->SetShaderFamily(unlitShader); extraMaterial->SetTransparent(true); extraMaterial->SetTexture(extraTextureBuffer->GetColorAttachment()); extraMaterial->SetColor(1, 1, 1, 0.5); extraSprite->SetMaterial(extraMaterial); extraSprite->SetHidden(false); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
  3. No issues with old components Steam beta 1. Create a new component 2. Create brush 3. Attach this component via Add Component in entity properties - editor crashes
  4. 1 download

    Localization Editor is a tool for creating and editing localization/language files which your game or application can use to support several languages. Git Hub repository: https://github.com/Dreikblack/Localization-Editor Localization Editor loads all .local files in folder when you open or create one. You can use names like map1.English.local and then only map1 files will be loaded for editing. .local format is pretty simple: \n used for multi lines texts, but in this tool you can just tap Enter to make a new line. Double click on table string line to open edit string line dialog. Find specific line quickly by typing a characters that key contains in the filter field, cross button to show all lines You can switch between loaded language localizations with combo box next to "Current Localization" label. Once you done remember to save changes to localization files with "Save All" button Parsing a local file in a code: auto stream = ReadFile(path); if (!stream) { return newLocalMap; } WString text = stream->ReadWString(); //map key-content std::map<WString, WString> newLocalMap; vector<WString> textStrings = text.Split("\r\n"); for (WString line : textStrings) { vector<WString> entitiyProperties = line.Split("="); if (entitiyProperties.size() > 1) { WString newLine = entitiyProperties[1].Replace("\\n", "\n"); newLocalMap[entitiyProperties[0]] = newLine; } else { newLocalMap[entitiyProperties[0]] = ""; } } stream->Close();
  5. Reworked component to make it work with sprite: FadeIn = { duration = 5.0, -- Dauer des Fade-In in Sekunden elapsed = 0, -- Verstrichene Zeit isActive = true, -- Status des Fade-In framebuffer = nil, -- Framebuffer für die Größe orthographicCamera = nil, -- 2D camera fadeSprite = nill --Sprite that covering camera fully } function FadeIn:Start() -- Sicherstellen, dass der Framebuffer und das Fenster initialisiert sind if not self.framebuffer then self.framebuffer = CreateFramebuffer(ActiveWindow()) -- Framebuffer erstellen print("Framebuffer erstellt!") -- Debugging-Ausgabe end local world = self.entity:GetWorld() local sz = self.framebuffer.size self.orthographicCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC) self.orthographicCamera:SetClearMode(CLEAR_DEPTH); self.orthographicCamera:SetClearColor(0.125) self.orthographicCamera:SetPosition(sz.x * 0.5, sz.y * 0.5, 0.0) self.orthographicCamera:SetRenderLayers(2) self.fadeSprite = CreateSprite(world, sz.x, sz.y) self.fadeSprite:SetRenderLayers(2) local material = CreateMaterial() material:SetShadow(false); material:SetTransparent(true); material:SetShaderFamily(LoadShaderFamily("Shaders/Unlit.fam")); self.fadeSprite:SetMaterial(material) self.fadeSprite:SetColor(0, 0, 0, 1) -- Vollständig schwarz self.elapsed = 0 self.isActive = true -- Fade-In-Prozess aktivieren print("Fade-In gestartet!") -- Debugging-Ausgabe end function FadeIn:ProcessEvent(ev) end function FadeIn:Update() if not self.isActive or not self.fadeSprite then print("Fade-In-Prozess ist nicht aktiv oder Sprite fehlt.") -- Debugging-Ausgabe return end local step = 0.016 -- Zeit aktualisieren self.elapsed = self.elapsed + step if self.elapsed < self.duration then -- Alpha-Wert basierend auf der verstrichenen Zeit berechnen local alpha = math.max(0, 1 - self.elapsed / self.duration) self.fadeSprite:SetColor(0, 0, 0, alpha) else -- Fade-In abgeschlossen, Sprite entfernen self.fadeSprite:SetHidden(true) self.fadeSprite = nil self.isActive = false print("Fade-In abgeschlossen.") -- Debugging-Ausgabe end end RegisterComponent("FadeIn", FadeIn) return FadeIn
  6. You need extra PROJECTION_ORTHOGRAPHIC camera and put this camera and ui to own render layers like that: SetRenderLayers(2) Although just for fade in effect usual sprite would be better i think, it will need special camera as well
  7. UI for a 3D game can be found in 2nd example (your code would work for 2D app): https://www.ultraengine.com/learn/CreateInterface?lang=lua
  8. Add before "return FadeIn" RegisterComponent("FadeIn", FadeIn)
  9. At specific angle black square appears btw FPS drops here to ~100 (from ~500) here
  10. When i'm trying to sync project it looks empty and when i open project manager again it still shows not synced button.
  11. 1. Create entity with component that have entity field 2. Set an entity to this field 3. Copy entity with this component 4, In copied entity same field is looks empty, but in fact value is still there (checked in .ultra file), but can't be cleared with X button. After map reload value appeared.
  12. Can't reproduce it yet in simple example since it tends to happen with big maps with many entities. In my game it can be reproduced by: 1. New game or Choose Map ->Easy Map -> Ok 2. F5 to quick save 3. After a second (have a delay to prevent other issue with double click) press F9 for quick load. 4, Do Quick Load 5+ times and eventually it either HUD became invisible fully or partly (buttons still can be pressed so it's not sudden UI->SetHidden anywhere) or game stuckes on Loading screen, but in fact game is just not being rendered - "Error: Invalid value" in console after every world->Render() Another way is starting new game, returning to main menu and starting again. Also beside HUD also anything transparent seems to be non rendered - shotgun cones, fog cubes, blood decals. And for some reason gibs invisible too (they only thing with a physics tho).
  13. Ah, actually it was AppDir() that failed me in real case. Just found it after a more research. It cut path to non-latin chars. For example Instead of "D:/Workspace/Тест" it returns "D:/Workspace/"
  14. ReadFile is not loading a file, if path contain non-latin (or at least Cirycilic) symbols. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto stream = ReadFile("Тест/Test.txt"); if (!stream) { Print("Fail to load"); } else { WString text = stream->ReadString(); Print(text); } return 0; } Тест.zip
×
×
  • Create New...