Skip to content

Commit

Permalink
fixing lenticular flag
Browse files Browse the repository at this point in the history
  • Loading branch information
patriciogonzalezvivo committed Nov 23, 2023
1 parent 23481b3 commit c642119
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion deps/lygia
Submodule lygia updated 986 files
2 changes: 1 addition & 1 deletion deps/vera
4 changes: 2 additions & 2 deletions src/core/sandbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,11 +814,11 @@ void Sandbox::commandsInit(CommandList &_commands ) {

std::vector<std::string> values = vera::split(_line,',');
if (values.size() == 2) {
uniforms.activeCamera->setFOV( vera::toFloat(values[1]) );
uniforms.activeCamera->setFOV( glm::radians(vera::toFloat(values[1])) );
return true;
}
else {
std::cout << uniforms.activeCamera->getFOV() << std::endl;
std::cout << glm::degrees(uniforms.activeCamera->getFOV()) << std::endl;
return true;
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/core/uniforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Uniforms::Uniforms() : m_frame(0), m_play(true), m_change(false) {
//
functions["u_iblLuminance"] = UniformFunction("float", [this](vera::Shader& _shader) {
if (activeCamera)
_shader.setUniform("u_iblLuminance", 30000.0f * activeCamera->getExposure());
_shader.setUniform("u_iblLuminance", float(30000.0 * activeCamera->getExposure()));
},
[this]() {
if (activeCamera)
Expand Down Expand Up @@ -150,7 +150,7 @@ Uniforms::Uniforms() : m_frame(0), m_play(true), m_change(false) {

functions["u_cameraExposure"] = UniformFunction("float", [this](vera::Shader& _shader) {
if (activeCamera)
_shader.setUniform("u_cameraExposure", activeCamera->getExposure());
_shader.setUniform("u_cameraExposure", float(activeCamera->getExposure()));
},
[this]() {
if (activeCamera)
Expand Down
13 changes: 8 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,7 @@ int main(int argc, char **argv) {
argument == "-headless" || argument == "--headless" ||
argument == "-help" || argument == "--help" ||
argument == "-msaa" || argument == "--msaa" ||
argument == "-undecorated" || argument == "--undecorated" ||
argument == "-lenticular" || argument == "--lenticular") {
argument == "-undecorated" || argument == "--undecorated") {
}

// Change internal states with no second parameter
Expand Down Expand Up @@ -469,10 +468,14 @@ int main(int argc, char **argv) {
std::string calibration_file = "default";
if (i+1 < argc) {
calibration_file = std::string(argv[i+1]);
if (vera::urlExists(calibration_file) && vera::haveExt(calibration_file,"json")) i++;
else calibration_file = "default";
} else
if (vera::urlExists(calibration_file) && vera::haveExt(calibration_file,"json"))
i++;
else
calibration_file = "default";
}
else
std::cout << "Argument '" << argument << "' should be followed by a path to calibration JSON file" << std::endl;

sandbox.lenticular = calibration_file;
if (sandbox.quilt == -1)
sandbox.quilt = 0;
Expand Down

0 comments on commit c642119

Please sign in to comment.