Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nt1100 analyser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pascal Engeler
nt1100 analyser
Commits
711f74d3
Commit
711f74d3
authored
2 years ago
by
Pascal Engeler
Browse files
Options
Downloads
Patches
Plain Diff
Added toggle-able section line highlighting
parent
5a94a6e8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/shaders/heightmap0.frag
+8
-2
8 additions, 2 deletions
resources/shaders/heightmap0.frag
resources/shaders/heightmap0.vert
+24
-2
24 additions, 2 deletions
resources/shaders/heightmap0.vert
with
32 additions
and
4 deletions
resources/shaders/heightmap0.frag
+
8
−
2
View file @
711f74d3
...
@@ -3,9 +3,15 @@ out vec4 FragColor;
...
@@ -3,9 +3,15 @@ out vec4 FragColor;
in
vec4
vertexColor
;
in
vec4
vertexColor
;
in
float
colorCoord
;
in
float
colorCoord
;
in
int
colorOverridden
;
uniform
sampler1D
colorscheme
;
uniform
sampler1D
colorscheme
;
void
main
(){
void
main
(){
FragColor
=
texture
(
colorscheme
,
colorCoord
);
if
(
colorOverridden
==
1
){
}
FragColor
=
vertexColor
;
\ No newline at end of file
}
else
{
FragColor
=
texture
(
colorscheme
,
colorCoord
);
}
}
This diff is collapsed.
Click to expand it.
resources/shaders/heightmap0.vert
+
24
−
2
View file @
711f74d3
...
@@ -3,6 +3,7 @@ layout (location = 0) in vec3 aPos;
...
@@ -3,6 +3,7 @@ layout (location = 0) in vec3 aPos;
out
vec4
vertexColor
;
out
vec4
vertexColor
;
out
float
colorCoord
;
out
float
colorCoord
;
out
int
colorOverridden
;
//perspective related uniforms
//perspective related uniforms
uniform
mat4
model
;
uniform
mat4
model
;
...
@@ -15,6 +16,14 @@ uniform float minZ;
...
@@ -15,6 +16,14 @@ uniform float minZ;
uniform
float
maxZ
;
uniform
float
maxZ
;
uniform
float
bad_z_value
;
uniform
float
bad_z_value
;
//Cross section plots lines related uniforms
uniform
int
plotLinesEnabled
;
uniform
vec3
plotLineAlongX_color
;
uniform
vec3
plotLineAlongY_color
;
uniform
float
plotLineAlongX_y
;
uniform
float
plotLineAlongY_x
;
uniform
float
plotLineHalfThickness
;
void
main
(){
void
main
(){
vec3
position
=
aPos
;
vec3
position
=
aPos
;
if
(
aPos
.
z
!=
bad_z_value
){
if
(
aPos
.
z
!=
bad_z_value
){
...
@@ -26,6 +35,19 @@ void main(){
...
@@ -26,6 +35,19 @@ void main(){
position
.
z
=
minZ
-
0
.
5
*
scale
*
(
maxZ
-
minZ
);
position
.
z
=
minZ
-
0
.
5
*
scale
*
(
maxZ
-
minZ
);
}
}
gl_Position
=
projection
*
view
*
model
*
vec4
(
position
,
1
.
0
);
gl_Position
=
projection
*
view
*
model
*
vec4
(
position
,
1
.
0
);
vertexColor
=
vec4
(
position
.
z
,
0
.
0
,
0
.
0
,
1
.);
colorCoord
=
(
aPos
.
z
-
minZ
)
/
(
maxZ
-
minZ
);
colorCoord
=
(
aPos
.
z
-
minZ
)
/
(
maxZ
-
minZ
);
}
vertexColor
=
vec4
(
position
.
z
,
0
.
0
,
0
.
0
,
1
.);
\ No newline at end of file
colorOverridden
=
0
;
//Check if on cross section line
if
(
plotLinesEnabled
==
1
){
if
(
abs
(
position
.
x
-
plotLineAlongY_x
)
<
plotLineHalfThickness
){
colorOverridden
=
1
;
vertexColor
=
vec4
(
plotLineAlongY_color
,
1
.);
}
else
if
(
abs
(
position
.
y
-
plotLineAlongX_y
)
<
plotLineHalfThickness
){
colorOverridden
=
1
;
vertexColor
=
vec4
(
plotLineAlongX_color
,
1
.);
}
}
}
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