2
0
Эх сурвалжийг харах

[+] Use "buffer" ID against "bufferView" ID for Open3DGC-compression.

Alexandr Arutjunov 9 жил өмнө
parent
commit
778ad7f06f

+ 1 - 1
code/glTFAsset.h

@@ -736,7 +736,7 @@ namespace glTF
 		{
 		{
 			using SExtension::Type;
 			using SExtension::Type;
 
 
-			std::string BufferView;///< Name of "bufferView" used for storing compressed data.
+			std::string Buffer;///< ID of "buffer" used for storing compressed data.
 			size_t Offset;///< Offset in "bufferView" where compressed data are stored.
 			size_t Offset;///< Offset in "bufferView" where compressed data are stored.
 			size_t Count;///< Count of elements in compressed data. Is always equivalent to size in bytes: look comments for "Type" and "Component_Type".
 			size_t Count;///< Count of elements in compressed data. Is always equivalent to size in bytes: look comments for "Type" and "Component_Type".
 			size_t IndicesCount;///< Count of indices in mesh.
 			size_t IndicesCount;///< Count of indices in mesh.

+ 1 - 1
code/glTFAssetWriter.inl

@@ -219,7 +219,7 @@ namespace glTF {
 
 
 							// filling object "compressedData"
 							// filling object "compressedData"
 							json_comp_data.SetObject();
 							json_comp_data.SetObject();
-							json_comp_data.AddMember("bufferView", ptr_ext_comp->BufferView, w.mAl);
+							json_comp_data.AddMember("buffer", ptr_ext_comp->Buffer, w.mAl);
 							json_comp_data.AddMember("byteOffset", ptr_ext_comp->Offset, w.mAl);
 							json_comp_data.AddMember("byteOffset", ptr_ext_comp->Offset, w.mAl);
 							json_comp_data.AddMember("componentType", 5121, w.mAl);
 							json_comp_data.AddMember("componentType", 5121, w.mAl);
 							json_comp_data.AddMember("type", "SCALAR", w.mAl);
 							json_comp_data.AddMember("type", "SCALAR", w.mAl);

+ 1 - 1
code/glTFExporter.cpp

@@ -426,7 +426,7 @@ bool comp_allow;// Point that data of current mesh can be compressed.
 			Mesh::SCompression_Open3DGC* ext = new Mesh::SCompression_Open3DGC;
 			Mesh::SCompression_Open3DGC* ext = new Mesh::SCompression_Open3DGC;
 
 
 			// Fill it.
 			// Fill it.
-			ext->BufferView = p.indices->bufferView->id;
+			ext->Buffer = b->id;
 			ext->Offset = idx_srcdata_begin;
 			ext->Offset = idx_srcdata_begin;
 			ext->Count = b->byteLength - idx_srcdata_begin;
 			ext->Count = b->byteLength - idx_srcdata_begin;
 			ext->IndicesCount = comp_o3dgc_ifs.GetNCoordIndex();
 			ext->IndicesCount = comp_o3dgc_ifs.GetNCoordIndex();