Jump to content

Material not loading shader family?


SpiderPig
 Share

Go to solution Solved by Josh,

Recommended Posts

I might be wrong in what I'm seeing - but based on the console output it seems that loading this material is loading the PBR shader family as the root even though I've specified Unlit.fam as the root in DynamicLine.fam.  Even if this output is correct, it's loading the PBR then deleting it, then loading it again.

DynamicLine.zip

ShaderNotLoadingUnlitFamily.thumb.png.ba111cf5919df7babb1296288b6aa245.png

#include "Engine.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();
    world->SetGravity(0.0f, -2.0f, 0.0f);

    auto camera = CreateCamera(world);
    camera->SetClearColor(0.125);
    camera->SetPosition(0, 0, -2);

    auto light = CreateDirectionalLight(world);
    light->SetRotation(35, 35, 0);

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

    auto mat = LoadMaterial("Materials\\DynamicLine\\DynamicLine.mat");
    box->SetMaterial(mat);

    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {


        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

 

Link to comment
Share on other sites

  • Solution

The PBR shader family gets loaded by default when a new material is created, and when the world is initialize (because it is used as the default shader family for the default material, when no material exists).

  • Thanks 1

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

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...