message: Naively create luminous material for any material with emissiveFactor
diff: @@ -692,6 +692,9 @@ namespace ospray {
  // << " .baseColorFactor.alpha:" << (float)pbr.baseColorFactor[4]
  // << "\n";
  + auto emissiveColor = vec3f(
  + mat.emissiveFactor[0], mat.emissiveFactor[1], mat.emissiveFactor[2]);
  + if (emissiveColor == vec3f(0.f)) {
  auto ospMat = createNode(matName, "principled");
  ospMat->createChild("baseColor", "rgb") = vec3f(
  pbr.baseColorFactor[0], pbr.baseColorFactor[1], pbr.baseColorFactor[2]);
  @@ -712,8 +715,7 @@ namespace ospray {
  // supports one set of texcoords (TEXCOORD_0).
  if (pbr.baseColorTexture.texCoord != 0
  || pbr.metallicRoughnessTexture.texCoord != 0
  - || mat.normalTexture.texCoord != 0
  - || mat.emissiveTexture.texCoord != 0) {
  + || mat.normalTexture.texCoord != 0) {
  WARN << "gltf found TEXCOOR_1 attribute. Not supported...\n"
  << std::endl;
  }
  @@ -746,12 +748,22 @@ namespace ospray {
  }
  #endif
  + return ospMat;
  +
  + } else {
  // XXX TODO Principled material doesn't have emissive params yet
  - auto emissiveColor = vec3f(
  - mat.emissiveFactor[0], mat.emissiveFactor[1], mat.emissiveFactor[2]);
  + // So, use a luminous instead
  + auto ospMat = createNode(matName, "luminous");
  +
  if (emissiveColor != vec3f(0.f)) {
  WARN << "Material has emissiveFactor = " << emissiveColor << "\n";
  - ospMat->createChild("emissiveColor", "rgb") = emissiveColor;
  + ospMat->createChild("color", "vec3f") = emissiveColor;
  + ospMat->createChild("intensity", "float") = 10.f;
  + }
  +
  + if (mat.emissiveTexture.texCoord != 0) {
  + WARN << "gltf found TEXCOOR_1 attribute. Not supported...\n"
  + << std::endl;
  }
  if (mat.emissiveTexture.index != -1 && mat.emissiveTexture.texCoord == 0) {
  @@ -762,6 +774,7 @@ namespace ospray {
  return ospMat;
  }
  + }
  NodePtr GLTFData::createOSPTexture(const std::string &texParam,
  const tinygltf::Texture &tex,
  