Skip to content

Commit

Permalink
Change writer to only write the alpha cutoff when using mask alpha mo…
Browse files Browse the repository at this point in the history
…de to silence validator (bug jkuhlmann#152).
  • Loading branch information
jkuhlmann committed Aug 24, 2021
1 parent d6751c4 commit 0feaa48
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cgltf_write.h
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,10 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
{
cgltf_write_line(context, "{");
cgltf_write_strprop(context, "name", material->name);
cgltf_write_floatprop(context, "alphaCutoff", material->alpha_cutoff, 0.5f);
if (material->alpha_mode == cgltf_alpha_mode_mask)
{
cgltf_write_floatprop(context, "alphaCutoff", material->alpha_cutoff, 0.5f);
}
cgltf_write_boolprop_optional(context, "doubleSided", material->double_sided, false);
// cgltf_write_boolprop_optional(context, "unlit", material->unlit, false);

Expand Down

0 comments on commit 0feaa48

Please sign in to comment.