StOneDOes Posted February 10 Posted February 10 I've found a couple of camera zoom issues. (AMD GPU) 1) After unzooming, I have some kind of shadow artifact that looks like it could be the back of one of the cascades. 2) After just having some fun with the new mesh reducer LOD tool, it appears that LOD distances are not respected while camera zoomed. Visible in video, many models have LOD variations, but just focus on the hedges. After taking the video, I thought that maybe I'm not zoomed enough or maybe still not close enough. Might need to double check this one. See video: Quote
Josh Posted February 10 Posted February 10 You know what I could do to prevent this is always re-render all shadow cascades if the camera zoom value has changed... 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
StOneDOes Posted February 11 Author Posted February 11 Sounds good. Do you have any ideas about the model LOD level when zoomed? Am I still just not close enough? Quote
Josh Posted February 11 Posted February 11 I don't understand your question about model LODs. LOD changes are based on distance to the camera. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
StOneDOes Posted February 12 Author Posted February 12 Sure, but I'm suggesting that perhaps camera zoom should be taken into account? If I'm 100 units away from an object, and my camera zoom is x2, I am hypothetically viewing from 50 units away? If this object has an LOD distance of 60 units, shouldn't the object appear in full detail? Because imagine if I then have a scope that is something like x16 zoom - its not going to look great is it? I can't actually recall if this is done in other games engines, I really just thought about this now. 1 Quote
Josh Posted February 12 Posted February 12 I think a camera LOD distance multiplier would solve both this issue, and allow a scalable quality setting, in one step. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
StOneDOes Posted February 13 Author Posted February 13 Just to be clear, are both of these items things that need to be done in the engine? Quote
Josh Posted February 13 Posted February 13 9 hours ago, StOneDOes said: Just to be clear, are both of these items things that need to be done in the engine? Yes. I just need to add one command. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Josh Posted March 4 Posted March 4 Can I get your project to test with, or even better, a simple example that demonstrates the problem? I tried to recreate it but my example works as expected. #include "Leadwerks.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 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->Move(0, 4, -50); //Create light auto light = CreateDirectionalLight(world); light->SetRotation(45, 35, 0); light->SetColor(2); auto ground = CreateBox(world, 100, 0.25, 100); std::vector<shared_ptr<Object> > stuff; for (int n = 0; n < 100; ++n) { auto box = CreateBox(world, 1, 10, 1); box->SetPosition(Random(-50, 50), 5, Random(-50, 50)); box->SetColor(Random(0, 1), Random(0, 1), Random(0, 1)); stuff.push_back(box); } //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) WaitEvent(); if (window->KeyDown(KEY_SPACE)) { camera->SetFov(20); } else { camera->SetFov(90); } world->Update(); world->Render(framebuffer); } return 0; } Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Josh Posted March 4 Posted March 4 On 2/12/2025 at 10:02 PM, StOneDOes said: Just to be clear, are both of these items things that need to be done in the engine? I changed my mind on this. In the next build, camera zoom level will automatically cause the LOD distance and view ranges to adjust. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
StOneDOes Posted March 5 Author Posted March 5 I'll see what I can do. Also, I was not changing the FOV, for zoom I am using Camera::SetZoom() Quote
Josh Posted March 5 Posted March 5 Zoom and FOV do the same thing, it's just a different way to describe the zoom factor. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Josh Posted March 10 Posted March 10 I was able to produce the problem by adding some small motion to the camera. When you press the space key and release it again, some shadows in the foreground appear similar to what your video shows. It looks like maybe the box lights that make up each stage of the cascaded shadow map are not being told they should redraw... #include "Leadwerks.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 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->Move(0, 4, -50); //Create light auto light = CreateDirectionalLight(world); light->SetRotation(45, 35, 0); light->SetColor(2); auto ground = CreateBox(world, 100, 0.25, 100); std::vector<shared_ptr<Object> > stuff; for (int n = 0; n < 100; ++n) { auto box = CreateBox(world, 1, 10, 1); box->SetPosition(Random(-50, 50), 5, Random(-50, 50)); box->SetColor(Random(0, 1), Random(0, 1), Random(0, 1)); stuff.push_back(box); } float x = 0.1f; //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) WaitEvent(); if (window->KeyDown(KEY_SPACE)) { camera->SetFov(20); } else { camera->SetFov(90); } camera->Move(x, 0, 0); x = -x; world->Update(); world->Render(framebuffer); } return 0; } Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Solution Josh Posted March 10 Solution Posted March 10 Okay, I think I got this sorted out in next build that goes up. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
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.