Jump to content

reepblue

Developers
  • Posts

    2,600
  • Joined

  • Last visited

Everything posted by reepblue

  1. Pulled an update just now, and now it works. 🤷
  2. Broken again. Also, the DDS conversion isn't working.
  3. I think this was caused by the fix discussed here. As of writing, trying to delete any model from the map will cause an "Cannot delete Model Limbs" error when the model has no limbs to begin with.
  4. It seems to me with a little elbow grease, this can be converted into a tool in which an extension can be written to use to generate hdr cubemaps.
  5. I know if you look at any cubemaps texture in the Asset Browser it's also black despite it working in the world renderer. Did you try Setting the background to your generated cubemap?
  6. Read your compile errors. Simply looking at your code, you need to define texrture0. Not a shader expert, but I made my shaders by trial and error.
  7. Understandable. I'll await for it's return.
  8. Hmm, this does solve my problem of identifying what is level geometry and what is a decorative model. I can just use the As<Brush>() cast. I guess if brush collapsing returns, please put back the public "collapsedbrush" bool or something like you had in Leadwerks. I also want to mention that when I loaded my save file with Map::Load(), I noticed my materials lost their normal maps. These kinds of things are hard to write examples for as it requires a lot of code and assets to showcase the problem. Maybe it's a side effect from the same problem here.
  9. Every easy to recreate, just hard to notice without any shiny materials unless you look at the probe directly.
  10. Top one is from the Asset browser, correct. Sorry for not making that clear. The bottom screen is from the Map Tab.
  11. Found a new bug with the Save/Load system. I think the brushes are being re-created. This example has a transparent material in the scene, and it gets opaquer after each reload. Load the map, Press F5, and then press F6 to see the results. #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, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Load scene auto scene = LoadMap(world, "Maps/savetest3.ultra"); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_F5)) { //Save the starting scene to a file scene->Save("game.sav"); } //Reload the starting scene when space key is pressed if (window->KeyHit(KEY_F6)) { scene->Reload("game.sav"); } world->Update(); world->Render(framebuffer); } return 0; } SaveTest3.zip
  12. Diffrent problem, but related. When the sound is resumed, it starts from the beginning. Replace the sound with the one attached. radio_dreamlandloop_mono.zip
  13. In the asset browser, I can't seem to change the Collision Type or gravity settings for a gltf+bin model. Might be a carry over from a previous bug. Also, for appearance, it's missing the "Static Reflection" option. Checked items are marked as False on the Map panel. I'll report more when I find them...
  14. Pausing/Resuming speakers aren't working as expected. #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, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 0, -3); camera->Listen(); //Create a light auto light = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); //Create a box auto box = CreateBox(world); box->SetColor(0, 0, 1); //Sound auto sound = LoadSound("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Sound/notification.wav"); auto speaker = CreateSpeaker(sound); speaker->SetPosition(box->GetPosition(true)); speaker->SetRange(10); auto speakerloop = CreateSpeaker(sound); speakerloop->SetPosition(box->GetPosition(true)); speakerloop->SetRange(10); speakerloop->SetLooping(true); auto speakerstate = speaker->GetState(); auto speakerloopstate = speakerloop->GetState(); bool paused = false; //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { // P Plays the normal non-looping speaker if (window->KeyHit(KEY_P)) { speaker->Play(); } // L Plays the looping speaker if (window->KeyHit(KEY_L)) { speakerloop->Play(); } // Space pauses both speakers if (window->KeyHit(KEY_SPACE)) { if (!paused) { speaker->Pause(); speakerloop->Pause(); paused = true; } else { speaker->Resume(); speakerloop->Resume(); paused = false; } } // Report the state if (speaker->GetState() != speakerstate) { Print("Normal Speaker state at: " + String(speaker->GetState())); speakerstate = speaker->GetState(); } if (speakerloop->GetState() != speakerloopstate) { Print("Looping Speaker state at: " + String(speakerloop->GetState())); speakerloopstate = speakerloop->GetState(); } //Move and turn with the arrow keys - best experienced with headphones if (window->KeyDown(KEY_UP)) camera->Move(0, 0, 0.1); if (window->KeyDown(KEY_DOWN)) camera->Move(0, 0, -0.1); if (window->KeyDown(KEY_LEFT)) camera->Turn(0, -1, 0); if (window->KeyDown(KEY_RIGHT)) camera->Turn(0, 1, -0); world->Update(); world->Render(framebuffer); } return 0; } Right now, I have to do this hack in my project. void GameSpeaker::Pause() { if (speaker) { if (speaker->GetState() == SPEAKER_PLAYING) { pausetime = speaker->GetTime(); speaker->Pause(); } } } void GameSpeaker::Resume() { if (speaker) { if (speaker->GetState() == SPEAKER_PAUSED || pausetime > 0) { speaker->SetTime(pausetime); speaker->Play(); pausetime = 0; } } }
  15. I'm trying to make an editor extension that'll create new files from the editor. I'm working on a "Create New Material" function, but I get an error with the Save command saying it expects usedata type and not a string, although I feel like this code is correct. local extension = {} function CreateNewMaterial() local file = RequestFile("Select Material Location", "", "Ultra Engine Material File (*.mat):mat", 0, true) if file ~= nil then local mat = CreateMaterial() if mat ~= nil then mat:SetColor(1,1,1,1) local shaderfamily = LoadShaderFamily("Shaders/PBR.fam") if shaderfamily then mat:SetShaderFamily(shaderfamily) shaderfamily = nil end mat:Save(file); end end end function extension.hook(event, extension) if event.id == EVENT_WIDGETACTION then if event.source == extension.menuitem then CreateNewMaterial() end end end -------------------------------------------------------------------- -- Add menu item -------------------------------------------------------------------- local menu = program.menu:FindChild("Create", false) if menu ~= nil then local submenu = menu:FindChild("Asset", false) if submenu == nil then submenu = CreateMenu("Asset", menu) end extension.menuitem = CreateMenu("Material", submenu) end ListenEvent(EVENT_WIDGETACTION, extension.menuitem, extension.hook, extension) I also tried making a table and saving it, but it didn't work ether. local a = ctable() a["material"] = nil a["material"]["shaderFamily"] = "Shaders/PBR.fam" SaveTable(a, file) What am I doing wrong here?
  16. Old attachment but this demonstrates that the components are no longer being loaded although it's registered. savetest2.zip
  17. Color is the most important but I can check the others.
  18. I still see DDS as the engine's native texture format as you don't need a plugin to load such textures.
  19. I assumed it was DDS for traditional games, basis for simulations, and ktx for if Ultra runs on something like the quest. The question I've ran into is what is the best modeling format since gltf is technically 3 formats.
  20. This map demonstrates the crash. lighttest.zip
  21. I'm playing around with the editor and noticed when I set a light (Such as a point light) to static, my app crashes as soon as it renders in the camera. I'm noticing this from the editor, but I think this example will reproduce the results when pressing space. #include "UltraEngine.h" #include "Components/Motion/Mover.hpp" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Plugin for texture loading auto plugin = LoadPlugin("Plugins/FITextureLoader"); //Get display auto displays = GetDisplays(); //Create window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_TITLEBAR | WINDOW_CENTER); //Create framebuffer auto framebuffer = CreateFramebuffer(window); //Create world auto world = CreateWorld(); world->SetAmbientLight(0.1); world->RecordStats(true); //Create camera auto camera = CreateCamera(world); camera->SetClearColor(0.25); camera->SetPosition(0, 2, 0); camera->Move(0, 0, -5); //Build scene auto tunnel = LoadModel(world, "https://github.com/UltraEngine/Documentation/raw/master/Assets/Models/Underground/tunnel_t.glb"); tunnel->SetRotation(0, 180, 0); tunnel->Staticize(); auto cage = LoadModel(world, "https://github.com/UltraEngine/Documentation/raw/master/Assets/Models/Underground/fancage.glb"); cage->Staticize(); auto fan = LoadModel(world, "https://github.com/UltraEngine/Documentation/raw/master/Assets/Models/Underground/fanblades.glb"); fan->SetPosition(0, 2, 0); auto mover = fan->AddComponent<Mover>(); mover->rotation.z = 300; auto light = CreatePointLight(world); light->SetColor(2, 2, 2); light->SetRange(10); light->SetPosition(0, 2, 2); light->SetColor(4.0); //Display text auto orthocam = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); orthocam->SetClearMode(CLEAR_DEPTH); orthocam->SetRenderLayers(128); orthocam->SetPosition(float(framebuffer->size.x) * 0.5, float(framebuffer->size.y) * 0.5f); auto font = LoadFont("Fonts/arial.ttf"); auto text = CreateSprite(world, font, "Shadow polygons: 0", 14.0 * displays[0]->scale); text->SetPosition(2, framebuffer->size.y - 16.0f * displays[0]->scale); text->SetRenderLayers(128); auto text2 = CreateSprite(world, font, "Press space to make the light static.", 14.0 * displays[0]->scale); text2->SetPosition(2, framebuffer->size.y - 16.0f * 2.0f * displays[0]->scale); text2->SetRenderLayers(128); //Main loop while (!window->KeyHit(KEY_ESCAPE) and !window->Closed()) { world->Update(); world->Render(framebuffer); if (window->KeyHit(KEY_SPACE)) { light->Staticize(); text2->SetHidden(true); } text->SetText("Shadow polygons: " + String(world->renderstats.shadowpolygons)); } return 0; }
  22. 1. Place a probe in the map 2. Build GI. 3. Edit the Probe's appearance (Like Color). 4. Rebuild GI. 5 Notice the Probes go back to how they were.
  23. FYI, don't do this, The window didn't draw correctly at 100% scaling. #include "UltraEngine.h" #include "Components/Motion/Mover.hpp" #include "Components/Player/CameraControls.hpp" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto cl = ParseCommandLine(argc, argv); RegisterComponent<Mover>(); RegisterComponent<CameraControls>(); //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * 2, 720 * 2, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Load the map WString mapname = "Maps/start.ultra"; if (cl["map"].is_string()) mapname = std::string(cl["map"]); auto scene = LoadMap(world, mapname); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } Do something like this. #include "UltraEngine.h" #include "Components/Motion/Mover.hpp" #include "Components/Player/CameraControls.hpp" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto cl = ParseCommandLine(argc, argv); RegisterComponent<Mover>(); RegisterComponent<CameraControls>(); //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * (int)displays[0]->GetScale(), 720 * (int)displays[0]->GetScale(), displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Load the map WString mapname = "Maps/start.ultra"; if (cl["map"].is_string()) mapname = std::string(cl["map"]); auto scene = LoadMap(world, mapname); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } Only thing is that you need to cast the float to an int which might cause problems.
  24. Maybe have the asset browser also prompt for a name change when the user saves other Leadwerks assets.
  25. I mean that it wasn't a big deal when the environment settings didn't save in the map files, but now that bug was fixed, the multiple dialog boxes became more annoying as there was a reason to apply skyboxes and such. 🤣 I haven't tried Ultra since Sunday, I probably should boot up my PC after work and check everything out.
×
×
  • Create New...