Jump to content

Josh

Staff
  • Posts

    23,226
  • Joined

  • Last visited

Community Answers

  1. Josh's post in Deleting widgets was marked as the answer   
    I changed the function definition to support NULL for the parent parameter.
  2. Josh's post in In widgets font var is nullptr was marked as the answer   
    This is a protected member that was meant for possible future development. I am making this member private.
    I also added a read-only font member to the Interface class. This will only be non-NULL when a 3D GUI is created.
  3. Josh's post in game EXE - I can't find a reference to fullscreen was marked as the answer   
    It appears the cursor constants are not exposed to Lua. I will add that now.
    In the meantime you can do this:
    window:SetCursor(0)
  4. Josh's post in Render to Target with MSAA? was marked as the answer   
    Fixed.
  5. Josh's post in AlphaMask hides mesh in game & thumbnail was marked as the answer   
    Okay, it was just a missing shader combo.
  6. Josh's post in Posteffects are multiplied by rearranging them in the editor was marked as the answer   
    This will be fixed in a build later today.
  7. Josh's post in Created camera doesn't get icon in the viewport until close/reopen the scene again was marked as the answer   
    It just needed a matrix update to be forced for some reason, to update the sprite entity showing the icon. This is fixed for the next build.
  8. Josh's post in Editor can't see subfolders in zip archive was marked as the answer   
    Okay, I just had to make a small change to the way the zip file names are evaluated.
  9. Josh's post in Help me here assets no Downloading on LE. was marked as the answer   
    You can also just navigate to the Leadwerks folder inside the Steam install path, and in a folder "DLC" you will find a zip for each DLC you have. You can just extract the contents of the zip to your project to use it.
  10. Josh's post in Copied entities seems share same component in editor was marked as the answer   
    I was able to solve this problem simply by changing this code:
    entity->exportproperties = exportproperties; entity->importproperties = importproperties; To this:
    entity->exportproperties = exportproperties.copy(); entity->importproperties = importproperties.copy(); The fix will be in the next build that goes up.
  11. Josh's post in Can't load a file from a package was marked as the answer   
    I replaced ziplib with libzip  in the next build.
    Packages are now read-only. Package file names are now case-insensitive. >4 gb files should be supported. AES encryption should be supported, although I have not tried it yet.
  12. Josh's post in Worlds-Settings bug summary was marked as the answer   
    #1 won't be changed. Environment maps have to be set for older map files.
    #2 will be fixed in the next build.
  13. Josh's post in libraries damaged (0.9.5 Build 567) was marked as the answer   
    fixed.
  14. Josh's post in Shader Family's missing? was marked as the answer   
    Fix is incoming. Sketchfab models use this a lot.

  15. Josh's post in Can't save model with collider as NONE was marked as the answer   
    Fixed for next build.
  16. Josh's post in Label text breaks if font and text was changed in real time was marked as the answer   
    Fixed for tomorrow's build.
  17. Josh's post in Converting was marked as the answer   
    The collider file contains parts that are convex hulls with zero vertices. I did not realize this was even possible. I added some checks to prevent this from causing a problem in the future.
  18. Josh's post in Blender exporter for colliders was marked as the answer   
    Sure. It's a JSON string followed by byte 0, and then any binary data follows that. All offsets are relative to the start of the binary data, not its absolute position in the file.
    bool Collider::Save(const WString& path, const SaveFlags flags) { auto binstream = CreateBufferStream(); auto stream = WriteFile(path); if (stream == NULL) return false; nlohmann::json j3 = nlohmann::json::object(); if (shapeid == COLLIDER_COMPOUND) { j3["collider"]["parts"] = nlohmann::json::array(); for (int n = 0; n < this->subshapes.size(); ++n) { nlohmann::json subshape; switch (subshapes[n]->shapeid) { case COLLIDER_BOX: subshape["shape"] = "BOX"; break; case COLLIDER_CYLINDER: subshape["shape"] = "CYLINDER"; break; case COLLIDER_SPHERE: subshape["shape"] = "SPHERE"; break; case COLLIDER_CONE: subshape["shape"] = "CONE"; break; case COLLIDER_MESH: subshape["shape"] = "MESH"; j3["collider"]["optimized"] = subshapes[n]->optimizemesh; break; case COLLIDER_CONVEXHULL: subshape["shape"] = "CONVEXHULL"; j3["collider"]["tolerance"] = subshapes[n]->tolerance; break; } if (subshapes[n]->shapeid == COLLIDER_CONVEXHULL) { subshape["vertices"] = subshapes[n]->finalvertices.size(); subshape["data"] = binstream->GetSize(); for (const auto v : subshapes[n]->finalvertices) { binstream->WriteFloat(v.x); binstream->WriteFloat(v.y); binstream->WriteFloat(v.z); } } else if (subshapes[n]->shapeid == COLLIDER_MESH) { subshape["faces"] = subshapes[n]->meshfaces.size(); subshape["data"] = binstream->GetSize(); for (const auto& face : subshapes[n]->meshfaces) { binstream->WriteInt(face.size()); for (const auto& pos : face) { binstream->WriteFloat(pos.x); binstream->WriteFloat(pos.y); binstream->WriteFloat(pos.z); } } } else { subshape["size"] = { subshapes[n]->size.x, subshapes[n]->size.y, subshapes[n]->size.z }; subshape["offset"] = { subshapes[n]->position.x, subshapes[n]->position.y, subshapes[n]->position.z }; subshape["rotation"] = { subshapes[n]->rotation.x, subshapes[n]->rotation.y, subshapes[n]->rotation.z }; } j3["collider"]["parts"].push_back(subshape); } } else { j3["collider"]["parts"] = nlohmann::json::array(); j3["collider"]["parts"].push_back({}); switch (shapeid) { case COLLIDER_BOX: j3["collider"]["parts"][0]["shape"] = "BOX"; break; case COLLIDER_CYLINDER: j3["collider"]["parts"][0]["shape"] = "CYLINDER"; break; case COLLIDER_CHAMFERCYLINDER: j3["collider"]["parts"][0]["shape"] = "CHAMFERCYLINDER"; break; case COLLIDER_CAPSULE: j3["collider"]["parts"][0]["shape"] = "CAPSULE"; break; case COLLIDER_SPHERE: j3["collider"]["parts"][0]["shape"] = "SPHERE"; break; case COLLIDER_CONE: j3["collider"]["parts"][0]["shape"] = "CONE"; break; case COLLIDER_MESH: j3["collider"]["optimized"] = optimizemesh; j3["collider"]["parts"][0]["shape"] = "MESH"; break; case COLLIDER_CONVEXHULL: j3["collider"]["tolerance"] = tolerance; j3["collider"]["parts"][0]["shape"] = "CONVEXHULL"; break; } if (shapeid == COLLIDER_MESH) { j3["collider"]["parts"][0]["faces"] = meshfaces.size(); j3["collider"]["parts"][0]["data"] = binstream->GetSize(); for (const auto& face : meshfaces) { binstream->WriteInt(face.size()); for (const auto& pos : face) { binstream->WriteFloat(pos.x); binstream->WriteFloat(pos.y); binstream->WriteFloat(pos.z); } } } else if (shapeid == COLLIDER_CONVEXHULL) { j3["collider"]["parts"][0]["vertices"] = finalvertices.size(); j3["collider"]["parts"][0]["data"] = binstream->GetSize(); for (const auto v : finalvertices) { binstream->WriteFloat(v.x); binstream->WriteFloat(v.y); binstream->WriteFloat(v.z); } } else { j3["collider"]["parts"][0]["size"] = { size.x, size.y, size.z }; j3["collider"]["parts"][0]["offset"] = { position.x, position.y, position.z }; j3["collider"]["parts"][0]["rotation"] = { rotation.x, rotation.y, rotation.z }; } } if (not properties.empty()) j3["extras"] = properties; stream->WriteString(j3.dump(1, ' '), false); if (binstream->GetSize()) { stream->WriteByte(0); stream->Write(binstream->data->Data(), binstream->GetSize()); } stream->Close(); return true; }  
  19. Josh's post in Build, Play, Debug was marked as the answer   
    I was able to update the standalone now.
  20. Josh's post in 0.9.5 seems slower than 0.9.4 was marked as the answer   
    It actually makes sense why your colors were flipping back and forth.
    The bindless texture override in the shader family was not being taken into account in the sorting, so it was just random. So sometimes your trees were being rendered with the more expensive terrain shader.
  21. Josh's post in OpenGL 4.6 backend - is maybe planned in future ? was marked as the answer   
    OpenGL 4.6 is the only renderer in version 0.9.5. I talked about it for an hour in this video:
    To support older hardware, I just need to write one alternative code path for systems that don't support bindless textures. OpenGL 4.6 support goes all the way back to:
    Nvidia GEForce 420 AMD Radeon RX 5300M Intel HD Graphics 520
  22. Josh's post in .cpp error causing crash to desktop when applying material to terrain was marked as the answer   
    I added the missing format. However, there are a few rules for terrain textures in 0.9.5 to take note of:
     All textures on one terrain must be the same size. There is an additional argument in the CreateTerrain function that lets you specify this size. I have not added a control in the editor yet to let you adjust the size of a terrain that is being created. The default size is 1024. Base color, metallic-roughness, and emission textures used in a terrain must be in format BC7. Displacement textures used in a terrain must be Luminance format (single channel 8 bit grayscale). Normal maps used in a terrain must be BC5 format. The reason for this is that array textures are now being used for terrain rendering. This solves the problems we were seeing with pixels on the borders invocation groups and will help make the engine runnable on a wider range of hardware.
    This zip file does not include any textures.
     
  23. Josh's post in SetColor not applied at all in release, and sometimes in debug was marked as the answer   
    I found the cause.
    In the visibility list, meshes are grouped by pipeline settings. This is all the different rendering settings, plus the shader in use.
    The pipeline settings has a < operator for sorting. This is how the grouping is done.
    I added a setting in the shader family to force bindless textures off, but did not add any sorting for this in the < operator in the pipeline settings class.
    As a result, your sphere was probably getting rendered using the terrain shader.
    Once I added the needed fix the problem went away.
  24. Josh's post in Shadow Maps Not Using Correct Shaders was marked as the answer   
    Fix is incoming.

  25. Josh's post in Can't select model in editor was marked as the answer   
    I am changing it to use the highest-res LOD.
×
×
  • Create New...