Crate glossy [] [src]

Glossy is a GLSL source loading crate for Rust which supports the #include directive and shader optimization at compile time via glsl-optimizer.

Refer to the GitHub repository for more information.

Example Usage

In build script

extern crate glossy_codegen as glsl;

void main() {

In Rust source file

extern crate glossy;
extern crate glium;

void main() {
    // ...
    glium::Program::from_source(gl, shader!("sprite.vert"), shader!("sprite.frag"), None)
    // ...

In shader source file shader.frag:

#version 120
#include "common.glsl"

void main() {
    float v = common_func(common_uniform);
    // ...



Evaluates to a string of the glossy-processed shader source of the given filename.


Returns the name of the shader file for the given FILE value.