Struct shadergraph::graph::ShaderGraph[][src]

pub struct ShaderGraph {
    pub created: Instant,
    // some fields omitted
}
Expand description

Represents a Directed Acyclic Graph of shaders. Each shader is run sequentially, and can be the input to shaders later down the line.

Fields

created: Instant

Implementations

Creates a new shader graph within a specific glium context.

Adds anything that implements the Node trait to the graph Will panic if the Node does not preserve DAG structure.

Adds an input to the shader graph. Use the returned NodeId to mark it as a texture input to other shaders.

Adds a shader to a shader graph. Each shader has its own underlying Texture2d of a particular size. Shader is bound to the graph’s context.

Add a recurrent shader to the graph.

Adds a compute node, which produces a set of uniforms for use in the next shader.

Mark a node in the graph as an output. When calling forward, this node’s texture will be included in the output map. To access it, index the map with the NodeId this method returns. Returns None if the requested Node does not support being an output.

Does a forward pass of the entire shader graph. Takes a set of N inputs, and produces a set of M outputs. Each shader in the DAG is run, from front to back, previous input textures are bound as uniforms of the form: u_texture_0, .., u_texture_n. Use the map! macro to quickly build a BTreeMap to pass to this function. All marked outputs will be included in the output map.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.