From 2332d1cbda6c64ce1c037bbd6ab8fac78983f512 Mon Sep 17 00:00:00 2001 From: saumyaj3 Date: Thu, 25 Apr 2024 09:00:14 +0000 Subject: [PATCH] Applied clang-format. --- include/mesh.h | 2 +- src/ambientOcclusion.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/mesh.h b/include/mesh.h index 495ba09b9c..e402f23335 100644 --- a/include/mesh.h +++ b/include/mesh.h @@ -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 diff --git a/src/ambientOcclusion.cpp b/src/ambientOcclusion.cpp index a39a77f1f1..3388f16aca 100644 --- a/src/ambientOcclusion.cpp +++ b/src/ambientOcclusion.cpp @@ -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() {