Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pvt
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
pvt
Commits
c97870ac
Commit
c97870ac
authored
8 years ago
by
Ali Can Demiralp
Browse files
Options
Downloads
Patches
Plain Diff
Scatter plot fragment shader now creates smoother points.
parent
4315ff96
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pvt/src/rendering/shader_strings.cpp
+21
-6
21 additions, 6 deletions
pvt/src/rendering/shader_strings.cpp
with
21 additions
and
6 deletions
pvt/src/rendering/shader_strings.cpp
+
21
−
6
View file @
c97870ac
...
...
@@ -957,6 +957,8 @@ void main()
std
::
string
scatter_plot_vert
=
R"(\
#version 400
uniform mat4 view;
uniform mat4 projection;
uniform float scale;
in vec3 vertex ;
...
...
@@ -966,7 +968,7 @@ flat out int vert_selected;
void main()
{
gl_Position = vec4(vertex, 1.0);
gl_Position =
projection * view *
vec4(vertex, 1.0);
gl_PointSize = scale;
vert_selected = selected;
}
...
...
@@ -974,8 +976,9 @@ void main()
std
::
string
scatter_plot_frag
=
R"(\
#version 400
uniform vec4 normal_color ;
uniform vec4 selected_color;
uniform vec4 background_color;
uniform vec4 normal_color ;
uniform vec4 selected_color ;
flat in int vert_selected;
...
...
@@ -983,15 +986,24 @@ out vec4 frag_color;
void main()
{
float radius = length(gl_PointCoord - vec2(0.5));
if(radius > 0.5)
discard;
vec4 color;
if(vert_selected == 0)
frag_
color = normal_color;
color = normal_color;
else
frag_color = selected_color;
color = selected_color;
frag_color = mix(color, background_color, smoothstep(0.0, 0.6, radius));
}
)"
;
std
::
string
scatter_plot_click_vert
=
R"(\
#version 400
uniform mat4 view;
uniform mat4 projection;
uniform float scale;
in vec3 vertex;
...
...
@@ -1001,7 +1013,7 @@ flat out int vert_id;
void main()
{
gl_Position = vec4(vertex, 1.0);
gl_Position =
projection * view *
vec4(vertex, 1.0);
gl_PointSize = scale;
vert_id = id;
}
...
...
@@ -1015,6 +1027,9 @@ out int frag_id;
void main()
{
if(length(gl_PointCoord - vec2(0.5)) > 0.5)
discard;
frag_id = vert_id;
}
)"
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment