File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ template<> TexCoord myMax(TexCoord& a, TexCoord& b)
157157void GLTFExporter::buildAssetEntry ()
158158{
159159 model.asset .version = " 2.0" ;
160- model.asset .generator = " DW1ModelConverter v1.0 " ;
160+ model.asset .generator = " DW1ModelConverter v1.1 " ;
161161}
162162
163163std::size_t GLTFExporter::buildPrimitiveVertex (Mesh& mesh, std::vector<Face> faces)
@@ -374,14 +374,23 @@ int32_t GLTFExporter::buildMaterial(MaterialMode mode)
374374
375375 mat.doubleSided = mode.isDoubleSided ;
376376 if (!mode.hasTranslucency )
377- mat.alphaMode = " OPAQUE" ;
377+ {
378+ mat.alphaMode = " MASK" ;
379+ mat.alphaCutoff = 0 .1f ;
380+ }
378381 else
379382 {
380383 tinygltf::Value::Object extras;
381384 extras.emplace (" blendMode" , std::to_string (mode.mixtureRate ));
382385 mat.extras = tinygltf::Value (extras);
383386 mat.alphaMode = " BLEND" ;
384387 }
388+
389+ if (mode.type == MaterialType::NO_LIGHT)
390+ {
391+ tinygltf::Value unlit;
392+ mat.extensions [" KHR_materials_unlit" ] = unlit;
393+ }
385394
386395 mat.pbrMetallicRoughness .baseColorFactor = { 1 .0f , 1 .0f , 1 .0f , 1 .0f };
387396 if (mode.type != MaterialType::COLOR) mat.pbrMetallicRoughness .baseColorTexture .index = 0 ;
You can’t perform that action at this time.
0 commit comments