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
50145dda
Commit
50145dda
authored
2 years ago
by
Pascal Engeler
Browse files
Options
Downloads
Patches
Plain Diff
Only one shader needed
parent
711f74d3
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/heightmap1.frag
+0
-17
0 additions, 17 deletions
resources/shaders/heightmap1.frag
resources/shaders/heightmap1.vert
+0
-53
0 additions, 53 deletions
resources/shaders/heightmap1.vert
with
0 additions
and
70 deletions
resources/shaders/heightmap1.frag
deleted
100644 → 0
+
0
−
17
View file @
711f74d3
#version 410 core
out
vec4
FragColor
;
in
vec4
vertexColor
;
in
float
colorCoord
;
in
int
colorOverridden
;
uniform
sampler1D
colorscheme
;
void
main
(){
if
(
colorOverridden
==
1
){
FragColor
=
vertexColor
;
}
else
{
FragColor
=
texture
(
colorscheme
,
colorCoord
);
}
}
This diff is collapsed.
Click to expand it.
resources/shaders/heightmap1.vert
deleted
100644 → 0
+
0
−
53
View file @
711f74d3
#version 410 core
layout
(
location
=
0
)
in
vec3
aPos
;
out
vec4
vertexColor
;
out
float
colorCoord
;
out
int
colorOverridden
;
//perspective related uniforms
uniform
mat4
model
;
uniform
mat4
view
;
uniform
mat4
projection
;
//Scale related uniforms
uniform
float
scale
;
uniform
float
minZ
;
uniform
float
maxZ
;
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
(){
vec3
position
=
aPos
;
if
(
aPos
.
z
!=
bad_z_value
){
position
.
z
-=
minZ
;
position
.
z
*=
scale
;
position
.
z
+=
minZ
;
}
else
{
position
.
z
=
minZ
-
0
.
5
*
scale
*
(
maxZ
-
minZ
);
}
gl_Position
=
projection
*
view
*
model
*
vec4
(
position
,
1
.
0
);
colorCoord
=
(
aPos
.
z
-
minZ
)
/
(
maxZ
-
minZ
);
vertexColor
=
vec4
(
position
.
z
,
0
.
0
,
0
.
0
,
1
.);
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