Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
ProjectiveTextureMapping
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WooHyungChoi
ProjectiveTextureMapping
Commits
3cdddf08
Commit
3cdddf08
authored
5 years ago
by
Woohyung Choi
Browse files
Options
Downloads
Patches
Plain Diff
shader 수정중
parent
e28e7348
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Shaders/Projector/Projector.frag
+11
-7
11 additions, 7 deletions
Shaders/Projector/Projector.frag
Shaders/Projector/Projector.vert
+10
-9
10 additions, 9 deletions
Shaders/Projector/Projector.vert
with
21 additions
and
16 deletions
Shaders/Projector/Projector.frag
+
11
−
7
View file @
3cdddf08
#version 330 core
uniform
sampler2D
projMap_forCam1
;
uniform
sampler2D
image
;
out
vec4
FragColor
;
in
vec4
TexCoords
;
void
main
(
void
)
{
vec4
final_color
=
vec4
(
0
.
0
,
0
.
0
,
0
.
0
,
1
.
0
)
;
if
(
gl_
TexCoord
[
0
].
q
&
gt
;
0
.
0
)
vec4
final_color
;
if
(
TexCoord
s
.
q
>
0
.
0
)
{
vec4
ProjMapColor_forCam1
=
texture2DProj
(
projMap_forCam1
,
gl_TexCoord
[
0
]);
vec2
finalCoords
=
TexCoords
.
st
/
TexCoords
.
q
;
vec4
ProjMapColor_forCam1
=
texture
(
image
,
finalCoords
);
final_color
=
ProjMapColor_forCam1
;
}
gl_FragColor
=
final_color
;
FragColor
=
final_color
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Shaders/Projector/Projector.vert
+
10
−
9
View file @
3cdddf08
#version 330 core
uniform
mat4
TexGenMatCam0
;
uniform
mat4
ViewMat
;
layout
(
location
=
0
)
in
vec3
aPos
;
out
vec4
TexCoords
;
uniform
mat4
TexGenMatCam0
;
uniform
mat4
model
;
uniform
mat4
view
;
uniform
mat4
projection
;
void
main
()
{
mat4
InvViewMat
=
inverse
(
ViewMat
);
vec4
posEye
=
gl_ModelViewMatrix
*
gl_Vertex
;
vec4
posWorld
=
InvViewMat
*
posEye
;
vec3
FragPos
=
vec3
(
model
*
vec4
(
aPos
,
1
.
0
));
vec4
VertexPos_eye
=
model
*
view
*
vec4
(
aPos
,
1
.
0
);
vec4
VertexPos_world
=
inverse
(
view
)
*
VertexPos_eye
;
gl_
TexCoord
[
0
]
=
TexGenMatCam0
*
posW
orld
;
TexCoord
s
=
TexGenMatCam0
*
VertexPos_w
orld
;
gl_Position
=
ftransform
();
gl_Position
=
projection
*
view
*
vec4
(
FragPos
,
1
.
0
);
}
\ No newline at end of file
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