Skip to content

Commit

Permalink
Update default shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
pannapudi committed Jul 6, 2024
1 parent 6a55407 commit 856b6c4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
17 changes: 14 additions & 3 deletions src/default_shaders/glsl.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
pub const FRAG_SHADER: &str = "#version 460
#extension GL_EXT_buffer_reference : require
#extension GL_EXT_nonuniform_qualifier : require
// In the beginning, colours never existed. There's nothing that was done before you...
#include <prelude.glsl>
layout(location = 0) in vec2 in_uv;
layout(location = 0) out vec4 out_color;
layout(set = 0, binding = 0) uniform sampler gsamplers[];
layout(set = 0, binding = 1) uniform texture2D gtextures[];
vec4 Tex(uint id) {
return texture(
nonuniformEXT(sampler2D(gtextures[id], gsamplers[LINER_SAMPL])), in_uv);
}
vec4 Tex(uint id, vec2 uv) {
return texture(
nonuniformEXT(sampler2D(gtextures[id], gsamplers[LINER_SAMPL])), uv);
}
layout(std430, push_constant) uniform PushConstant {
vec3 pos;
Expand All @@ -20,9 +32,6 @@ layout(std430, push_constant) uniform PushConstant {
}
pc;
layout(location = 0) in vec2 in_uv;
layout(location = 0) out vec4 out_color;
void main() {
vec2 uv = (in_uv + -0.5) * vec2(pc.resolution.x / pc.resolution.y, 1);
Expand All @@ -32,6 +41,7 @@ void main() {

pub const VERT_SHADER: &str = "#version 460
#extension GL_EXT_buffer_reference : require
#extension GL_EXT_nonuniform_qualifier : require
layout(set = 0, binding = 0) uniform sampler gsamplers[];
layout(set = 0, binding = 1) uniform texture2D gtextures[];
Expand All @@ -56,6 +66,7 @@ void main() {
}";

pub const COMP_SHADER: &str = "#version 460
#extension GL_EXT_nonuniform_qualifier : require
#extension GL_EXT_buffer_reference : require
layout(set = 0, binding = 0) uniform sampler gsamplers[];
Expand Down
9 changes: 4 additions & 5 deletions src/recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,16 @@ fn new_ffmpeg_command(image_dimensions: ImageDimensions, filename: &str) -> Resu
"-f", "rawvideo",
"-i", "pipe:",
"-c:v", "libx264",
"-crf", "25",
"-preset", "ultrafast",
"-crf", "23",
// "-preset", "ultrafast",
"-tune", "animation",
"-color_primaries", "bt709",
"-color_trc", "bt709",
"-colorspace", "bt709",
"-color_range", "tv",
"-chroma_sample_location", "center",
"-pix_fmt", "yuv420p",
"-movflags", "+faststart",
// "-movflags", "+faststart",
"-y",
];

Expand All @@ -127,8 +127,7 @@ fn new_ffmpeg_command(image_dimensions: ImageDimensions, filename: &str) -> Resu
.arg("-video_size")
.arg(format!(
"{}x{}",
image_dimensions.unpadded_bytes_per_row / 4,
image_dimensions.height
image_dimensions.width, image_dimensions.height
))
.args(args)
.arg(filename)
Expand Down

0 comments on commit 856b6c4

Please sign in to comment.