Skip to content

Commit

Permalink
fixed RTI PTM scale and bias export
Browse files Browse the repository at this point in the history
  • Loading branch information
ponchio committed Jan 21, 2023
1 parent 2fbfd84 commit ebfe0e5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions relight-cli/rtibuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,13 @@ size_t RtiBuilder::savePTM(const std::string &output) {

for(size_t i = 0; i < gbias.size(); i++) {
int j = coeffRemap[i];
gbias[i] = static_cast<int>(bias[j+3]*255.0);
gscale[i] = scale[j+3];
if(colorspace == LRGB) {
gbias[i] = static_cast<int>(bias[j+3]*255.0);
gscale[i] = scale[j+3];
} else {
gbias[i] = static_cast<int>(bias[j*3]*255.0);
gscale[i] = scale[j*3];
}
}
for(float s: gscale)
stream << s << " ";
Expand Down

0 comments on commit ebfe0e5

Please sign in to comment.