Frag
Fragment shaders in Rust. Let's you skip the boilerplate and just write a fragment shader. Useful when for example, writing a raymarching shader.
Features
- Compose shader of multiple part or files
- Live coding: updates when a file is updated
- Keyboard controls for time
- Resolution independent: separate resolutions for rendering and displaying. Can be used to stretch, pixelate or anti alias
- MP4 rendering with FFMPEG
- Save current frame as PNG image
Controls
- Space: Pause/Resume time and rendering
- Left(hold): go back in time
- Right(hold): go forward in time
- Down: set time to 0
- PageDown: jump backward in time with 5 seconds
- PageUp: jump forward in time with 5 seconds
Todo
- Post process fragment shader accessable
Examples
Example live coding, with pixel art like style
use *;
let streamer = new
.with_file
.with_file;
new
.with_window_width
.with_window_height
.with_canvas_width
.with_canvas_height
.with_pixelate
.with_streamer
.run_live.expect;
Example rendering to video
use *;
let streamer = new
.with_file
.with_file;
new
.with_window_width
.with_window_height
.with_streamer
.into_ffmpeg_renderer
.with_framerate
.with_crf
.with_preset
.with_tune
.with_length
.with_output
.render.expect;
License
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/>.