Skip to content

Commit

Permalink
CA-124 CSR Support for Layered
Browse files Browse the repository at this point in the history
  • Loading branch information
connortbot committed Sep 30, 2024
1 parent 03c4db2 commit 82be8b7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/parsers/csr_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ std::shared_ptr<Scene> CSRParser::parseCSR(std::string& filePath, RTCDevice devi
mats.push_back(materials[readStringProperty(mixed)]);
}
materials[readStringProperty(materialId)] = make_shared<MixtureBSDF>(weights, mats);
} else if (materialType == "Layered") {
std::string materialId, top, bottom, medium;
getNextLine(file, materialId); getNextLine(file, top); getNextLine(file, bottom); getNextLine(file, medium);
materials[readStringProperty(materialId)] = make_shared<LayeredBSDF>(
materials[readStringProperty(top)],
materials[readStringProperty(bottom)],
(readStringProperty(medium) == "no") ? nullptr : mediums[readStringProperty(medium)]
);
} else {
rtcReleaseDevice(device);
throw std::runtime_error("Material type UNDEFINED: Material[Lambertian|Metal|Dielectric|Emissive]");
Expand Down

0 comments on commit 82be8b7

Please sign in to comment.