Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TSBK03 Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Fabian Johansson
TSBK03 Project
Commits
2d360229
Commit
2d360229
authored
5 months ago
by
Dethcrvsh
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
6a2f2873
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
shaders/surface.vert
+4
-1
4 additions, 1 deletion
shaders/surface.vert
src/main.cpp
+3
-0
3 additions, 0 deletions
src/main.cpp
src/waves.cpp
+16
-0
16 additions, 0 deletions
src/waves.cpp
src/waves.h
+8
-0
8 additions, 0 deletions
src/waves.h
with
32 additions
and
2 deletions
CMakeLists.txt
+
1
−
1
View file @
2d360229
...
@@ -19,7 +19,7 @@ set(COMMON_SOURCES
...
@@ -19,7 +19,7 @@ set(COMMON_SOURCES
common/Linux/MicroGlut.c
common/Linux/MicroGlut.c
)
)
file
(
GLOB_RECURSE SRC_SOURCES src/*.cpp src/*.c
)
file
(
GLOB_RECURSE SRC_SOURCES src/*.cpp src/*.c
src/*.h
)
set
(
SOURCES
${
COMMON_SOURCES
}
${
SRC_SOURCES
}
)
set
(
SOURCES
${
COMMON_SOURCES
}
${
SRC_SOURCES
}
)
...
...
This diff is collapsed.
Click to expand it.
shaders/surface.vert
+
4
−
1
View file @
2d360229
...
@@ -8,6 +8,10 @@ uniform mat4 projectionMatrix;
...
@@ -8,6 +8,10 @@ uniform mat4 projectionMatrix;
uniform
mat4
modelToWorldToView
;
uniform
mat4
modelToWorldToView
;
uniform
float
time
;
uniform
float
time
;
// layout(std140) uniform VertexBuffer {
// Wave waves_b[16];
// };
out
vec3
world_pos
;
out
vec3
world_pos
;
out
vec3
normal
;
out
vec3
normal
;
...
@@ -57,7 +61,6 @@ vec3 get_waves(const vec3 pos, const float t) {
...
@@ -57,7 +61,6 @@ vec3 get_waves(const vec3 pos, const float t) {
}
}
return
offset
+
vec3
(
pos
.
x
,
0
.
0
,
pos
.
z
);
return
offset
+
vec3
(
pos
.
x
,
0
.
0
,
pos
.
z
);
}
}
/* Get the normal for a wave */
/* Get the normal for a wave */
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
3
−
0
View file @
2d360229
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
#include
"LoadTGA.h"
#include
"LoadTGA.h"
#include
"MicroGlut.h"
#include
"MicroGlut.h"
#include
"VectorUtils4.h"
#include
"VectorUtils4.h"
#include
"waves.h"
// uses framework OpenGL
// uses framework OpenGL
// uses framework Cocoa
// uses framework Cocoa
...
@@ -256,6 +257,8 @@ int main(int argc, char* argv[])
...
@@ -256,6 +257,8 @@ int main(int argc, char* argv[])
glutMotionFunc
(
on_mouse_move
);
glutMotionFunc
(
on_mouse_move
);
glutMouseFunc
(
on_mouse_button
);
glutMouseFunc
(
on_mouse_button
);
Waves
::
init
();
glutMainLoop
();
glutMainLoop
();
exit
(
0
);
exit
(
0
);
}
}
This diff is collapsed.
Click to expand it.
src/waves.cpp
0 → 100644
+
16
−
0
View file @
2d360229
#include
<iostream>
#include
"waves.h"
#include
<GL/gl.h>
namespace
Waves
{
GLuint
ubo
;
void
init
()
{
glGenBuffers
(
1
,
&
ubo
);
glBindBuffer
(
GL_UNIFORM_BUFFER
,
ubo
);
glBufferData
(
GL_UNIFORM_BUFFER
,
sizeof
(
Wave
)
*
16
,
nullptr
,
GL_DYNAMIC_DRAW
);
}
};
This diff is collapsed.
Click to expand it.
src/waves.h
0 → 100644
+
8
−
0
View file @
2d360229
#pragma once
namespace
Waves
{
void
init
();
};
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