From 90f6b74bf4799bcdbf27c46a19de2db08be00f73 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Fri, 8 Aug 2025 12:01:12 +0200 Subject: [PATCH] revert changes to shader_spheres.vert removing unused function --- Lab/demo/Lab/Scene_spheres_item.cpp | 5 ----- Lab/demo/Lab/Scene_spheres_item.h | 1 - Lab/demo/Lab/resources/shader_spheres.vert | 6 +++--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Lab/demo/Lab/Scene_spheres_item.cpp b/Lab/demo/Lab/Scene_spheres_item.cpp index 6afc47a14e6..d65da606030 100644 --- a/Lab/demo/Lab/Scene_spheres_item.cpp +++ b/Lab/demo/Lab/Scene_spheres_item.cpp @@ -327,11 +327,6 @@ QMenu* Scene_spheres_item::contextMenu() { return menu; } -float Scene_spheres_item::alpha() const -{ - return Scene_item_rendering_helper::alpha(); -} - QString Scene_spheres_item::toolTip() const { return d->tooltip; diff --git a/Lab/demo/Lab/Scene_spheres_item.h b/Lab/demo/Lab/Scene_spheres_item.h index 2944a7f5d5f..23ae7fe541f 100644 --- a/Lab/demo/Lab/Scene_spheres_item.h +++ b/Lab/demo/Lab/Scene_spheres_item.h @@ -60,7 +60,6 @@ public: bool save(const std::string &file_name) const; QMenu *contextMenu() override; - float alpha() const override; void initializeBuffers(Viewer_interface *) const override; void computeElements() const override; diff --git a/Lab/demo/Lab/resources/shader_spheres.vert b/Lab/demo/Lab/resources/shader_spheres.vert index c6778a1288b..68b0babf8a0 100644 --- a/Lab/demo/Lab/resources/shader_spheres.vert +++ b/Lab/demo/Lab/resources/shader_spheres.vert @@ -1,7 +1,7 @@ #version 150 in vec4 vertex; in vec3 normals; -in vec4 colors; +in vec3 colors; in vec3 center; in float radius; uniform mat4 mvp_matrix; @@ -19,7 +19,7 @@ void main(void) gl_PointSize = point_size; for(int i=0; i<6; ++i) dist[i] = 1.0; - color = colors; + color = vec4(colors, 1.0); vec4 transformed_vertex = vec4(radius*vertex.x + center.x, radius* vertex.y + center.y, radius*vertex.z + center.z, 1.0); fP = mv_matrix * transformed_vertex; @@ -27,6 +27,6 @@ void main(void) norm_matrix_3[0] = norm_matrix[0].xyz; norm_matrix_3[1] = norm_matrix[1].xyz; norm_matrix_3[2] = norm_matrix[2].xyz; - fN = norm_matrix_3 * normals; + fN = norm_matrix_3* normals; gl_Position = mvp_matrix * f_matrix * transformed_vertex; }