Jump to content

All Activity

This stream auto-updates

  1. Today
  2. This example shows the face flipping (See the cone) when rendering the scene on a texture. This is something you'll see when in VR, which might be related. #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 light auto light = CreateBoxLight(world); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); //Create scenery auto box = CreateBox(world); auto cone = CreateCone(world); cone->SetPosition(1.25, 0, 0); cone->SetColor(0, 0, 1); auto sphere = CreateSphere(world); sphere->SetPosition(-1.25, 0, 0); sphere->SetColor(1, 0, 0); //Create camera and texture buffer auto texbuffer = CreateTextureBuffer(256, 256, 1, true, 0); auto cam2 = CreateCamera(world); cam2->SetClearColor(1, 1, 1); cam2->SetRenderTarget(texbuffer); //Create material auto mtl = CreateMaterial(); mtl->SetShaderFamily(LoadShaderFamily("Shaders/Unlit.fam")); auto tex = texbuffer->GetColorAttachment(); mtl->SetTexture(tex); box->SetMaterial(mtl); //cone->SetMaterial(mtl); //sphere->SetMaterial(mtl); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { //Orient the texturebuffer camera cam2->SetPosition(0, 0, 0); cam2->Turn(0, 1, 0); cam2->Move(0, 0, -3); world->Update(); world->Render(framebuffer); } return 0; } I found this while trying to do a Portal effect.
  3. If I ignore values below a threshold the lines go away: vec3 linearTosRGB(vec3 color, float invgamma) { const float lower = 0.001f; if (color.r > lower && color.r < 1.0f) color.r = pow(color.r, invgamma); if (color.g > lower && color.g < 1.0f) color.g = pow(color.g, invgamma); if (color.b > lower && color.b < 1.0f) color.b = pow(color.b, invgamma); return color; }
  4. It's definitely being caused by the final linear to sRGB conversion. If we leave everything in linear color space it looks fine: Curved lines are visible after the linear to sRGB conversion.
  5. I think this will already cause problems with SSR, because probe reflections and SSR will no longer match. It will also cause problems in the future if I implement GI lightmaps, because the probe and the lightmapped surfaces won't match.
  6. @Josh I was thinking don't remove the color option from the probes, in other engines I have seen that it is used to create light zones in certain parts or effects like when the player is underwater.
  7. Yesterday
  8. Thought I'd add to this here. I got it working but not very well. This is the component that made it work. class Rabbit : public Component { private: shared_ptr<Entity> controller = nullptr; shared_ptr<Entity> pivot = nullptr; Vec3 root_start_pos; public: virtual void Start() { controller = CreateBox(GetEntity()->GetWorld(), 0.1f); controller->SetCollider(nullptr); controller->SetColor(1, 0, 0); pivot = CreateSphere(GetEntity()->GetWorld(), 0.05f); pivot->SetParent(controller); pivot->SetColor(0, 1, 0); GetEntity()->SetParent(pivot); controller->Move(0, 0.05, 0); auto model = GetEntity()->As<Model>(); if (model != nullptr) { auto root = model->skeleton->FindBone("Root"); root_start_pos = root->GetPosition(); } } shared_ptr<Entity> GetPivot() { return pivot; } Vec3 last_pos; int i = 0; virtual void Update() { auto model = GetEntity()->As<Model>(); if (model != nullptr) { auto root = model->skeleton->FindBone("Root"); auto local_pos = root->GetPosition(); auto looped = false; if (local_pos.DistanceToPoint(root_start_pos) < 0.03f) { looped = true; Print("Looped" + WString(i)); i++; last_pos = Vec3(); } auto move_vec = local_pos - last_pos; last_pos = local_pos; controller->Move(move_vec); root->SetPosition(0, 0, 0); } } }; In order for it to work I need to know when the animation begins again.
  9. @Josh I'm going through the headers and shaders - is the frame and sequence being incremented on the CPU or in the shaders?
  10. This week we had a quick lesson on sRGB and linear color space, a look at the exciting new AssetFetch web API for game content, and learned a shocking secret developers don't know about Steam! 6-1-24.zip
  11. Josh

    Viewport Bug

    I will get the card this week.
  12. Meric

    Viewport Bug

    I can wait years for this to be fixed!
  13. If you can export this motion to glTF or FBX then it should work fine in Ultra. If you upload your model we can try it and show you the result.
  14. I think I need to know the current frame of an animated model in order to get root motion working for animated objects. Is this something that can be added easily enough?
  15. I've come from the Discord, and no one seemed to know what I was referring to. I looked through the documentation, and turned up with nothing, so I figured I'd ask here. Does Ultra support Root motion natively, or would that have to be programmed in? The game I want to make relies heavily on moving characters fast and in complex patterns, so programming the motion in manually is essentially impossible, or at least improbable.
  16. Join us on Discord every Saturday at 10 AM PST for a live chat to review the week's progress and talk about upcoming features. https://discord.com/invite/qTVR55BgGt
  17. I think combo box for component field should not be changed by mouse scroll until i open it. I'm changing a values all time by accident when i scroll entity proprieties widget.
  18. Last week
  19. That's the correct behavior. The properties show you the rotation of all entities. If their rotation x, y, or z value is different then the field will be blank, indicating there is not one single value for all selected objects. If you change a rotation value in the properties, that change is applied to all selected objects.
  20. This week we talked about importing Unity scenes into Ultra Engine, view models, and a lot more...
  1. Load more activity
×
×
  • Create New...