-
Notifications
You must be signed in to change notification settings - Fork 6
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
Lines pr v2 #4
Open
bigmat18
wants to merge
117
commits into
cnr-isti-vclab:main
Choose a base branch
from
bigmat18:lines_pr
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
Lines pr v2 #4
+7,395
−124
Conversation
This file contains 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
Merge remote origin/main
# Conflicts: # examples/render/910-viewer-imgui/glfw/main.cpp # examples/render/CMakeLists.txt # vclib/render/include/vclib/bgfx/drawable/drawable_mesh.h # vclib/render/include/vclib/bgfx/drawable/mesh/mesh_render_buffers.h
# Conflicts: # tests/render/000-static-asserts/drawers.h # vclib/render/include/vclib/imgui/imgui_drawer.h
# Conflicts: # examples/render/CMakeLists.txt # vclib/render/include/vclib/bgfx/drawable/drawable_mesh.h # vclib/render/include/vclib/bgfx/drawable/mesh/mesh_render_buffers.h
alemuntoni
reviewed
Feb 7, 2025
vclib/render/src/vclib/bgfx/drawable/lines/polylines/texture_based_polylines.cpp
Outdated
Show resolved
Hide resolved
alemuntoni
reviewed
Feb 7, 2025
Comment on lines
161
to
168
// now, bind uniform for draw | ||
// TODO - this should be the same of before.......... | ||
float indirectData[] = { | ||
static_cast<float>(pointSize - 1), | ||
static_cast<float>(mMaxTextureSize), | ||
0, | ||
0}; | ||
mIndirectData.bind(indirectData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: modify the shaders in order to have this uniform consistent (also with lines implementation).
Choose an order and use the same in all the places.
# Conflicts: # vclib/render/include/vclib/bgfx/drawable/drawable_mesh.h
# Conflicts: # vclib/render/include/vclib/bgfx/drawable/drawable_mesh.h # vclib/render/src/vclib/bgfx/context/embedded_shaders/lines_cpu_generated_vsfs.cpp # vclib/render/src/vclib/bgfx/context/program_manager.cpp
# Conflicts: # vclib/render/include/vclib/bgfx/context/embedded_shaders/drawable_mesh_wireframe.h # vclib/render/include/vclib/bgfx/drawable/drawable_mesh.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/drawable_mesh_wireframe.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/lines_cpu_generated_vsfs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/lines_gpu_generated_cs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/lines_indirect_based_cs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/lines_indirect_based_vsfs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/lines_instancing_based_vsfs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/lines_texture_based_cs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/lines_texture_based_vsfs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/polylines_cpu_generated_vsfs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/polylines_gpu_generated_cs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/polylines_indirect_based_cs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/polylines_indirect_based_joints_vsfs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/polylines_indirect_based_vsfs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/polylines_instancing_based_joints_vsfs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/polylines_instancing_based_vsfs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/polylines_texture_based_cs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/polylines_texture_based_joints_vsfs.h # vclib/render/include/vclib/bgfx/programs/embedded_vf_programs/polylines_texture_based_vsfs.h # vclib/render/include/vclib/bgfx/programs/vert_frag_loader.h # vclib/render/include/vclib/bgfx/programs/vert_frag_program.h # vclib/render/src/vclib/bgfx/context/embedded_shaders/drawable_mesh_wireframe.cpp # vclib/render/src/vclib/bgfx/context/program_manager.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/drawable_mesh_wireframe.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/lines_cpu_generated_vsfs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/lines_gpu_generated_cs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/lines_indirect_based_cs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/lines_indirect_based_vsfs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/lines_instancing_based_vsfs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/lines_texture_based_cs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/lines_texture_based_vsfs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/polylines_cpu_generated_vsfs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/polylines_gpu_generated_cs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/polylines_indirect_based_cs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/polylines_indirect_based_joints_vsfs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/polylines_indirect_based_vsfs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/polylines_instancing_based_joints_vsfs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/polylines_instancing_based_vsfs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/polylines_texture_based_cs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/polylines_texture_based_joints_vsfs.cpp # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/polylines_texture_based_vsfs.cpp
# Conflicts: # vclib/render/include/vclib/bgfx/programs/compute_program.h # vclib/render/src/vclib/bgfx/programs/embedded_vf_programs/lines.cpp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
[render] Adding custom lines system
ToDo:
Major:
LinesVertex
class.std::vector<LinesVertex>
as input.void setPoints(const std::vector<float>& vertCoords, const std::vector<uint>& vertColors = std::vector<uint>(), const std::vector<float>& vertNormals = std::vector<float>());
(this call computes implicitly the line indices)void setPoints(const std::vector<float>& vertCoords, const std::vector<uint>& lineIndices, const std::vector<uint>& vertColors = std::vector<uint>(), const std::vector<float>& vertNormals = std::vector<float>(), std::vector<uint>& lineColors = std::vector<uint>());
void setPoints(uint nVertices, const VertexBuffer& vertCoords, const VertexBuffer& vertColors = VertexBuffer(), const VertexBuffer& vertNormals =VertexBuffer());
void setPoints(uint nVertices, uint nLines, const VertexBuffer& vertCoords, const IndexBuffer& lineIndices, const VertexBuffer& vertColors = VertexBuffer(), const VertexBuffer& vertNormals = VertexBuffer(), const IndexBuffer& lineColors = IndexBuffer());
utils.sh
contained a function calleduintToVec4FloatColor()
, (now renamed touintRGBAToVec4FloatColor()
inshaders_common.sh
); use the one already provided inshaders_common.sh
:uintABGRToVec4Color
(which is inverted)push_back()
. Most of the times it is used without making areserve()
before (and it is possible to do it).<method>Lines
and<method>PolyLines
class is a DrawableObject, but this is not necessary (no need to implement copy and clone for each of them). Only the effective DrawableLines class must be a DrawableObject! (doing this simplifies the next point, since a DrawableObject MUST have available the data necessary to create the buffers always... If each<method>Lines
class is not a DrawableObject, it can avoid to have always the points available. Only the DrawableLines class must have it).PolyLines
bgfx::makeRef
expects that the data is available for two frames (and apparently this constraint becomes more strict when using DynamicBuffers). All the buffers of Lines do not take into account this. This causes crashes on windows-dx11 (always) and sometimes on linux-vulkan.PolyLines
w
error on polylinesMinor:
getSettings()
marked const that returns a non-const pointer...Style:
#pragma once
)vcl::lines
Refactor:
create()
static function pattern in DrawableLines and DrawablePolylines should be revisitedbgfx/drawable/drawable_lines/utils.sh
should be moved tobgfx/shaders_common.sh