Jump to content

SpiderPig

Developers
  • Posts

    2,272
  • Joined

  • Last visited

Posts posted by SpiderPig

  1. @Andy90 As you posted on Discord, I downloaded your recent project from here.  The problems that I can see are a little different because you've got your teleport function as a component that I'm pretty sure is being deleted when you erase your map so it's causing the issue.  My only advice is put your teleport code somewhere within main.cpp so that it can handle the map changes on the highest level - so that it is not part of the maps your erasing.

    You still need to solve the camera issue by making sure a camera is always available to render too.  These are the only issues that I can see, by fixing it this way I managed to get your game working without crashes.  I think the current errors seem random because of the multithreading and sometimes it's not catching the fact there is no camera.  Welcome to multithreading. :)

  2. @Andy90 I believe I got your original upload to work as you expect it too.

     if (g_window->KeyHit(KEY_ENTER)) {
         if (g_scene != nullptr) {
             g_scene = nullptr;
         }
         else{
             g_scene = LoadMap(g_world, "Maps/TestScene.ultra");
         }
     }
    
     //if (g_scene != NULL) {
         g_itemMover.Update(g_window);
         g_playerInventory->Update(g_window);
         g_world->Update();
         g_world->Render(framebuffer);
    //}

    It seems that setting the scene to nullptr will delete everything but your check to not update and render the world if it was nullptr meant that would never work.  By removing that check and giving it a chance to delete on the first enter press I got it to work.  However, the second issue I saw was the crash to RecordDraw and the framebuffer wasn't actually being cleared.  This was because by deleting the map there was no longer any 3D camera available.

    By adding this line after creating the framebuffer, the above code worked.

    auto g_camera = CreateCamera(g_world);

    The second map also loaded okay and the player could harvest from the rock.  I also got the error with the AnimationBone or something.  I think that was a combination of the lack of 3D camera and not letting the first map actually clear before loading the next one.

    I hope this actually helps and I have not completely barked up the wrong tree. :)

  3. I might have some further info for you Josh.  Create a new C++ project, load up the project in visual studio.  Make this your loop:

    //Main loop
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
      if (window->KeyHit(KEY_SPACE)) {
        Print("------DELETING MAP------");
        scene = nullptr;
      }
    
        world->Update();
        world->Render(framebuffer);
    
    #ifdef STEAM_API_H
        Steamworks::Update();
    #endif
    
    }

    You will see in the output that it says all the material, textures and models are being deleted but nothing actually disappears from the scene.  I think this is because the camera is being deleted with the map.  Hope this helps.  Maybe an error should be thrown if we try to render the world and there is no camera present?

  4. This is an odd one but I believe I have found the issue with it.

    If you load the gltf in the model editor, navigate to one of the meshes (first mesh in the list I think, but doesn't really matter) and browse for the 'Leaves' material.  The leaves should go red, and while the editor updates the leaves should move around a bit.

    However, if the material that you apply (Leaves.mat in this case) has 'alphamask' set as true, the flag 'alphaMode' in the GLTF will be set to 'MASK' and not 'BLEND'.  If 'alphaMode' is set to MASK the custom vertex shader in 'leaves.mat' which turns the leaves red and moves them, doesn't seem to load.  If you manually change this back to BLEND and reload the model, the leaves should be red and move a bit as the window updates.

    Please let me know if I missed anything from the zip.  You may need to change a few file paths in the material / shader family.

    PineTree.zip

    • Thanks 1
  5. This might be considered a bug, I'm not sure.

    With a material open in the editor, if you then edit that material file in an external program the material itself does reload but all the parameters don't update.  Would be nice to have them do so.

    Also the thumbnail for the material doesn't update unless you save the material.  Would be nice to have it update when the file changes perhaps?

    I just noticed all this when using my shader editor on the materials whilst having the editor / material editor open.  It's not a problem, just a luxury. :)

  6. Honestly I'm not sure if this is a bug or something I've done.  Extract this into the main project directory so it can find the textures and shader family and then load it with the editor.  There are no texture slots in the material editor available.  I think it has to do with the shaderfamily because if it's using the default pbr.fam it loads the slots fine.  :huh:

    Foliage.zip

  7. So I'm starting my process in a LUA extension for the editor.

    if process == nil then
    	process = CreateProcess("B:/ShaderMaster.exe")
    end

    I get an error stating it couldn't find one of the files the app needs.

    ProcessError.png.ee18c2890d5f5049b74e384e2d52f682.png

    It's showing that it's looking in a folder relative to the project the editor has open.  I need it to look relative to the process exe because that's where all of it's files are.  I think I can edit my software to fix this but I'm wondering if this can be done simply when creating the process?  Startup arguments perhaps?

  8. I'm browsing for a material that will be common over several GLTF models.  After saving the models with the material assigned I've found by editing the one material it does not update the models that have it assigned.  Upon further inspection of the GLTF file I saw no file reference to the material.  It seems it has just copied the material into the GLTF file.

    Is this intended behavior?  <_<

×
×
  • Create New...