ambient_occlusion.m 479 B

1234567891011121314
  1. % AMBIENT_OCCLUSION Compute ambient occlusion per given point
  2. %
  3. % S = ambient_occlusion(V,F,P,N,num_samples)
  4. %
  5. % Inputs:
  6. % V #V by 3 list of mesh vertex positions
  7. % F #F by 3 list of mesh triangle facet indices into V
  8. % P #P by 3 list of origin points
  9. % N #P by 3 list of origin normals
  10. % num_samples number of samples
  11. % Outputs:
  12. % S #P list of ambient occlusion values between 1 (fully occluded) and 0
  13. % (not occluded)
  14. %