remove lines geometry shader, make 3d lines instanced - #9
Open
ViperMiniQ wants to merge 3 commits into
Open
Conversation
- build line segments using pointA and pointB attributes - pass additional pointC to line_joins shader for calculating the joins - render joins as a separate instances (second pass)
wonder-sk
reviewed
Aug 31, 2026
| out << " " << getVertexIndex( i ); | ||
| out << "\n"; | ||
| for ( int i = 0; i + 1 < mIndexes.size(); i += 2 ) | ||
| out << "l " << getVertexIndex( i ) << " " << getVertexIndex( i + 1 ) << "\n"; |
There was a problem hiding this comment.
is this valid? we're not using LineStrip geometry type anymore...
| Qt3DCore::QAttribute *pointBAttribute = findAttribute( geom, u"pointB"_s, Qt3DCore::QAttribute::VertexAttribute ); | ||
| Qt3DCore::QAttribute *pointCAttribute = findAttribute( geom, u"pointC"_s, Qt3DCore::QAttribute::VertexAttribute ); | ||
| if ( !pointAAttribute || !pointBAttribute || pointCAttribute ) | ||
| continue; |
There was a problem hiding this comment.
this is looking at pointA+B+C - does it mean this is using attributes from line joins? if that's the case - a line with 3 segments has just 2 joins, so we will be missing one segment from linestring?
| calloutRenderer->setPrimitiveRestartEnabled( true ); | ||
| calloutRenderer->setRestartIndexValue( 0 ); | ||
| calloutRenderer->setVertexCount( 6 ); | ||
| calloutRenderer->setInstanceCount( lineData.pointsA.size() ); |
There was a problem hiding this comment.
also here, shall we have a method that creates line segment QEntity?
| mLineGeometryRenderer->setPrimitiveRestartEnabled( true ); | ||
| mLineGeometryRenderer->setRestartIndexValue( 0 ); | ||
| mLineGeometryRenderer->setVertexCount( 6 ); | ||
| mLineGeometryRenderer->setInstanceCount( 0 ); |
| renderer->setPrimitiveRestartEnabled( true ); | ||
| renderer->setRestartIndexValue( 0 ); | ||
| renderer->setVertexCount( 6 ); | ||
| renderer->setInstanceCount( lineVertexData.pointsA.size() ); |
There was a problem hiding this comment.
also here - use utility method to create QEntity for segments?
- handle duplicates in cpp, rather than in shaders - introduce enum to distinguish between segments and joins - clip away the segments at joins, two segments should not overlap at joins and joins are also clipped to fill the space between the segments, but not to overlap them - rename shader
- fix joins not showing from certain angles
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
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.
@wonder-sk
Screencast_20260824_102534.webm