Jump to content

Render breaks after several map loads


Dreikblack
 Share

Recommended Posts

Can't reproduce it yet in simple example since it tends to happen with big maps with many entities.

In my game it can be reproduced by:

1. New game or Choose Map ->Easy Map -> Ok

2. F5 to quick save

3. After a second (have a delay to prevent other issue with double click) press F9 for quick load.

4, Do Quick Load 5+ times and eventually it either HUD became invisible fully or partly (buttons still can be pressed so it's not sudden UI->SetHidden anywhere) or game stuckes on Loading screen, but in fact game is just not being rendered - "Error: Invalid value" in console after every world->Render()

Another way is starting new game, returning to main menu and starting again.

Also beside HUD also anything transparent seems to be non rendered - shotgun cones, fog cubes, blood decals. And for some reason gibs invisible too (they only thing with a physics tho).

  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...
On 2/12/2025 at 1:05 PM, klepto2 said:

Might be related to this:


it happens as soon as generated meshes or instances go beyond a certain value.

This issue is resolved.

@DreikblackDo you still experience this problem with the current build?

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

6 hours ago, Josh said:

@DreikblackDo you still experience this problem with the current build?

Yes. Now it's takes twice longer and before it happens another render bug happens:

image.thumb.jpeg.23b7646028bbbbad26c6a7a400f78aff.jpeg

1. Random visual artifacts - black strip, cubes. Visible only at some angles.

2. No outlines.

3. No sprites.

4. No brush circles under characters.

Link to comment
Share on other sites

Tried to reproduce it in FPS template. For some reason loading background is not stuck as in my game, but rendering in general breaks in strange ways after 20-30 loads:

image.thumb.png.a59b933572c3480a00302a64d7fc898a.png

Just replace main in FPS template project and keep hitting F9 after load until you get you similar result:

#include "Leadwerks.h"
#include "ComponentSystem.h"
#include "Encryption.h"

using namespace Leadwerks;

shared_ptr<Scene> scene;
shared_ptr<Framebuffer> framebuffer;
shared_ptr<World> world;
shared_ptr<World> loadingWorld;
shared_ptr<Interface> ui;
shared_ptr<Font> font;
iVec2 framebufferSize;
shared_ptr<Widget> btn;

shared_ptr<Sprite> loadingBackground;
shared_ptr<Camera> loadingCamera;


void initScene() {
    loadingWorld->Render(framebuffer);
    world = CreateWorld();
    WString mapname = "Maps/start.map";
    scene = LoadScene(world, mapname);
    for (auto const& entity : world->GetEntities()) {
        auto camera = entity->As<Camera>();
        if (camera) {
            ui = CreateInterface(camera, font, framebufferSize);
            ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f);
            btn = CreateButton("Test",100, 100, 100, 100, ui->root);
            break;
        }
    }
}

int main(int argc, const char* argv[])
{
    RegisterComponents();
    auto displays = GetDisplays();
    auto window = CreateWindow("Leadwerks", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
    framebuffer = CreateFramebuffer(window); 

    font = LoadFont("Fonts/arial.ttf");
    framebufferSize = framebuffer->GetSize();

    loadingWorld = CreateWorld();
    loadingBackground = CreateSprite(loadingWorld, framebuffer->size.width, framebuffer->size.height);
    loadingBackground->SetColor(0.3f, 0.2f, 0.2f);
    loadingCamera = CreateCamera(loadingWorld, PROJECTION_ORTHOGRAPHIC);
    loadingCamera->SetPosition(framebufferSize.x * 0.5f, framebufferSize.y * 0.5f, 0);

    initScene();

    //Main loop
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        if (window->KeyDown(KEY_F9)) {
            initScene();
        }
        world->Update();
        world->Render(framebuffer);
    }

    return 0;
}

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...