#ifndef IGL_AMBIENT_OCCLUSION_H #define IGL_AMBIENT_OCCLUSION_H #include #include namespace igl { // Forward define class EmbreeIntersector; // Compute ambient occlusion per given point // // Inputs: // ei EmbreeIntersector containing (V,F) // P #P by 3 list of origin points // N #P by 3 list of origin normals // Outputs: // S #P list of ambient occlusion values between 1 (fully occluded) and 0 // (not occluded) // template < typename DerivedP, typename DerivedN, typename DerivedS > void ambient_occlusion( const igl::EmbreeIntersector & ei, const Eigen::PlainObjectBase & P, const Eigen::PlainObjectBase & N, const int num_samples, Eigen::PlainObjectBase & S); // Wrapper which builds new EmbreeIntersector for (V,F). That's expensive so // avoid this if repeatedly calling. template < typename DerivedV, typename DerivedF, typename DerivedP, typename DerivedN, typename DerivedS > void ambient_occlusion( const Eigen::PlainObjectBase & V, const Eigen::PlainObjectBase & F, const Eigen::PlainObjectBase & P, const Eigen::PlainObjectBase & N, const int num_samples, Eigen::PlainObjectBase & S); }; #ifdef IGL_HEADER_ONLY # include "ambient_occlusion.cpp" #endif #endif