A Rust macro for including shader files as string with dependencies support.
Although this library works on stable
, your shader files changes might not be detected because of caching. Therefore, until track_path
API stabilizes, it is recommended to use nightly
so your shader files are tracked.
For the best experience (shader files tracking), nightly
is required.
Add the following to your Cargo.toml
manifest file:
toml
[dependencies]
include-shader = { version = "0.1.1", features = ["nightly"] }
Add the following to your Cargo.toml
manifest file:
toml
[dependencies]
include-shader = "0.1.1"
```rust use includeshader::includeshader;
fn main() { // ... let fragshader = compileshader( &context, WebGl2RenderingContext::FRAGMENTSHADER, includeshader!("src/shaders/fragment_shader.glsl"), )?; // ... } ```
For more details on how to use this macro, see the documentation (docs.rs).
Distributed under the terms of both the MIT license and the Apache License (Version 2.0).
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.