Yue Posted Thursday at 03:57 PM Posted Thursday at 03:57 PM The error occurs when the character walks through the door and it closes behind them, the door filters light as if it were still open, but in reality it is closed, video here. https://discord.com/channels/1175951843118031049/1175951843612954786/1474071248970580171 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Josh Posted Thursday at 06:22 PM Posted Thursday at 06:22 PM It looks like the door moving does not trigger the light to refresh its shadow. I don't know why. The moment the animated character walks back into the light volume, the shadow refreshes. Quote Let's build cool stuff and have fun.
Josh Posted Thursday at 06:40 PM Posted Thursday at 06:40 PM I tried to replicate this situation, thinking that the fact the door is a child of another entity might be the problem, but I was not able to produce the error. If you select the door in the editor, right-click on its node in the scene tree, and select "Unlink Prefab" to convert it into a regular entity, does the error still occur when you run the game after that? #include "Leadwerks.h" namespace lwe = Leadwerks; int main(int argc, const char* argv[]) { auto displays = lwe::GetDisplays(); auto window = lwe::CreateWindow("", 0, 0, 1280, 720, displays[0], lwe::WINDOW_DEFAULT); auto framebuffer = lwe::CreateFramebuffer(window); auto world = lwe::CreateWorld(); world->SetAmbientLight(0); auto camera = lwe::CreateCamera(world); camera->Move(0, 2, -4); camera->SetClearColor(0.125f); auto floor = CreateBox(world, 20, 1, 20); auto box = CreateBox(world); box->SetPosition(0, 2, 0); auto child = CreateBox(world); child->SetParent(box); child->SetPosition(1, 0, 0); auto light = CreatePointLight(world); light->SetPosition(0, 4, 0); light->SetRange(10); while (window->Closed() == false && window->KeyDown(lwe::KEY_ESCAPE) == false) { if (window->KeyDown(Leadwerks::KEY_SPACE)) child->Turn(0, 1, 0); world->Update(); world->Render(framebuffer); } return 0; } 1 Quote Let's build cool stuff and have fun.
Yue Posted Thursday at 11:42 PM Author Posted Thursday at 11:42 PM 5 hours ago, Josh said: I tried to replicate this situation, thinking that the fact the door is a child of another entity might be the problem, but I was not able to produce the error. If you select the door in the editor, right-click on its node in the scene tree, and select "Unlink Prefab" to convert it into a regular entity, does the error still occur when you run the game after that? #include "Leadwerks.h" namespace lwe = Leadwerks; int main(int argc, const char* argv[]) { auto displays = lwe::GetDisplays(); auto window = lwe::CreateWindow("", 0, 0, 1280, 720, displays[0], lwe::WINDOW_DEFAULT); auto framebuffer = lwe::CreateFramebuffer(window); auto world = lwe::CreateWorld(); world->SetAmbientLight(0); auto camera = lwe::CreateCamera(world); camera->Move(0, 2, -4); camera->SetClearColor(0.125f); auto floor = CreateBox(world, 20, 1, 20); auto box = CreateBox(world); box->SetPosition(0, 2, 0); auto child = CreateBox(world); child->SetParent(box); child->SetPosition(1, 0, 0); auto light = CreatePointLight(world); light->SetPosition(0, 4, 0); light->SetRange(10); while (window->Closed() == false && window->KeyDown(lwe::KEY_ESCAPE) == false) { if (window->KeyDown(Leadwerks::KEY_SPACE)) child->Turn(0, 1, 0); world->Update(); world->Render(framebuffer); } return 0; } Yes, if I remove the door from the door frame, I no longer get that error, but the error is still passed on to the prefabricated elements. Edit: The whole mistake is if the door is part of the frame. Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Yue Posted Thursday at 11:49 PM Author Posted Thursday at 11:49 PM I found a solution. The frame that is the parent of the door is static. My perception is that the frame does not move, so I should set it to static. Now, if I remove static, I no longer have that error. 1 Quote Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games
Josh Posted Thursday at 11:52 PM Posted Thursday at 11:52 PM Thank you. With this information I am now able to produce the error. There is probably still a bug(?), but now we know the cause: #include "Leadwerks.h" namespace lwe = Leadwerks; int main(int argc, const char* argv[]) { auto displays = lwe::GetDisplays(); auto window = lwe::CreateWindow("", 0, 0, 1280, 720, displays[0], lwe::WINDOW_DEFAULT); auto framebuffer = lwe::CreateFramebuffer(window); auto world = lwe::CreateWorld(); world->SetAmbientLight(0); auto camera = lwe::CreateCamera(world); camera->Move(0, 2, -4); camera->SetClearColor(0.125f); auto floor = CreateBox(world, 20, 1, 20); auto box = CreateBox(world); box->SetPosition(0, 2, 0); box->Staticize(); auto child = CreateBox(world); child->SetParent(box); child->SetPosition(1, 0, 0); auto light = CreatePointLight(world); light->SetPosition(0, 4, 0); light->SetRange(10); while (window->Closed() == false && window->KeyDown(lwe::KEY_ESCAPE) == false) { if (window->KeyDown(Leadwerks::KEY_SPACE)) child->Turn(0, 1, 0); world->Update(); world->Render(framebuffer); } return 0; } 1 Quote Let's build cool stuff and have fun.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.