All Activity
- Today
-
reepblue started following RenderToTexture FaceFlip
-
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.
-
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; }
-
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.
-
Josh started following Probes Set Color.
-
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.
- 1 reply
-
- 1
-
TechTeam joined the community
-
reepblue started following Normal Misaligned on Brushes (Revisit 0.9.6)
-
I'm getting this bug again.
-
Yue started following Fog on Map, not visible on game. and Probes Set Color.
-
@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.
- Yesterday
-
Added to this here :
-
SpiderPig started following Root motion for character animations?
-
Root motion for character animations?
SpiderPig replied to Reaper_202307's topic in General Discussion
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. -
@Josh I'm going through the headers and shaders - is the frame and sequence being incremented on the CPU or in the shaders?
-
zconj95 joined the community
-
Josh started following Weekend Workshop #19
-
-
terram joined the community
-
I can wait years for this to be fixed!
-
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.
-
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?
-
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.
-
Reaper_202307 joined the community
-
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
-
Fixed!
- 1 reply
-
- 1
- Last week
-
Bug Report: Incorrect Local Rotation for Multi-Brush Structures
Josh replied to Yue's topic in Bug Reports
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. -