-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
157 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
; Uniforms | ||
.fvec projMtx[4] | ||
.fvec mdlvMtx[4] | ||
|
||
; Constants | ||
.constf consts(1.0, 0.0, 0.0, 0.0) | ||
|
||
.alias ones consts.xxxx | ||
.alias zeros consts.yyyy | ||
|
||
; Inputs | ||
.in inPosition v0 | ||
.in inColor v1 | ||
.in inTexCoord v2 | ||
|
||
; Outputs | ||
.out outPosition position | ||
.out outColor color | ||
.out outTexCoord0 texcoord0 | ||
|
||
; void main() | ||
.proc main | ||
; r0 = vec4(inPosition, 1.0) | ||
mov r0.xyz, inPosition | ||
mov r0.w, ones | ||
|
||
; pos = mdlvMtx * inPosition; | ||
dp4 r1.x, mdlvMtx[0], r0 | ||
dp4 r1.y, mdlvMtx[1], r0 | ||
dp4 r1.z, mdlvMtx[2], r0 | ||
dp4 r1.w, mdlvMtx[3], r0 | ||
|
||
; outPosition = projMtx * pos | ||
dp4 outPosition.x, projMtx[0], r1 | ||
dp4 outPosition.y, projMtx[1], r1 | ||
dp4 outPosition.z, projMtx[2], r1 | ||
dp4 outPosition.w, projMtx[3], r1 | ||
|
||
; outTexCoord = inTexCoord | ||
mov outTexCoord0, inTexCoord | ||
|
||
; outColor = inColor | ||
mov outColor, inColor | ||
|
||
; We're finished | ||
end | ||
.end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#version 460 | ||
|
||
layout (location = 0) in vec4 inColor; | ||
layout (location = 0) out vec4 outColor; | ||
|
||
void main() | ||
{ | ||
outColor = inColor; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#version 460 | ||
|
||
layout (location = 0) in vec4 inColor; | ||
layout (location = 1) in vec2 inTexCoord; | ||
|
||
layout (location = 0) out vec4 outColor; | ||
|
||
layout (binding = 0) uniform sampler2D texture0; | ||
|
||
void main() | ||
{ | ||
outColor = inColor * texture(texture0, inTexCoord); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#version 460 | ||
|
||
layout (location = 0) in vec3 inPos; | ||
layout (location = 1) in vec4 inColor; | ||
layout (location = 2) in vec2 inTexCoord; | ||
|
||
layout (location = 0) out vec4 outColor; | ||
layout (location = 1) out vec2 outTexCoord; | ||
|
||
layout (std140, binding = 0) uniform Transformation | ||
{ | ||
mat4 mdlvMtx; | ||
mat4 projMtx; | ||
} u; | ||
|
||
void main() | ||
{ | ||
vec4 pos = u.mdlvMtx * vec4(inPos, 1.0); | ||
gl_Position = u.projMtx * pos; | ||
|
||
outColor = inColor; | ||
outTexCoord = inTexCoord; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#version 460 | ||
|
||
layout (location = 0) in vec4 inColor; | ||
layout (location = 1) in vec2 inTexCoord; | ||
|
||
layout (location = 0) out vec4 outColor; | ||
|
||
layout (binding = 0) uniform sampler2D video_y; | ||
layout (binding = 1) uniform sampler2D video_cb; | ||
layout (binding = 2) uniform sampler2D video_cr; | ||
|
||
const vec3 yuv_add = vec3(-0.0627451017, -0.501960814, -0.501960814); | ||
|
||
const vec3 yuv_r = vec3(1.164, 0.000, 1.596); | ||
const vec3 yuv_g = vec3(1.164, -0.391, -0.813); | ||
const vec3 yuv_b = vec3(1.164, 2.018, 0.000); | ||
|
||
void main() | ||
{ | ||
vec3 yuv; | ||
|
||
yuv[0] = texture(video_y, inTexCoord).r; | ||
yuv[1] = texture(video_cb, inTexCoord).r; | ||
yuv[2] = texture(video_cr, inTexCoord).r; | ||
|
||
yuv += yuv_add; | ||
|
||
outColor[0] = dot(yuv, yuv_r); | ||
outColor[1] = dot(yuv, yuv_g); | ||
outColor[2] = dot(yuv, yuv_b); | ||
outColor[3] = 1.0; | ||
} |