Jump to content

All Activity

This stream auto-updates

  1. Today
  2. This tool will convert an HDR into a specular and diffuse PBR reflection maps in KTX2 format, then use another utility to extract the pixel data from the KTX2 files. IBLSampler2.zip
  3. 1. Made prefab out of box brush 2. Copied prefab to make a couple dozens of them 3. Brushes are invisible in most cases. 4. I'm not sure how check it properly but picking is also seems to be broken - in my game i can't pick such prefabs at all and have no problems in old maps without prefabs Example map with prefab MapBoxesPrefab.zip
  4. Here is a working build of the Khronos IBL sampler command-line tool. This outputs a KTX file, so this is only step one. IBLSampler.zip Source code: glTF-IBL-Sampler.zip The project was compiled from this: https://github.com/pcwalton/glTF-IBL-Sampler/tree/ac00ecdc90794b8f3cd024359216d0bf1a606a0d The official repo uses a lot of dependencies that won't build.
  5. Tried again with other components. It loads properties after all, but original values from prefab, not from edited fields in map which should override it i think because otherwise prefabs are way less useful.
  6. Prefab's components lack of properties - can't be found in Component::Load(), also map.ultra lack of component properties
  7. 1. Make prefab out of brush 2. Make new group 3. Copy and past couple prefabs 4. Drag into new group created before 5. Save and reopen map - prefabs are beside all groups including Root Maybe original entity deleting requires for reproducing, not sure. Maps.zip
  8. Freezes still happens (Steam, beta, W11)
  9. Yesterday
  10. When saving the prefab and then trying to load it into the map, the map editor closes unexpectedly. https://www.mediafire.com/file/yfnsoo2c6zh4ter/TestMap.zip/file
  11. Last week
  12. I have my player being rendered to another camera on a different render layer to all else and then drawn to a texturebuffer. I want the background to be transparent and I cant see a way to remove the environment maps for that camera / render layer as all entities are in the one world. Is this possible?
  13. If you want to convert a lot of files in a batch process, you can do something like this: local dir = LoadDir("mask") for n = 1, #dir do collectgarbage() local pixmap = LoadPixmap("mask/"..dir[n]) if pixmap ~= nil then local x, y, r, g, b, a for x = 0, pixmap.size.x - 1 do for y = 0, pixmap.size.y - 1 do local rgba = pixmap:ReadPixel(x, y) r = Red(rgba) g = Green(rgba) b = Blue(rgba) a = Alpha(rgba) rgba = Rgba(g, 255 - a, r, 255) pixmap:WritePixel(x, y, rgba) end end pixmap:Save("mask/"..dir[n]) end end
  14. Updated version. This actually can load some scenes correctly, although the way unity does LODs is really weird and not every scene is compatible. Definitely break all prefabs before exporting. Unity Import.lua
  15. This extension adds a menu item in the texture editor that will do the necessary channel swizzle to convert a unity "mask texture" into the standard occlusion / roughness / metal map that Khronos glTF and Ultra use. After the process finishes you can save the texture, probably in DDS format with BC7 compression, and start using it. Unity Mask Texture.lua
  16. Run this code and use the arrows keys to move the player and move to intercept the box on the left. There's a few bugs here: After the first collision - "Collison Detected" is still printed to the console even after you move away from the box position, normal & speed are never above zero I've only noticed these issues when using COLLISION_TRIGGER as the collision type. So far normal collisions seem fine. #include "UltraEngine.h" using namespace UltraEngine; class MyComponent : public Component { private: public: virtual void Collide(shared_ptr<Entity> collidedentity, const Vec3& position, const Vec3& normal, const float speed) { Print(WString((float)Millisecs() / 1000.0f) + " : Collision Detected : " + WString(position) + " : " + WString(normal) + " : " + WString(speed)); } }; 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 framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 2, -6); camera->SetDebugPhysicsMode(true); //Create light auto light = CreateDirectionalLight(world); light->SetRotation(35, 35, 0); light->SetColor(3); auto trigger = CreateBox(world, 4); trigger->SetPosition(-4, 3, 0); trigger->SetCollisionType(COLLISION_TRIGGER); trigger->AddComponent<MyComponent>(); auto floor = CreateBox(world, 100.0f, 0.1f, 100.0f); auto box = CreateCylinder(world, 0.5f, 1.8f); box->SetCollisionType(COLLISION_PLAYER); box->SetMass(1.0f); box->SetPosition(0, 0.05, 0); box->SetCollider(CreateCapsuleCollider(0.5f, 1.8f)); auto joint = CreateKinematicJoint(Vec3(), box); joint->SetMaxForce(1000); joint->SetMaxTorque(1000); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { auto pos = box->GetPosition(true); auto speed = 0.25f; if (window->KeyDown(KEY_UP)) { pos.z += speed; } if (window->KeyDown(KEY_DOWN)) { pos.z -= speed; } if (window->KeyDown(KEY_LEFT)) { pos.x -= speed; } if (window->KeyDown(KEY_RIGHT)) { pos.x += speed; } joint->SetPose(pos, Vec3()); world->Update(); world->Render(framebuffer); } return 0; }
  17. This code does not capture the button in the screenshot. #include "Engine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto plugin = LoadPlugin("Plugins/FITextureLoader"); //Get the displays auto displays = GetDisplays(); //Create window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0]); //Create framebuffer auto framebuffer = CreateFramebuffer(window); //Create world auto world = CreateWorld(); //Create main camera auto camera = CreateCamera(world); camera->SetPosition(0, 0, -3); //Create a model auto box = CreateBox(world); //Create a light auto light = CreateBoxLight(world); light->SetRange(-5, 5); light->SetRotation(34, 45, 0); //Load a font auto font = LoadFont("Fonts/arial.ttf"); //Create user interface with a semi-transparent background auto ui = CreateInterface(world, font, framebuffer->size); ui->background->SetColor(0, 0, 0, 0.5); //Create widget iVec2 sz = ui->background->ClientSize(); auto button = CreateButton("Button", sz.x / 2 - 75, sz.y / 2 - 15, 150, 30, ui->background); //Create camera auto orthocamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); orthocamera->SetClearMode(CLEAR_DEPTH); orthocamera->SetPosition(float(framebuffer->size.x) * 0.5f, float(framebuffer->size.y) * 0.5f, 0); //UI will only appear in orthographic camera orthocamera->SetRenderLayers(2); ui->SetRenderLayers(2); while (true) { box->Turn(0, 1, 0); while (PeekEvent()) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WINDOWCLOSE: if (ev.source == window) { return 0; } break; default: ui->ProcessEvent(ev); break; } } if (window->KeyHit(KEY_F2)) { framebuffer->Capture(); } auto captures = framebuffer->GetCaptures(); for (auto c : captures) { auto path = GetPath(PATH_DESKTOP) + "/screenshot.jpg"; c->Save(path); RunFile(path); } world->Update(); world->Render(framebuffer); } return 0; }
  18. In earlier builds, yes. In more recent builds I changed it so the MSAA resolve happens at the beginning of the post-processing chain. The reason for this is that the depth buffer is the only texture that really needs to retain its full resolution, and the shaders can access that anyways, so only depth-based effects need to worry about this.
  19. Yeah, with 3D camera it does not look good, especially while moving. SetLineStipple(LINE_STIPPLE_DASHED) was best when it was working before switching to OpenGL
  20. Keep in mind, if you have 45 degree lines they will hit some spots where they appear completely solid, and in some positions they will disappear, because it's a checker pattern.
  21. You could also use alpha masking, and define a fragment shader in the depth pass settings.
  22. Made it work with strippleMaterial->SetTransparent(true);
  23. Hmm I'm not sure then. Josh will know. 😁
  24. Same result. Not sure if i did it right tho { "shaderfamily": { "root": "Shaders/PBR.fam", "static": { "float": { "opaque": { "default": { "base": { "vertex": "Shaders/PBR/PBR.vert", "fragment": "Shaders/Editor/Stipple.frag" } } }, "mask": { "default": { "base": { "vertex": "Shaders/PBR/PBR.vert", "fragment": "Shaders/Editor/Stipple.frag" } } } } } } }
  1. Load more activity
×
×
  • Create New...