Skip to content

Commit

Permalink
Add lookior bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Speierer authored and njroussel committed Sep 19, 2023
1 parent 0d5e12e commit d598d79
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/render/python/fresnel_v.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <mitsuba/render/ior.h>
#include <mitsuba/render/fresnel.h>
#include <mitsuba/python/python.h>

Expand Down Expand Up @@ -25,5 +26,13 @@ MI_PY_EXPORT(fresnel) {
py::overload_cast<const Vector3f &, const Normal3f &, Float, Float>(&refract<Float>),
"wi"_a, "m"_a, "cos_theta_t"_a, "eta_ti"_a, D(refract, 2))
.def("fresnel_diffuse_reflectance", &fresnel_diffuse_reflectance<Float>,
"eta"_a, D(fresnel_diffuse_reflectance));
"eta"_a, D(fresnel_diffuse_reflectance))
.def("lookup_ior",
[](const Properties &props, const std::string& name, py::object def) {
if (py::isinstance<py::float_>(def))
return lookup_ior(props, name, def.template cast<Properties::Float>());
return lookup_ior(props, name, def.template cast<std::string>());
},
"properties"_a, "name"_a, "default"_a,
"Lookup IOR value in table.");
}

0 comments on commit d598d79

Please sign in to comment.