-
Notifications
You must be signed in to change notification settings - Fork 67
New Geometry Asset classes and Mesh Loader replacements #882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 11 commits
Commits
Show all changes
89 commits
Select commit
Hold shift + click to select a range
f523ef3
initial examples_tests submodule change
87e11e5
clean up the `nbl::hlsl::shapes` namespace a bit
0824014
new classes to replace IMeshBuffer and IMesh
3cf9d25
add a general polygon geometry
3c5e81f
correct typos and allow different geometries in a collection
7f65993
add a set transform callback to `exportForBLAS` this lets us know the…
65e9b72
add important methods and metadata for the `SDataViewBase::encodedDat…
f37cca7
add all missing data streams from ICPUMeshBuffer to IPolygonGeometry
4c7fcb7
Move the requirement for the Position View to be formatted from `IGeo…
30adb9c
correct header name to `ICPUPolygonGeometry` and implement `IAsset` m…
a0a006c
implement visitor properly
30e3bed
add the element encode/decode functions for `IGeometry::SDataView`
57f8905
excise Mesh and MeshBuffer from the asset namespace, reassign Asset T…
3001e24
correct a slight encapsulation leak
07e7176
get rid of now useless metadata classes
c9e8ca8
start cleaning up the mesh manipulator into a geometry manipulator
6a64ede
remove the renderpass independent pipeline from nbl::asset::
fef2ebc
Mesh Packers don't make much sense anymore with programmable vertex p…
7f1302c
add ICPUGeometryCollection
18adf44
hoist most of the BLAS geometry export out of IGeometryCollection
40a8df3
implement ICPUMorphTargets
2c9b860
start removing unnecessary things from PolygonGeometryManipulator
c91f2d7
correct typos, get stuff compiling
0a37d24
fight for more compilation
fd87ce7
outline some ideas about dealing with indexing schemes
144299d
finalize my indexing abstraction logic
0215b88
cauterize more stuff, start working on the Geometry Creator
b5830e7
correct a bunch of typos
c077d6e
get one step closer to compiling
e217665
OBJ should really be a scene loader in the future (just no lights)
8f1564a
in thre interest of thread safety we should not have default manipula…
c0dffe3
get Nabla compiling
cb6d148
update submodule pointer
7077a04
remove last remnanst, and turn off STL /PLY writers for now to let CI…
99efe2a
fix include bug of beziers.hlsl tested with CAD playground example
1f51c33
Merge pull request #885 from Devsh-Graphics-Programming/master
devshgraphicsprogramming 2aa2395
a cry for help to @AnastaZIuk
7f85f18
on road to rework examples PCH and cleaning build system a bit, updat…
AnastaZIuk 2227505
wipe _NBL_APP_NAME_ define reference from nbl/application_templates/M…
AnastaZIuk afac36d
update examples_tests submodule
AnastaZIuk ef0f206
add missing EXCLUDE_FROM_ALL for examples_tests
AnastaZIuk c18c8ae
create NBL_ADJUST_FOLDERS and use for a few namespaces to group targe…
AnastaZIuk c02e5b1
add `Container – Build Examples` step to .github/workflows/build-nabl…
AnastaZIuk 4dedfd6
EXCLUDE_FROM_ALL nite, correct building examples and installing targets
AnastaZIuk 30eff84
implement cube geometry creation
d654a25
get stuff to compile
aae0623
remove cruft
bb6f9e5
add conversion operator from SBufferRange to SBufferBinding
fa02163
implement `fast_affine.hlsl`
5b066f8
get stuff to compile
16b7c53
fix geometry memory issues
8ed377a
implement rectangle and disk
65c2047
fix bad (reverse) implementation of checking validity of `SDataView`
569839e
add `IGPUPolygonGeometry` and attempt AssetConverter implementation f…
1403f33
improve `CAssetConverter` to take into account that not every `asset_…
4eef9f9
get assetConverter to work on `IGPUPolygonGeometry`
2798fba
sync validation TODO
f143d0b
add explicit constructors to `hlsl::matrix` which can cast between ma…
ad27a61
Implement allPreviousStages and allLaterStages
776fb12
Merge remote-tracking branch 'remotes/origin/master' into mesh_loaders
1f52d2f
bring new Assets in line with Stageless Shaders API change
b8c42b2
get as many examples working as possible after the merge
5462fe3
Ready for Arek to work his magic
3fa43e2
something should be on screen but my `fast_affine.hlsl` is busted
4c8c47b
Merge branch 'mesh_loaders' of github.com:Devsh-Graphics-Programming/…
1dc258e
Add itself as next stage and previous stage for all pipeline stages
c42afec
pull Matt and resolve conflicts
AnastaZIuk 961cbdf
update examples_tests submodule
AnastaZIuk f2f5d01
Add -1 to maxVertex
1d9658e
fix bugs in geometry creator and Indexing callback for triangle Fan
3c75ba5
turns out `CGLSLCompiler::preprocessShader` didn't quite work right f…
101ffbc
Merge remote-tracking branch 'remotes/origin/mlBuildUpdates' into mes…
68bd6a9
document the `MonoAssetManagerAndBuiltinResourceApplication.hpp` conu…
7b0e90d
Split `MonoAssetManagerAndBuiltinResourceApplication.hpp` in two, add…
380fefd
update submodule pointer
aae6cd9
@yasinvolved can start testing now
2922244
update examples_tests submodule
5ba8711
add some more invalid usage validation so we don't crash as often
3357c41
get 61 kinda working again
b6be78f
fix phmap_deserialization.h and phmap_serialization.h after API chang…
5ad312c
make patch default constructors `constexpr`
b1efc69
save work before doing format validation on PLY
ab95861
just handling the vertex loading on PLY left
84eafc0
correct parsing mistakes
9186edc
Get vertex attributes and indices loading in PLy loader.
898b259
AABB recomputation function
210cca4
implement more AABB utilities
ebfa0a5
remove redundant builtin assets
92d4ea8
update submodules pre-merge
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule examples_tests
updated
13 files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,176 @@ | ||
| // Copyright (C) 2025-2025 - DevSH Graphics Programming Sp. z O.O. | ||
| // This file is part of the "Nabla Engine". | ||
| // For conditions of distribution and use, see copyright notice in nabla.h | ||
| #ifndef _NBL_ASSET_I_CPU_POLYGON_GEOMETRY_H_INCLUDED_ | ||
| #define _NBL_ASSET_I_CPU_POLYGON_GEOMETRY_H_INCLUDED_ | ||
|
|
||
|
|
||
| #include "nbl/asset/IPolygonGeometry.h" | ||
|
|
||
|
|
||
| namespace nbl::asset | ||
| { | ||
| // | ||
| class NBL_API2 ICPUPolygonGeometry : public IAsset, public IPolygonGeometry<ICPUBuffer> | ||
| { | ||
| using base_t = IPolygonGeometry<ICPUBuffer>; | ||
|
|
||
| public: | ||
| inline ICPUPolygonGeometry() = default; | ||
|
|
||
| constexpr static inline auto AssetType = ET_GEOMETRY; | ||
| inline E_TYPE getAssetType() const override {return AssetType;} | ||
|
|
||
| inline core::smart_refctd_ptr<IAsset> clone(uint32_t _depth=~0u) const | ||
| { | ||
| const auto nextDepth = _depth ? (_depth-1):0; | ||
| auto retval = core::smart_refctd_ptr<ICPUPolygonGeometry>(); | ||
| retval->m_positionView = m_positionView.clone(nextDepth); | ||
| retval->m_jointOBBView = m_jointOBBView.clone(nextDepth); | ||
| retval->m_indexView = m_indexView.clone(nextDepth); | ||
| retval->m_jointWeightViews.reserve(m_jointWeightViews.size()); | ||
| for (const auto& pair : m_jointWeightViews) | ||
| retval->m_jointWeightViews.push_back({ | ||
| .indices = pair.indices.clone(nextDepth), | ||
| .weights = pair.weights.clone(nextDepth) | ||
| }); | ||
| retval->m_auxAttributeViews.reserve(m_auxAttributeViews.size()); | ||
| for (const auto& view : m_auxAttributeViews) | ||
| retval->m_auxAttributeViews.push_back(view.clone(nextDepth)); | ||
| retval->m_normalView = m_normalView.clone(nextDepth); | ||
| retval->m_jointCount = m_jointCount; | ||
| retval->m_verticesForFirst = m_verticesForFirst; | ||
| retval->m_verticesPerSupplementary = m_verticesPerSupplementary; | ||
| return retval; | ||
| } | ||
|
|
||
| // TODO: remove after https://github.com/Devsh-Graphics-Programming/Nabla/pull/871 merge | ||
| inline size_t getDependantCount() const override | ||
| { | ||
| size_t count = 0; | ||
| visitDependents([¤t](const IAsset* dep)->bool | ||
| { | ||
| count++; | ||
| return true; | ||
| } | ||
| ); | ||
| return count; | ||
| } | ||
|
|
||
| // needs to be hidden because of mutability checking | ||
| inline bool setPositionView(SDataView&& view) | ||
| { | ||
| if (isMutable() && view.composed.isFormatted()) | ||
| return base_t::setPositionView(std::move(view)); | ||
| return false; | ||
| } | ||
|
|
||
| // | ||
| inline bool setJointOBBView(SDataView&& view) | ||
| { | ||
| if (isMutable()) | ||
| return base_t::setJointOBBView(std::move(view)); | ||
| return false; | ||
| } | ||
|
|
||
| // Needs to be hidden because ICPU base class shall check mutability | ||
| inline bool setIndexView(SDataView&& view) | ||
| { | ||
| if (isMutable()) | ||
| return base_t::setIndexView(std::move(view)); | ||
| return false; | ||
| } | ||
|
|
||
| // | ||
| inline bool setVerticesForFirst(const uint16_t count) | ||
| { | ||
| if (isMutable()) | ||
| { | ||
| m_verticesForFirst = count; | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| // | ||
| inline bool setVerticesPerSupplementary(const uint16_t count) | ||
| { | ||
| if (isMutable()) | ||
| { | ||
| m_verticesPerSupplementary = count; | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| // | ||
| inline void setNormalView(SDataView&& view) | ||
| { | ||
| if (isMutable()) | ||
| { | ||
| m_normalView = std::move(view); | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| // | ||
| inline bool setJointCount(const uint32_t count) | ||
| { | ||
| if (isMutable()) | ||
| { | ||
| m_jointCount = count; | ||
| return true; | ||
| } | ||
| return false; | ||
| } | ||
|
|
||
| // | ||
| inline const core::vector<SJointWeight>* getJointWeightViews() | ||
| { | ||
| if (isMutable()) | ||
| return m_jointWeightViews; | ||
| return nullptr; | ||
| } | ||
|
|
||
| // | ||
| inline const core::vector<SJointWeight>* getAuxAttributeViews() | ||
| { | ||
| if (isMutable()) | ||
| return m_auxAttributeViews; | ||
| return nullptr; | ||
| } | ||
|
|
||
| protected: | ||
| // | ||
| inline void visitDependents(std::function<bool(const IAsset*)>& visit) const //override | ||
| { | ||
| if (!visit(m_positionView.src.buffer.get())) return; | ||
| if (!visit(m_jointOBBView.src.buffer.get())) return; | ||
| if (!visit(m_indexView.src.buffer.get())) return; | ||
| for (const auto& pair : m_jointWeightViews) | ||
| { | ||
| if (!visit(pair.indices.src.buffer.get())) return; | ||
| if (!visit(pair.weights.src.buffer.get())) return; | ||
| } | ||
| for (const auto& view : m_auxAttributeViews) | ||
| if (!visit(view.src.buffer.get())) return; | ||
| if (!visit(m_normalView.src.buffer.get())) return; | ||
| } | ||
| // TODO: remove after https://github.com/Devsh-Graphics-Programming/Nabla/pull/871 merge | ||
| inline IAsset* getDependant_impl(const size_t ix) override | ||
| { | ||
| const IAsset* retval = nullptr; | ||
| size_t current = 0; | ||
| visitDependents([¤t](const IAsset* dep)->bool | ||
| { | ||
| retval = dep; | ||
| return ix<current++; | ||
| } | ||
| ); | ||
| return const_cast<IAsset*>(retval); | ||
| } | ||
devshgraphicsprogramming marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| } | ||
| #endif | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.