Crates.io | frag |
lib.rs | frag |
version | 0.1.6 |
source | src |
created_at | 2021-03-11 19:03:50.245601 |
updated_at | 2024-05-24 00:37:23.540486 |
description | A simple crate to do live shader coding and rendering shaders to video. |
homepage | |
repository | https://github.com/codybloemhard/frag |
max_upload_size | |
id | 367395 |
size | 90,653 |
Fragment shaders in Rust. Let's you skip the boilerplate and just write a fragment shader. Useful when for example, writing a raymarching shader.
use frag::*;
let streamer = shader::ShaderStreamer::new()
.with_file("lib.glsl")
.with_file("shader.glsl");
FragConf::new()
.with_window_width(1600)
.with_window_height(900)
.with_canvas_width(320)
.with_canvas_height(180)
.with_pixelate(true)
.with_streamer(streamer)
.run_live().expect("Could not run.");
use frag::*;
let streamer = shader::ShaderStreamer::new()
.with_file("lib.glsl")
.with_file("shader.glsl");
FragConf::new()
.with_window_width(1600)
.with_window_height(900)
.with_streamer(streamer)
.into_ffmpeg_renderer()
.with_framerate(30)
.with_crf(20)
.with_preset(Preset::Slow)
.with_tune(Tune::Animation)
.with_length(600)
.with_output("render.mp4")
.render().expect("Could not render.");
Copyright (C) 2024 Cody Bloemhard
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.