Jump to content

Recommended Posts

Posted

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.

Let's build cool stuff and have fun. :)

Posted

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;
}

 

  • Like 1

Let's build cool stuff and have fun. :)

Posted
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;
}

 

image.thumb.png.ec0c647a851eba82916237a9c8aabaab.png

 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.

image.png.e5471841868eb094732c4af01333d331.png

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted

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. 

image.png.fab2d5d58c629f029312ae1319d542c8.png

  • Thanks 1

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted

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;
}

 

  • Like 1

Let's build cool stuff and have fun. :)

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.

×
×
  • Create New...