Skip to content

Commit

Permalink
Merge pull request KhronosGroup#529 from KhronosGroup/materials-commo…
Browse files Browse the repository at this point in the history
…n-update

Updated converter to newest KHR_materials_common spec
  • Loading branch information
pjcozzi committed Jan 26, 2016
2 parents fa1d62e + 7e1c179 commit cf6371b
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions COLLADA2GLTF/GLTF/GLTFEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,32 +129,8 @@ namespace GLTF
{
if (values->contains(name))
{
shared_ptr<JSONObject> object = make_shared<JSONObject>();
auto value = static_pointer_cast<JSONObject>(values->getValue(name))->getValue(kValue);
uint32_t type;
JSONType jsonType = value->getJSONType();
if (jsonType == kJSONString)
{
type = _GL(SAMPLER_2D);
}
else if (jsonType == kJSONNumber)
{
type = _GL(FLOAT);
}
else if (jsonType == kJSONArray)
{
auto array = static_pointer_cast<JSONArray>(value);
type = _GL(FLOAT_VEC2) + static_cast<uint32_t>(array->getCount() - 2);
}
else
{
return;
}

object->setUnsignedInt32(kType, type);
object->setValue(kValue, value);

materialsCommonValues->setValue(name, object);
materialsCommonValues->setValue(name, value);
}
}

Expand Down

0 comments on commit cf6371b

Please sign in to comment.