Struct three_d::Program [−][src]
A shader program consisting of a programmable vertex shader followed by a programmable fragment shader. Functionality includes transferring per vertex data to the vertex shader (see the use_attribute functionality) and transferring uniform data to both shader stages (see the use_uniform and use_texture functionality) and execute the shader program (see the draw functionality).
Implementations
impl Program
[src]
pub fn from_source(
context: &Context,
vertex_shader_source: &str,
fragment_shader_source: &str
) -> Result<Program, Error>
[src]
context: &Context,
vertex_shader_source: &str,
fragment_shader_source: &str
) -> Result<Program, Error>
pub fn use_uniform_int(&self, name: &str, data: &i32) -> Result<(), Error>
[src]
pub fn use_uniform_float(&self, name: &str, data: &f32) -> Result<(), Error>
[src]
pub fn use_uniform_vec2(&self, name: &str, data: &Vec2) -> Result<(), Error>
[src]
pub fn use_uniform_vec3(&self, name: &str, data: &Vec3) -> Result<(), Error>
[src]
pub fn use_uniform_vec4(&self, name: &str, data: &Vec4) -> Result<(), Error>
[src]
pub fn use_uniform_mat2(&self, name: &str, data: &Mat2) -> Result<(), Error>
[src]
pub fn use_uniform_mat3(&self, name: &str, data: &Mat3) -> Result<(), Error>
[src]
pub fn use_uniform_mat4(&self, name: &str, data: &Mat4) -> Result<(), Error>
[src]
pub fn use_texture(
&self,
texture: &dyn Texture,
texture_name: &str
) -> Result<(), Error>
[src]
&self,
texture: &dyn Texture,
texture_name: &str
) -> Result<(), Error>
pub fn use_uniform_block(&self, buffer: &UniformBuffer, block_name: &str)
[src]
pub fn use_attribute(
&self,
buffer: &VertexBuffer,
attribute_name: &str
) -> Result<(), Error>
[src]
&self,
buffer: &VertexBuffer,
attribute_name: &str
) -> Result<(), Error>
pub fn use_attribute_divisor(
&self,
buffer: &VertexBuffer,
attribute_name: &str,
divisor: usize
) -> Result<(), Error>
[src]
&self,
buffer: &VertexBuffer,
attribute_name: &str,
divisor: usize
) -> Result<(), Error>
pub fn use_attribute_vec2(
&self,
buffer: &VertexBuffer,
attribute_name: &str
) -> Result<(), Error>
[src]
&self,
buffer: &VertexBuffer,
attribute_name: &str
) -> Result<(), Error>
pub fn use_attribute_vec2_divisor(
&self,
buffer: &VertexBuffer,
attribute_name: &str,
divisor: usize
) -> Result<(), Error>
[src]
&self,
buffer: &VertexBuffer,
attribute_name: &str,
divisor: usize
) -> Result<(), Error>
pub fn use_attribute_vec3(
&self,
buffer: &VertexBuffer,
attribute_name: &str
) -> Result<(), Error>
[src]
&self,
buffer: &VertexBuffer,
attribute_name: &str
) -> Result<(), Error>
pub fn use_attribute_vec3_divisor(
&self,
buffer: &VertexBuffer,
attribute_name: &str,
divisor: usize
) -> Result<(), Error>
[src]
&self,
buffer: &VertexBuffer,
attribute_name: &str,
divisor: usize
) -> Result<(), Error>
pub fn use_attribute_vec4(
&self,
buffer: &VertexBuffer,
attribute_name: &str
) -> Result<(), Error>
[src]
&self,
buffer: &VertexBuffer,
attribute_name: &str
) -> Result<(), Error>
pub fn use_attribute_vec4_divisor(
&self,
buffer: &VertexBuffer,
attribute_name: &str,
divisor: usize
) -> Result<(), Error>
[src]
&self,
buffer: &VertexBuffer,
attribute_name: &str,
divisor: usize
) -> Result<(), Error>
pub fn draw_arrays(
&self,
render_states: RenderStates,
viewport: Viewport,
count: u32
)
[src]
&self,
render_states: RenderStates,
viewport: Viewport,
count: u32
)
pub fn draw_arrays_instanced(
&self,
render_states: RenderStates,
viewport: Viewport,
count: u32,
instance_count: u32
)
[src]
&self,
render_states: RenderStates,
viewport: Viewport,
count: u32,
instance_count: u32
)
pub fn draw_elements(
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer
)
[src]
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer
)
pub fn draw_subset_of_elements(
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer,
first: u32,
count: u32
)
[src]
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer,
first: u32,
count: u32
)
pub fn draw_elements_instanced(
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer,
count: u32
)
[src]
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer,
count: u32
)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Program
impl !Send for Program
impl !Sync for Program
impl Unpin for Program
impl UnwindSafe for Program
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,