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
10661e87
Commit
10661e87
authored
3 years ago
by
Vanessa Karolek
Browse files
Options
Downloads
Patches
Plain Diff
[
#94
] correct projected texture coordinates
parent
03677d21
No related branches found
No related tags found
1 merge request
!77
Resolve "SAF-R Module"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/saf_r/shaders/shader.vert
+3
-2
3 additions, 2 deletions
projects/saf_r/shaders/shader.vert
projects/saf_r/src/main.cpp
+5
-4
5 additions, 4 deletions
projects/saf_r/src/main.cpp
with
8 additions
and
6 deletions
projects/saf_r/shaders/shader.vert
+
3
−
2
View file @
10661e87
...
...
@@ -6,6 +6,7 @@ layout(location = 1) out vec2 texCoord;
layout
(
push_constant
)
uniform
constants
{
mat4
mvp
;
mat4
proj
;
};
void
main
()
{
...
...
@@ -24,8 +25,8 @@ void main() {
vec4
position
=
mvp
*
vec4
(
positions
[
gl_VertexIndex
],
1
.
0
);
gl_Position
=
position
;
texCoord
.
x
=
(
positions
[
gl_VertexIndex
].
x
+
1
.
0
)
*
0
.
5
;
texCoord
.
y
=
(
-
positions
[
gl_VertexIndex
].
y
+
1
.
0
)
*
0
.
5
;
texCoord
.
x
=
((
proj
*
vec4
(
positions
[
gl_VertexIndex
]
,
1
.
0
))
.
x
+
1
.
0
)
*
0
.
5
;
texCoord
.
y
=
(
(
proj
*
vec4
(
positions
[
gl_VertexIndex
]
,
1
.
0
))
.
y
+
1
.
0
)
*
0
.
5
;
fragColor
=
colors
[
gl_VertexIndex
];
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
projects/saf_r/src/main.cpp
+
5
−
4
View file @
10661e87
...
...
@@ -175,10 +175,10 @@ int main(int argc, const char** argv) {
Material
mirror
(
glm
::
vec3
(
0.0
,
10.0
,
0.8
),
glm
::
vec3
(
1.0
,
1.0
,
1.0
),
1425.
);
std
::
vector
<
Sphere
>
spheres
;
spheres
.
push_back
(
Sphere
(
glm
::
vec3
(
-
3
,
0
,
-
16
),
2
,
ivory
));
spheres
.
push_back
(
Sphere
(
glm
::
vec3
(
-
3
,
0
,
-
16
),
2
,
ivory
));
spheres
.
push_back
(
Sphere
(
glm
::
vec3
(
-
1.0
,
-
1.5
,
-
12
),
2
,
mirror
));
spheres
.
push_back
(
Sphere
(
glm
::
vec3
(
1.5
,
-
0.5
,
-
18
),
3
,
red_rubber
));
spheres
.
push_back
(
Sphere
(
glm
::
vec3
(
7
,
5
,
-
18
),
4
,
mirror
));
spheres
.
push_back
(
Sphere
(
glm
::
vec3
(
7
,
5
,
-
18
),
4
,
mirror
));
std
::
vector
<
Light
>
lights
;
lights
.
push_back
(
Light
(
glm
::
vec3
(
-
20
,
20
,
20
),
1.5
));
...
...
@@ -278,9 +278,10 @@ int main(int argc, const char** argv) {
cameraManager
.
update
(
0.000001
*
static_cast
<
double
>
(
deltatime
.
count
()));
glm
::
mat4
mvp
=
cameraManager
.
getActiveCamera
().
getMVP
();
glm
::
mat4
proj
=
cameraManager
.
getActiveCamera
().
getProjection
();
vkcv
::
PushConstants
pushConstants
(
sizeof
(
glm
::
mat4
));
pushConstants
.
appendDrawcall
(
mvp
);
vkcv
::
PushConstants
pushConstants
(
sizeof
(
glm
::
mat4
)
*
2
);
pushConstants
.
appendDrawcall
(
std
::
array
<
glm
::
mat4
,
2
>
{
mvp
,
proj
}
);
auto
cmdStream
=
core
.
createCommandStream
(
vkcv
::
QueueType
::
Graphics
);
...
...
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