mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Add binary glTF (.glb) support
This commit is contained in:
committed by
Lars Müller
parent
7e4919c6ed
commit
521e678d39
@@ -827,7 +827,7 @@ bool Client::loadMedia(const std::string &data, const std::string &filename,
|
||||
}
|
||||
|
||||
const char *model_ext[] = {
|
||||
".x", ".b3d", ".obj", ".gltf",
|
||||
".x", ".b3d", ".obj", ".gltf", ".glb",
|
||||
NULL
|
||||
};
|
||||
name = removeStringEnd(filename, model_ext);
|
||||
|
@@ -2519,7 +2519,7 @@ bool Server::addMediaFile(const std::string &filename,
|
||||
const char *supported_ext[] = {
|
||||
".png", ".jpg", ".bmp", ".tga",
|
||||
".ogg",
|
||||
".x", ".b3d", ".obj", ".gltf",
|
||||
".x", ".b3d", ".obj", ".gltf", ".glb",
|
||||
// Custom translation file format
|
||||
".tr",
|
||||
NULL
|
||||
|
@@ -87,7 +87,10 @@ SECTION("minimal triangle") {
|
||||
}
|
||||
|
||||
SECTION("blender cube") {
|
||||
const auto mesh = loadMesh(model_stem + "blender_cube.gltf");
|
||||
const auto path = GENERATE(
|
||||
model_stem + "blender_cube.gltf",
|
||||
model_stem + "blender_cube.glb");
|
||||
const auto mesh = loadMesh(path);
|
||||
REQUIRE(mesh);
|
||||
REQUIRE(mesh->getMeshBufferCount() == 1);
|
||||
SECTION("vertex coordinates are correct") {
|
||||
|
Reference in New Issue
Block a user