-
Notifications
You must be signed in to change notification settings - Fork 12
Cross Section Tool for Meshes #36
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
Open
alemuntoni
wants to merge
84
commits into
cnr-isti-vclab:main
Choose a base branch
from
alemuntoni:cross_section
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 37 commits
Commits
Show all changes
84 commits
Select commit
Hold shift + click to select a range
4782a9e
[render] add CrossSectionUniforms class
alemuntoni 73726c7
[render] add CrossSectionUniforms shader header
alemuntoni 45d28b3
[render] Add cross-section uniforms and controls to drawable mesh cla…
alemuntoni 9409624
[render] per vertex and per fragment cross section
alemuntoni 9207f49
[render] implement cross section for drawable mesh surface
alemuntoni 16622eb
[render] Refactor cross section settings into CrossSectionSettings cl…
alemuntoni ca6a604
[render] Fix input on surface fragment shaders
alemuntoni 907d79f
[render] Rename settingsUpdated signal to meshRenderSettingsUpdated t…
alemuntoni 6462ce1
[render] CrossSectionSettingsFrame class
alemuntoni aba1c42
[render] Add cross-section controls and signal handlers to settings f…
alemuntoni b0ecf72
[render] add X slider to CrossSectionFrame
alemuntoni 1d11f09
[render] CrossSectionFrame x slider working as expected
alemuntoni 5720c7d
[render] CrossSectionSettingsFrame working
alemuntoni b886a33
Merge branch 'main' into cross_section
alemuntoni d7a0b96
Merge branch 'main' into cross_section
alemuntoni efdaa00
[render] Refactor cross-section discard logic into reusable shader ma…
alemuntoni e6e2f7b
[render] Add cross-section clipping to mesh surface pbr and surface I…
alemuntoni cbf32a3
[render] DrawableMesh: Refactor cross-section uniform updates into up…
alemuntoni c468fbd
[render] Add cross-section clipping support to points_instance shaders
alemuntoni 94ea469
Merge branch 'main' into cross_section
alemuntoni 72739a0
[render] Move CrossSectionSettings from drawable/mesh to render/setti…
alemuntoni 81802a2
[render] Add CrossSection clipping to lines
alemuntoni 42cb29b
[render] Move CrossSectionSettingsFrame to tab widget and update UI s…
alemuntoni 88eb967
[render] separate cross section inputs/outputs in all the shaders
alemuntoni 1f13489
[render] varying.def indent fixes
alemuntoni 7cb33ad
Merge branch 'main' into cross_section
alemuntoni 74d8efe
[render] cross section on primitve points shader
alemuntoni 8203e19
[render] cross section on primitive lines
alemuntoni 4b4d736
[render] small fixes
alemuntoni 6e5c88a
[render] enable cross section for all remaining surface shaders
alemuntoni 5519c74
[space] add isStrictlyBelow and isStrictlyAbove member functions to P…
alemuntoni e969dfb
[render] Add bounds checks and signal blocking to cross-section UI se…
alemuntoni 5d7b8b5
[render] Improve cross section settings handling and UI state synchro…
alemuntoni 2a75ff4
[space] isStrictly[Below/Above] member functions renamed to all[Less/…
alemuntoni b6fb4d6
[render] Refactor CrossSectionSettings bbox logic and fix UI checkbox…
alemuntoni 5f14a15
[render] Add per-fragment flag to uniforms and handle null bounding b…
alemuntoni 3dae7d0
[render] Initialize mCrossSectionFrame to nullptr and update frame on…
alemuntoni 4b59cfe
[render] cpu lines - Apply near-plane clipping to v_worldPos0 and v_w…
alemuntoni 7e8e197
Merge branch 'main' into cross_section
alemuntoni 6b83ef3
Merge branch 'main' into cross_section
alemuntoni f24f616
Merge branch 'main' into cross_section
alemuntoni 570839a
Merge branch 'main' into cross_section
alemuntoni 7066ed2
Merge branch 'main' into cross_section
alemuntoni 943c1bc
[render] fix dx build error
alemuntoni f03ff10
[render] fix CrossSectionSettings lower and upper reset when bbox set
alemuntoni dd8dd52
Merge branch 'main' into cross_section
alemuntoni 55453aa
Merge branch 'main' into cross_section
alemuntoni a8bd1d9
[render] fix msvc build error
alemuntoni eef66d4
Merge branch 'main' into cross_section
alemuntoni 7ad34a9
Merge branch 'main' into cross_section
alemuntoni 40aaf45
[render] fix not renamed settings updated signal
alemuntoni 587f82c
Merge branch 'main' into cross_section
alemuntoni d36a567
Merge branch 'main' into cross_section
alemuntoni f53ae04
[render] Add section-enabled surface shading options and update shade…
alemuntoni eea2629
[render] fix dx error: initialize unused varying variables with defau…
alemuntoni fbf66a4
Merge branch 'main' into cross_section
alemuntoni f9f7325
Merge branch 'main' into cross_section
alemuntoni d99b605
Merge branch 'main' into cross_section
alemuntoni b7ba307
[render] Rename SECTION dimension from ENABLED/DISABLED to ON/OFF in …
alemuntoni b73a1c6
Merge branch 'main' into cross_section
alemuntoni fe6445e
Merge branch 'main' into cross_section
alemuntoni ef19c89
Merge branch 'main' into cross_section
alemuntoni 115faa8
[render] Synchronize cross section settings and bounding boxes in app…
alemuntoni 9473b29
Merge branch 'main' into cross_section
alemuntoni 2ad6421
[render] Add step size control for cross section precision with spin …
alemuntoni 6c7e156
Merge branch 'main' into cross_section
alemuntoni a45b883
Merge branch 'main' into cross_section
alemuntoni e012b80
Merge branch 'main' into cross_section
alemuntoni f7debb6
[render] Add cross section support to point rendering and relevant sh…
alemuntoni 87de1b0
Merge branch 'main' into cross_section
alemuntoni 64985ec
Merge branch 'main' into cross_section
alemuntoni 6e56429
Merge branch 'main' into cross_section
alemuntoni 1e82844
[tests] add cross section tests
alemuntoni eaf80f2
Merge branch 'main' into cross_section
alemuntoni 44c4da5
Merge branch 'main' into cross_section
alemuntoni 8f628fd
[render] using StaticUniforms for CrossSectionSettings
alemuntoni 37c8cdd
Merge branch 'main' into cross_section
alemuntoni 28bbd62
[render] cross section working on new primitive lines
alemuntoni f29e548
[tests] wireframe cross section test
alemuntoni dca96b8
Merge branch 'main' into cross_section
alemuntoni c95ce12
[tests] fix build error
alemuntoni a5d1e7e
Merge branch 'main' into cross_section
alemuntoni f41f7ed
Merge branch 'main' into cross_section
alemuntoni 2b1a1b8
Merge branch 'main' into cross_section
alemuntoni 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
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
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
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
87 changes: 87 additions & 0 deletions
87
vclib/render/include/vclib/bgfx/drawable/uniforms/cross_section_uniforms.h
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,87 @@ | ||
| /***************************************************************************** | ||
| * VCLib * | ||
| * Visual Computing Library * | ||
| * * | ||
| * Copyright(C) 2021-2026 * | ||
| * Visual Computing Lab * | ||
| * ISTI - Italian National Research Council * | ||
| * * | ||
| * All rights reserved. * | ||
| * * | ||
| * This program is free software; you can redistribute it and/or modify * | ||
| * it under the terms of the Mozilla Public License Version 2.0 as published * | ||
| * by the Mozilla Foundation; either version 2 of the License, or * | ||
| * (at your option) any later version. * | ||
| * * | ||
| * This program is distributed in the hope that it will be useful, * | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||
| * Mozilla Public License Version 2.0 * | ||
| * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. * | ||
| ****************************************************************************/ | ||
|
|
||
| #ifndef VCL_BGFX_DRAWABLE_UNIFORMS_CROSS_SECTION_UNIFORMS_H | ||
| #define VCL_BGFX_DRAWABLE_UNIFORMS_CROSS_SECTION_UNIFORMS_H | ||
|
|
||
| #include <vclib/bgfx/uniform.h> | ||
|
|
||
| #include <vclib/space/core.h> | ||
|
|
||
| namespace vcl { | ||
|
|
||
| class CrossSectionUniforms | ||
| { | ||
| inline static std::array<float, 4> sCrossSectionMinData = { | ||
| Point3f::min().x(), // x min | ||
| Point3f::min().y(), // y min | ||
| Point3f::min().z(), // z min | ||
| 0.0 // per-fragment flag | ||
| // (0.0 = per-vertex, 1.0 = per-fragment) | ||
| }; | ||
|
|
||
| inline static std::array<float, 4> sCrossSectionMaxData = { | ||
| Point3f::max().x(), // x max | ||
| Point3f::max().y(), // y max | ||
| Point3f::max().z(), // z max | ||
| 0.0 // unused | ||
| }; | ||
|
|
||
| inline static Uniform sCrossSectionMinDataUniform; | ||
| inline static Uniform sCrossSectionMaxDataUniform; | ||
|
|
||
| public: | ||
| CrossSectionUniforms() = delete; | ||
|
|
||
| static void set( | ||
| const Point3f& minPoint = Point3f::min(), | ||
| const Point3f& maxPoint = Point3f::max(), | ||
| bool perFragment = false) | ||
| { | ||
| sCrossSectionMinData[0] = minPoint.x(); | ||
| sCrossSectionMinData[1] = minPoint.y(); | ||
| sCrossSectionMinData[2] = minPoint.z(); | ||
| sCrossSectionMinData[3] = float(perFragment); | ||
|
|
||
| sCrossSectionMaxData[0] = maxPoint.x(); | ||
| sCrossSectionMaxData[1] = maxPoint.y(); | ||
| sCrossSectionMaxData[2] = maxPoint.z(); | ||
| } | ||
|
|
||
| static void bind() | ||
| { | ||
| // lazy initialization | ||
| // to avoid creating uniforms before bgfx is initialized | ||
| if (!sCrossSectionMinDataUniform.isValid()) | ||
| sCrossSectionMinDataUniform = | ||
| Uniform("u_crossSectionMinData", bgfx::UniformType::Vec4); | ||
| if (!sCrossSectionMaxDataUniform.isValid()) | ||
| sCrossSectionMaxDataUniform = | ||
| Uniform("u_crossSectionMaxData", bgfx::UniformType::Vec4); | ||
| sCrossSectionMinDataUniform.bind(sCrossSectionMinData.data()); | ||
| sCrossSectionMaxDataUniform.bind(sCrossSectionMaxData.data()); | ||
| } | ||
| }; | ||
|
|
||
| } // namespace vcl | ||
|
|
||
| #endif // VCL_BGFX_DRAWABLE_UNIFORMS_CROSS_SECTION_UNIFORMS_H | ||
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
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
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.