Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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
Vulkan2021
VkCV Framework
Commits
60166469
Verified
Commit
60166469
authored
2 years ago
by
Tobias Frisch
Browse files
Options
Downloads
Patches
Plain Diff
Update first_scene project
Signed-off-by:
Tobias Frisch
<
tfrisch@uni-koblenz.de
>
parent
97b0e701
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/first_scene/assets/shaders/shader.frag
+19
-3
19 additions, 3 deletions
projects/first_scene/assets/shaders/shader.frag
projects/first_scene/src/main.cpp
+1
-7
1 addition, 7 deletions
projects/first_scene/src/main.cpp
with
20 additions
and
10 deletions
projects/first_scene/assets/shaders/shader.frag
+
19
−
3
View file @
60166469
...
@@ -4,12 +4,28 @@
...
@@ -4,12 +4,28 @@
layout
(
location
=
0
)
in
vec3
passNormal
;
layout
(
location
=
0
)
in
vec3
passNormal
;
layout
(
location
=
1
)
in
vec2
passUV
;
layout
(
location
=
1
)
in
vec2
passUV
;
layout
(
location
=
0
)
out
vec
3
outColor
;
layout
(
location
=
0
)
out
vec
4
outColor
;
layout
(
set
=
0
,
binding
=
0
)
uniform
texture2D
meshTexture
;
layout
(
set
=
0
,
binding
=
0
)
uniform
texture2D
meshTexture
;
layout
(
set
=
0
,
binding
=
1
)
uniform
sampler
textureSampler
;
layout
(
set
=
0
,
binding
=
1
)
uniform
sampler
textureSampler
;
void
main
()
{
void
main
()
{
outColor
=
texture
(
sampler2D
(
meshTexture
,
textureSampler
),
passUV
).
rgb
;
vec3
lightDirection
=
normalize
(
vec3
(
0
.
1
f
,
-
0
.
9
f
,
0
.
1
f
));
//outColor = passNormal * 0.5 + 0.5;
float
ambient
=
0
.
35
f
;
float
diffuse
=
max
(
0
.
0
f
,
-
dot
(
passNormal
,
lightDirection
));
float
specular
=
pow
(
diffuse
,
6
.
0
f
);
float
brightness
=
sqrt
(
(
ambient
+
diffuse
+
specular
)
/
(
2
.
0
f
+
ambient
)
);
vec4
color
=
texture
(
sampler2D
(
meshTexture
,
textureSampler
),
passUV
);
if
(
color
.
a
<=
0
.
0
f
)
{
discard
;
}
outColor
=
vec4
(
color
.
rgb
*
brightness
,
color
.
a
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
projects/first_scene/src/main.cpp
+
1
−
7
View file @
60166469
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
#include
<GLFW/glfw3.h>
#include
<GLFW/glfw3.h>
#include
<vkcv/camera/CameraManager.hpp>
#include
<vkcv/camera/CameraManager.hpp>
#include
<vkcv/gui/GUI.hpp>
#include
<vkcv/gui/GUI.hpp>
#include
<chrono>
#include
<vkcv/asset/asset_loader.hpp>
#include
<vkcv/asset/asset_loader.hpp>
#include
<vkcv/shader/GLSLCompiler.hpp>
#include
<vkcv/shader/GLSLCompiler.hpp>
#include
<vkcv/scene/Scene.hpp>
#include
<vkcv/scene/Scene.hpp>
...
@@ -18,12 +17,6 @@ int main(int argc, const char** argv) {
...
@@ -18,12 +17,6 @@ int main(int argc, const char** argv) {
vkcv
::
Features
features
;
vkcv
::
Features
features
;
features
.
requireExtension
(
VK_KHR_SWAPCHAIN_EXTENSION_NAME
);
features
.
requireExtension
(
VK_KHR_SWAPCHAIN_EXTENSION_NAME
);
features
.
requireExtensionFeature
<
vk
::
PhysicalDeviceDescriptorIndexingFeatures
>
(
VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME
,
[](
vk
::
PhysicalDeviceDescriptorIndexingFeatures
&
features
)
{
features
.
setDescriptorBindingPartiallyBound
(
true
);
}
);
vkcv
::
Core
core
=
vkcv
::
Core
::
create
(
vkcv
::
Core
core
=
vkcv
::
Core
::
create
(
applicationName
,
applicationName
,
...
@@ -31,6 +24,7 @@ int main(int argc, const char** argv) {
...
@@ -31,6 +24,7 @@ int main(int argc, const char** argv) {
{
vk
::
QueueFlagBits
::
eTransfer
,
vk
::
QueueFlagBits
::
eGraphics
,
vk
::
QueueFlagBits
::
eCompute
},
{
vk
::
QueueFlagBits
::
eTransfer
,
vk
::
QueueFlagBits
::
eGraphics
,
vk
::
QueueFlagBits
::
eCompute
},
features
features
);
);
vkcv
::
WindowHandle
windowHandle
=
core
.
createWindow
(
applicationName
,
windowWidth
,
windowHeight
,
true
);
vkcv
::
WindowHandle
windowHandle
=
core
.
createWindow
(
applicationName
,
windowWidth
,
windowHeight
,
true
);
vkcv
::
Window
&
window
=
core
.
getWindow
(
windowHandle
);
vkcv
::
Window
&
window
=
core
.
getWindow
(
windowHandle
);
vkcv
::
camera
::
CameraManager
cameraManager
(
window
);
vkcv
::
camera
::
CameraManager
cameraManager
(
window
);
...
...
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