diff --git a/src/3d/shaders/pointcloud.vert b/src/3d/shaders/pointcloud.vert index 0494f57479a1b..07972db7d2fd0 100644 --- a/src/3d/shaders/pointcloud.vert +++ b/src/3d/shaders/pointcloud.vert @@ -23,6 +23,8 @@ out vec3 pointColor; out vec3 worldPosition; //used when points are triangulated out vec3 vertNorm; //used when points are triangulated +#pragma include clipplane.inc + void main(void) { gl_Position = modelViewProjection * vec4(vertexPosition, 1); @@ -49,4 +51,6 @@ void main(void) classParameter = int(vertexParameter); break; } + + setClipDistance(worldPosition); } diff --git a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp index 1e9663383dca4..007472ca4a4b5 100644 --- a/src/3d/symbols/qgspointcloud3dsymbol_p.cpp +++ b/src/3d/symbols/qgspointcloud3dsymbol_p.cpp @@ -24,6 +24,7 @@ #include "qgspointcloudindex.h" #include "qgspointcloudblockrequest.h" #include "qgsfeedback.h" +#include "qgs3dutils.h" #include #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) @@ -316,6 +317,7 @@ void QgsPointCloud3DSymbolHandler::makeEntity( Qt3DCore::QEntity *parent, const technique->addParameter( new Qt3DRender::QParameter( "triangulate", !out.triangles.isEmpty() ) ); Qt3DRender::QEffect *eff = new Qt3DRender::QEffect; + Qgs3DUtils::addBoundingBoxParametersToEffect( eff, context.map() ); eff->addTechnique( technique ); mat->setEffect( eff );