Skip to content

Commit

Permalink
Applied clang-format.
Browse files Browse the repository at this point in the history
  • Loading branch information
saumyaj3 authored and github-actions[bot] committed Apr 25, 2024
1 parent 8577c4c commit 2332d1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MeshVertex
float vertexA0; // 0 (no light) and 1 (full light)
MeshVertex(Point3LL p)
: p_(p)
, vertexA0(0.5)
, vertexA0(0.5)
{
connected_faces_.reserve(8);
} //!< doesn't set connected_faces
Expand Down
5 changes: 3 additions & 2 deletions src/ambientOcclusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ For each vertex in the mesh:
Shoot a large number of rays (e.g., a few hundred) in random directions from the vertex. The higher the number of rays, the higher the quality of the AO approximation.
For each ray, detect if it intersects the geometry of the mesh. This involves performing intersection tests with each face in the mesh.
If the ray is obstructed, count it as an obstruction.
After all rays are tested, divide the number of obstructed rays by the total number of rays to get the AO for that vertex—ranges between 0(signalizing full occlusion) and 1(no occlusion).
Normalize AO values. Because these AO values are typically used as multipliers on color values, we usually want to normalize them to a 0.0 to 1.0 scale. This would likely involve finding the maximum AO value and dividing all AO values by that maximum.
After all rays are tested, divide the number of obstructed rays by the total number of rays to get the AO for that vertex—ranges between 0(signalizing full occlusion) and 1(no
occlusion). Normalize AO values. Because these AO values are typically used as multipliers on color values, we usually want to normalize them to a 0.0 to 1.0 scale. This would
likely involve finding the maximum AO value and dividing all AO values by that maximum.
*/
void AmbientOcclusion::calculate()
{
Expand Down

0 comments on commit 2332d1c

Please sign in to comment.