fmenozzi / shadertoy-rs Goto Github PK
View Code? Open in Web Editor NEWA desktop client for Shadertoy written in Rust
License: MIT License
A desktop client for Shadertoy written in Rust
License: MIT License
Hello,
I was using shadertoy-rs when I discovered a weird issue that seem to suggest rendering on shadertoy-rs is not 100% the same as on the website.
As an example look at this shader.
https://www.shadertoy.com/view/ttB3Rh
What you will see is three major colors (RGB) with minimal blending between the colors.
When rendering this same shader with shadertoy-rs. I find the result to be quite different.
I see that the section between the red and green has a way more pronounced orange tint than the shadertoy rendered version.
At first I thought that there was some kind of weird color interpolation going on somewhere, I tried to look around the code but could not find anything suspicous. (My knowledge of computer graphics is very limited). Do you have an idea of where this issue might be coming from ?
OS: Arch linux, X11
i3 window manager
Let me know if more debug data is needed.
The Hyper dependency is too old and prevents the build on up to date system as it itself depend on an old version of openssl-sys (0.74). More detail about the issue can be found here hyperium/hyper#985
I tried turning the version up to 0.11, but the compilation failed. However it succeeded with hyper = "0.10"
I'm not sure if it has anything to do with the other issue, but shadertoy-rs seems to crash while creating the windows in release mode. It works fine in debug mode. Here is the backtrace I got from the coredump:
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `./shadertoy --example seascape'.
Program terminated with signal SIGILL, Illegal instruction.
#0 0x000055d1ecc96506 in x11_dl::xlib_xcb::Xlib_xcb::open ()
(gdb) bt
#0 0x000055d1ecc96506 in x11_dl::xlib_xcb::Xlib_xcb::open ()
#1 0x000055d1ecc60590 in winit::api::x11::xdisplay::XConnection::new ()
#2 0x000055d1ecc76ccf in std::sync::once::Once::call_once::{{closure}} ()
#3 0x000055d1ecd1621d in std::sync::once::Once::call_inner ()
#4 0x000055d1ecc6303f in winit::os::unix::get_x11_xconnection ()
#5 0x000055d1ecc58a19 in glutin::platform::platform::x11::Window::new ()
#6 0x000055d1ecc5c6dd in glutin::window::<impl glutin::WindowBuilder<'a>>::build ()
#7 0x000055d1ecb71d35 in gfx_window_glutin::init_raw ()
#8 0x000055d1eca7014e in shadertoy::main ()
#9 0x000055d1eca6b3c3 in std::rt::lang_start::{{closure}} ()
#10 0x000055d1ecd1ac18 in std::panicking::try::do_call ()
#11 0x000055d1ecd2695f in __rust_maybe_catch_panic ()
#12 0x000055d1ecd1b54c in std::rt::lang_start_internal ()
#13 0x000055d1eca72ef4 in main ()
If you confirm the two issues aren't linked, I'll open another issue.
String
s in argvalue/error structs with &'a str
reqwest 0.8 has a dependency on an older version of openssl, which won't build on systems with native OpenSSL 1.1.1. This has been fixed in reqwest 0.9.18.
Although I appear to have the same versions as the CI build I am getting errors in dependencies (e.g. the cocoa package):
pat@desk:fmenozzi/shadertoy-rs$ rustc --version
rustc 1.39.0 (4560ea788 2019-11-04)
pat@desk:fmenozzi/shadertoy-rs$ cargo --version
cargo 1.39.0 (1c6ec66d5 2019-09-30)
pat@desk:fmenozzi/shadertoy-rs$ git checkout -qf cef7f062d6a080671fcf88d0ff8112d3575431c0
pat@desk:fmenozzi/shadertoy-rs$ cargo build
Compiling libc v0.2.65
Compiling cfg-if v0.1.10
Compiling autocfg v0.1.7
Compiling log v0.4.8
Compiling lazy_static v1.4.0
Compiling semver-parser v0.7.0
Compiling byteorder v1.3.2
Compiling bitflags v1.2.1
Compiling futures v0.1.29
Compiling either v1.5.3
Compiling scopeguard v1.0.0
Compiling proc-macro2 v1.0.6
Compiling unicode-xid v0.2.0
Compiling rand_core v0.4.2
Compiling syn v1.0.9
Compiling maybe-uninit v2.0.0
Compiling khronos_api v2.2.0
Compiling fnv v1.0.6
Compiling matches v0.1.8
Compiling smallvec v1.0.0
Compiling slab v0.4.2
Compiling itoa v0.4.4
Compiling proc-macro2 v0.4.30
Compiling khronos_api v3.1.0
Compiling getrandom v0.1.13
Compiling core-foundation-sys v0.6.2
Compiling unicode-xid v0.1.0
Compiling core-foundation-sys v0.5.1
Compiling ppv-lite86 v0.2.6
Compiling xml-rs v0.8.0
Compiling version_check v0.9.1
Compiling cc v1.0.47
Compiling syn v0.15.44
Compiling winapi-build v0.1.1
Compiling adler32 v1.0.4
Compiling serde v1.0.103
Compiling foreign-types-shared v0.1.1
Compiling version_check v0.1.5
Compiling winapi v0.2.8
Compiling failure_derive v0.1.6
Compiling rayon-core v1.6.1
Compiling ryu v1.0.2
Compiling httparse v1.3.4
Compiling percent-encoding v1.0.1
Compiling try-lock v0.2.2
Compiling percent-encoding v2.1.0
Compiling rustc-demangle v0.1.16
Compiling remove_dir_all v0.5.2
Compiling native-tls v0.2.3
Compiling crc32fast v1.2.0
Compiling block v0.1.6
Compiling regex-syntax v0.6.12
Compiling encoding_rs v0.8.20
Compiling utf8-ranges v0.1.3
Compiling mime v0.3.14
Compiling bitflags v0.7.0
Compiling inflate v0.2.0
Compiling unicode-width v0.1.6
Compiling dtoa v0.4.4
Compiling color_quant v1.0.1
Compiling lzw v0.10.0
Compiling regex-syntax v0.3.9
Compiling yaml-rust v0.3.5
Compiling ansi_term v0.11.0
Compiling vec_map v0.8.1
Compiling strsim v0.8.0
Compiling scoped_threadpool v0.1.9
Compiling try_from v0.3.2
Compiling unicode-bidi v0.3.4
Compiling lock_api v0.3.2
Compiling crossbeam-utils v0.6.6
Compiling rand_core v0.3.1
Compiling semver v0.9.0
Compiling unicode-normalization v0.1.11
Compiling foreign-types v0.3.2
Compiling miniz_oxide v0.3.5
Compiling kernel32-sys v0.2.2
Compiling crossbeam-utils v0.7.0
Compiling crossbeam-epoch v0.8.0
Compiling num-traits v0.2.10
Compiling num-integer v0.1.41
Compiling indexmap v1.3.0
Compiling rand_chacha v0.1.1
Compiling rand_pcg v0.1.2
Compiling rand v0.6.5
Compiling num-iter v0.1.39
Compiling textwrap v0.11.0
Compiling error-chain v0.12.1
Compiling unicase v2.6.0
Compiling gif v0.9.2
Compiling rand_hc v0.1.0
Compiling rand_xorshift v0.1.1
Compiling rand_isaac v0.1.1
Compiling c2-chacha v0.2.3
Compiling rustc_version v0.2.3
Compiling crossbeam-queue v0.1.2
Compiling idna v0.1.5
Compiling idna v0.2.0
Compiling tokio-executor v0.1.9
Compiling tokio-sync v0.1.7
Compiling regex v1.3.1
Compiling backtrace-sys v0.1.32
Compiling xml-rs v0.7.0
Compiling draw_state v0.8.0
Compiling smallvec v0.6.13
Compiling want v0.2.0
Compiling log v0.3.9
Compiling security-framework-sys v0.3.3
Compiling gl_generator v0.13.1
Compiling tokio-current-thread v0.1.6
Compiling tokio-timer v0.2.12
Compiling memoffset v0.5.3
Compiling parking_lot_core v0.6.2
Compiling parking_lot v0.9.0
Compiling hyper v0.12.35
Compiling iovec v0.1.4
Compiling num_cpus v1.11.1
Compiling net2 v0.2.33
Compiling time v0.1.42
Compiling malloc_buf v0.0.6
Compiling core-foundation v0.6.4
Compiling memchr v0.1.11
Compiling rand_jitter v0.1.4
Compiling rand_os v0.1.3
Compiling shared_library v0.1.9
Compiling atty v0.2.13
Compiling quote v1.0.2
Compiling url v1.7.2
Compiling url v2.1.0
Compiling deflate v0.7.20
Compiling base64 v0.10.1
Compiling quote v0.6.13
Compiling flate2 v1.0.13
Compiling thread-id v2.0.0
Compiling futures-cpupool v0.1.8
Compiling gl_generator v0.9.0
Compiling bytes v0.4.12
Compiling objc v0.2.7
Compiling core-foundation v0.5.1
Compiling rand_core v0.5.1
Compiling aho-corasick v0.5.3
Compiling clap v2.33.0
Compiling mio v0.6.21
Compiling security-framework v0.3.4
Compiling crossbeam-queue v0.2.0
Compiling thread_local v0.2.7
Compiling publicsuffix v1.5.4
Compiling cookie v0.12.0
Compiling core-graphics v0.13.0
Compiling tokio-io v0.1.12
Compiling http v0.1.20
Compiling string v0.2.1
Compiling tokio-buf v0.1.1
Compiling rand_chacha v0.2.1
Compiling mime_guess v2.0.1
Compiling backtrace v0.3.40
Compiling regex v0.1.80
Compiling num-traits v0.1.43
Compiling gleam v0.6.19
Compiling rand v0.7.2
Compiling cocoa v0.14.0
Compiling enum_primitive v0.1.1
Compiling crossbeam-deque v0.7.2
Compiling tokio-reactor v0.1.11
Compiling num-rational v0.1.42
Compiling tokio-threadpool v0.1.16
Compiling gfx_gl v0.5.0
Compiling glutin v0.13.1
Compiling png v0.7.0
Compiling tokio-tcp v0.1.3
Compiling uuid v0.7.4
error[E0282]: type annotations needed
--> /Users/pat/.cargo/registry/src/github.com-1ecc6299db9ec823/cocoa-0.14.0/src/appkit.rs:491:9
|
491 | msg_send![self, releaseGlobally];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ consider giving `result` a type
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
Compiling rayon v1.2.1
Compiling tokio v0.1.22
Compiling env_logger v0.3.5
Compiling tempfile v3.1.0
error: aborting due to previous error
For more information about this error, try `rustc --explain E0282`.
error: could not compile `cocoa`.
warning: build failed, waiting for other jobs to finish...
error: build failed
pat@desk:fmenozzi/shadertoy-rs$
I'd like to replace [glpaper
](https://hg.sr.ht/~scoopta/glpaper with shadertoy-rs
.
I think this might be possible through winit in the future:
The wayland-rs update was released, and sctk has been updated (though not released) to use it. Hopefully winit can add support for it soon!
It appears that shadertoy does not allow public access to shaders marked as private through their API. extract_from_json()
currently crashes when attempting to download a private shader.
clap
to generate completions for common shells (bash, zsh, etc.)Builds fine but attempting to run any shader crashes. System is windows 10. AMD Radeon RX 6700 XT. Same behaviour in non-release mode.
PS F:\repos\shadertoy-rs> cargo run --release -- --example seascape
Finished release [optimized] target(s) in 0.26s
warning: the following packages contain code that will be rejected by a future version of Rust: winapi v0.2.8
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 3`
Running `target\release\shadertoy.exe --example seascape`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoAvailablePixelFormat', src\runner.rs:133:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: process didn't exit successfully: `target\release\shadertoy.exe --example seascape` (exit code: 101)
Full backtrace:
PS F:\repos\shadertoy-rs> $env:RUST_BACKTRACE="full"
PS F:\repos\shadertoy-rs> cargo run --release -- --example seascape
Finished release [optimized] target(s) in 0.25s
warning: the following packages contain code that will be rejected by a future version of Rust: winapi v0.2.8
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 8`
Running `target\release\shadertoy.exe --example seascape`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: NoAvailablePixelFormat', src\runner.rs:133:14
stack backtrace:
0: 0x7ff7680eac3f - std::backtrace_rs::backtrace::dbghelp::trace
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
1: 0x7ff7680eac3f - std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
2: 0x7ff7680eac3f - std::sys_common::backtrace::_print_fmt
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common\backtrace.rs:66
3: 0x7ff7680eac3f - std::sys_common::backtrace::_print::impl$0::fmt
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common\backtrace.rs:45
4: 0x7ff768103dca - core::fmt::write
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\fmt\mod.rs:1197
5: 0x7ff7680e3309 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\io\mod.rs:1672
6: 0x7ff7680ed45b - std::sys_common::backtrace::_print
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common\backtrace.rs:48
7: 0x7ff7680ed45b - std::sys_common::backtrace::print
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common\backtrace.rs:35
8: 0x7ff7680ed45b - std::panicking::default_hook::closure$1
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:295
9: 0x7ff7680ed0db - std::panicking::default_hook
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:314
10: 0x7ff7680eda09 - std::panicking::rust_panic_with_hook
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:698
11: 0x7ff7680ed90d - std::panicking::begin_panic_handler::closure$0
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:588
12: 0x7ff7680eb5c7 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\sys_common\backtrace.rs:138
13: 0x7ff7680ed5e9 - std::panicking::begin_panic_handler
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:584
14: 0x7ff76811ec05 - core::panicking::panic_fmt
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\panicking.rs:142
15: 0x7ff76811ed13 - core::result::unwrap_failed
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\result.rs:1805
16: 0x7ff767d6d848 - shadertoy::runner::run::he03f289bb0b2e8db
17: 0x7ff767d45aad - <gfx::pso::resource::TextureSampler<T> as gfx::pso::DataBind<R>>::bind_to::h56bbc29c1a81b56a
18: 0x7ff767d48df6 - std::sys_common::backtrace::__rust_begin_short_backtrace::hec2391bab7f568d7
19: 0x7ff767d5098c - std::rt::lang_start::{{closure}}::hfda90fc685594d49
20: 0x7ff7680dcd31 - core::ops::function::impls::impl$2::call_once
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\core\src\ops\function.rs:280
21: 0x7ff7680dcd31 - std::panicking::try::do_call
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:492
22: 0x7ff7680dcd31 - std::panicking::try
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:456
23: 0x7ff7680dcd31 - std::panic::catch_unwind
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panic.rs:137
24: 0x7ff7680dcd31 - std::rt::lang_start_internal::closure$2
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\rt.rs:128
25: 0x7ff7680dcd31 - std::panicking::try::do_call
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:492
26: 0x7ff7680dcd31 - std::panicking::try
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panicking.rs:456
27: 0x7ff7680dcd31 - std::panic::catch_unwind
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\panic.rs:137
28: 0x7ff7680dcd31 - std::rt::lang_start_internal
at /rustc/4b91a6ea7258a947e59c6522cd5898e7c0a6a88f/library\std\src\rt.rs:128
29: 0x7ff767d45bf7 - main
30: 0x7ff76810b84c - invoke_main
at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
31: 0x7ff76810b84c - __scrt_common_main_seh
at D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
32: 0x7fff4f327344 - BaseThreadInitThunk
33: 0x7fff4f4626b1 - RtlUserThreadStart
error: process didn't exit successfully: `target\release\shadertoy.exe --example seascape` (exit code: 101)
-v/--verbose
flag
$ shadertoy test.frag
$ shadertoy https://shadertoy.com/view/Ms2SD1
get --run
subcommandiChannelResolution
iFrameRate
F3
or somethingiTimeDelta
iChannelTime
iDate
iSampleRate
When the user chooses to run the shader immediately after downloading it (with the --run
option), pressing F5 causes the default fragment shader to load instead of the downloaded shader. This is because the ArgValues::shaderpath
value is None
, and load_fragment_shader
reloads the shader from disk from the shaderpath
value.
.rustfmt.toml
fileerror
moduleBox<Error>
might even be good enough
?
failure
crate, which seems to be less verbose to set up than something like error-chain
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.