Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
efa37a7
Remove wage and store weighted normal instead
Sep 18, 2025
cc4a219
Move getAngleWeight to hlsl/shapes/triangle.hlsl
Oct 4, 2025
c018762
Refactor erase to resize
Oct 4, 2025
42ccf48
Remove parentTriangleFaceNormal from SSNGVertexData
Oct 4, 2025
05ee8ed
Refactor getNeighboringCells
Oct 4, 2025
f4b8ac6
Slight improvement for readability
Oct 4, 2025
0dd02e8
Refactor Radix Sorter and use histogram as skip list
Oct 6, 2025
ce99287
Move VertexHashMap into its own file
Oct 7, 2025
28f73f5
Refactor smooth normal generator to use VertexHashGrid and separate w…
Oct 18, 2025
5acb40d
Fix normal comparison to use dot instead of value by value comparison
Oct 18, 2025
0feb4e9
Merge branch 'master' into smooth_normal_calculation
Oct 21, 2025
7424828
Fix triangle.hlsl
Oct 26, 2025
d078b2c
Rename LSBSorter to RadixLSBSorter
Oct 26, 2025
e72e0ef
Add comment for future task
Oct 26, 2025
e91aba1
Refactor CVertexHashGrid
Oct 27, 2025
509b359
Make radix sort more efficient
Oct 27, 2025
a30ef6f
Change type of index in SSNGVertexData
Oct 27, 2025
c580d72
Move CanJoinVertices to CVertexWelder
Oct 27, 2025
5af4a9b
Move SSNGVertexData and VxCmpFunction to CSmoothNormalGenerator
Oct 28, 2025
39e288c
Add comment
Oct 28, 2025
c49d8d1
Add overload for CVertexHashGrid::forEachBroadphaseNeighborCandidates…
Nov 2, 2025
c688f7b
Add inline specifier to a bunch of method
Nov 2, 2025
c521f95
use 0 base indexing for edge and vertex in compInternalAngle
Nov 2, 2025
a7aae4d
Iterate backward when gatherin histogram frequency for better cache l…
Nov 2, 2025
4a5c490
Refactor CVertexWelder to use abstract class for WeldPredicate instea…
Nov 2, 2025
82f9820
Add concept for Vertex Welder AccelerationStructure
Nov 3, 2025
401f1bb
Fix virtual destructor for WeldPredicate
Nov 3, 2025
9b007d2
Return nullptr if vertex contain INVALID_INDEX
Nov 3, 2025
7d31750
Reindent CVertexHashGrid to use tabs
Nov 3, 2025
4699173
Reindent CPolygonGeometryManipulator to use TABS
Nov 3, 2025
e65297b
Add diagram to explain why we choose cellSize to be twice as epsilon
Nov 3, 2025
dbffea5
Improve Diagram
Nov 3, 2025
ad0646e
Improve the explanation of VertexHashGrid
Nov 3, 2025
60ec970
Improve comment
Nov 3, 2025
7ebd7d0
Fix wrong iteration order
Nov 3, 2025
087beb8
Fix compInternalAngle
Nov 3, 2025
6d4b794
Fix method specifier in radix_sort.h
Nov 3, 2025
0cdf7e8
Fix variable and function specifier
Nov 3, 2025
4dbcbeb
Fix the patchedEpsilon
Nov 3, 2025
ff42165
Remove inline specifier for function that is defined in cpp
Nov 3, 2025
94c65b6
Remove forEachBroadphaseNeighborCandidates overload that takes vertex…
Nov 3, 2025
38ef627
Add inline specifier for method in CVertexWelder
Nov 3, 2025
bfba9fa
Refactor class name for SSNGVertexData
Nov 3, 2025
f3d9a19
Add inline specifier for DefaultWeldPredicate constructor and destructor
Nov 3, 2025
f5d38f2
Remove outdated TODO
Nov 3, 2025
cc39901
Slight refactor for SSNGVertexData alias
Nov 3, 2025
1257d4d
Add comment to implement a class template of CVertexHashGrid and CSmo…
Nov 6, 2025
d2503af
Add some assert in isAttributeValEqual and isAttributeDirEqual
Nov 6, 2025
1386fba
Cache channelCount and byte size in init
Nov 6, 2025
ac2ed54
Fix weldVertices
Nov 6, 2025
fe55595
Small fixes in CVertexWelder
Nov 6, 2025
4391433
fix compiler warning
devshgraphicsprogramming Nov 7, 2025
bd102e4
Update CSmoothNormalGenerator.cpp
devshgraphicsprogramming Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/nbl/asset/utils/CPolygonGeometryManipulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@ class NBL_API2 CPolygonGeometryManipulator
EEM_COUNT
};

static core::smart_refctd_ptr<ICPUPolygonGeometry> createUnweldedList(const ICPUPolygonGeometry* inGeo);
static inline core::smart_refctd_ptr<ICPUPolygonGeometry> createUnweldedList(const ICPUPolygonGeometry* inGeo);

using SSNGVxCmpFunction = CSmoothNormalGenerator::VxCmpFunction;
static core::smart_refctd_ptr<ICPUPolygonGeometry> createSmoothVertexNormal(const ICPUPolygonGeometry* inbuffer, bool enableWelding = false, float epsilon = 1.525e-5f,
static inline core::smart_refctd_ptr<ICPUPolygonGeometry> createSmoothVertexNormal(const ICPUPolygonGeometry* inbuffer, bool enableWelding = false, float epsilon = 1.525e-5f,
SSNGVxCmpFunction vxcmp = [](const CSmoothNormalGenerator::SSNGVertexData& v0, const CSmoothNormalGenerator::SSNGVertexData& v1, const ICPUPolygonGeometry* buffer)
{
static constexpr float cosOf45Deg = 0.70710678118f;
Expand Down
10 changes: 5 additions & 5 deletions include/nbl/asset/utils/CVertexHashGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class CVertexHashGrid
if (!std::invoke(std::forward<Fn>(fn), neighborVertex)) break;
}
}
};
}

template <HashGridIteratorFn<VertexData> Fn>
inline void forEachBroadphaseNeighborCandidates(const hlsl::float32_t3& position, Fn&& fn) const
Expand All @@ -102,7 +102,7 @@ class CVertexHashGrid
if (!std::invoke(std::forward<Fn>(fn), neighborVertex)) break;
}
}
};
}

private:
struct KeyAccessor
Expand All @@ -116,9 +116,9 @@ class CVertexHashGrid
}
};

static constexpr uint32_t primeNumber1 = 73856093;
static constexpr uint32_t primeNumber2 = 19349663;
static constexpr uint32_t primeNumber3 = 83492791;
static constexpr inline uint32_t primeNumber1 = 73856093;
static constexpr inline uint32_t primeNumber2 = 19349663;
static constexpr inline uint32_t primeNumber3 = 83492791;

using sorter_t = std::variant<
core::RadixLsbSorter<KeyAccessor::key_bit_count, uint16_t>,
Expand Down
2 changes: 1 addition & 1 deletion include/nbl/asset/utils/CVertexWelder.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class CVertexWelder {
const auto& positionView = polygon->getPositionView();
const auto vertexCount = positionView.getElementCount();

static constexpr auto INVALID_INDEX = std::numeric_limits<uint32_t>::max();
constexpr auto INVALID_INDEX = std::numeric_limits<uint32_t>::max();
core::vector<uint32_t> remappedVertexIndexes(vertexCount);
std::fill(remappedVertexIndexes.begin(), remappedVertexIndexes.end(), INVALID_INDEX);

Expand Down