Jump to content

No shadows update for an entity when it's a child again


Dreikblack
 Share

Recommended Posts

Steam beta

Pivot have shadows on.

It used to work after fix, but at some point was broken again

image.thumb.png.63fdc2fc9bcf54d1149fbf599a594c4c.pngt

#include "UltraEngine.h"

using namespace UltraEngine;

int main(int argc, const char* argv[]) {
    auto displays = GetDisplays();
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);
    auto framebuffer = CreateFramebuffer(window);
    auto world = CreateWorld();

    //Create a camera
    auto camera = CreateCamera(world);
    camera->SetClearColor(0.125);
    camera->SetFov(70);
    camera->Move(-1, 2, -6);

    //Create light
    auto light = CreatePointLight(world);
    light->SetPosition(0, 3, 0);
    light->SetColor(2);

    //Create ground
    auto ground = CreateBox(world, 20, 1, 20);
    ground->SetPosition(0, -0.5, 0);
    ground->SetColor(0, 0.4f, 0);

    auto pivot = CreatePivot(world);
    pivot->SetPosition(0, 0.5, -1);
    pivot->SetShadows(true);

    auto box = CreateBox(world, 1, 1, 1);
    box->SetPosition(0, 0.5, -1);

    while (window->Closed() == false and window->KeyHit(KEY_ESCAPE) == false) {
        if (window->KeyHit(KEY_SPACE)) {
            box->SetParent(pivot);
        }
        pivot->Turn(0, 2, 0);
        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...