Struct three_d::object::InstancedMeshProgram [−][src]
pub struct InstancedMeshProgram { /* fields omitted */ }
Expand description
A shader program used for rendering one or more instances of a InstancedMesh. It has a fixed vertex shader and customizable fragment shader for custom lighting. Use this in combination with render.
Implementations
impl InstancedMeshProgram
[src]
impl InstancedMeshProgram
[src]pub fn new(
context: &Context,
fragment_shader_source: &str
) -> Result<Self, Error>
[src]
pub fn new(
context: &Context,
fragment_shader_source: &str
) -> Result<Self, Error>
[src]Constructs a new shader program for rendering instanced meshes. The fragment shader can use the fragments position by adding in vec3 pos;
,
its normal by in vec3 nor;
, its uv coordinates by in vec2 uvs;
and its per vertex color by in vec4 col;
to the shader source code.
Methods from Deref<Target = Program>
pub fn use_uniform_int(&self, name: &str, data: &i32) -> Result<(), Error>
[src]
pub fn use_uniform_int(&self, name: &str, data: &i32) -> Result<(), Error>
[src]Send the given integer value to this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform int
, meaning it is uniformly available across all processing of vertices and fragments.
pub fn use_uniform_float(&self, name: &str, data: &f32) -> Result<(), Error>
[src]
pub fn use_uniform_float(&self, name: &str, data: &f32) -> Result<(), Error>
[src]Send the given float value to this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform float
, meaning it is uniformly available across all processing of vertices and fragments.
pub fn use_uniform_vec2(&self, name: &str, data: &Vec2) -> Result<(), Error>
[src]
pub fn use_uniform_vec2(&self, name: &str, data: &Vec2) -> Result<(), Error>
[src]Send the given Vec2 value to this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform vec2
, meaning it is uniformly available across all processing of vertices and fragments.
pub fn use_uniform_vec3(&self, name: &str, data: &Vec3) -> Result<(), Error>
[src]
pub fn use_uniform_vec3(&self, name: &str, data: &Vec3) -> Result<(), Error>
[src]Send the given Vec3 value to this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform vec3
, meaning it is uniformly available across all processing of vertices and fragments.
pub fn use_uniform_vec4(&self, name: &str, data: &Vec4) -> Result<(), Error>
[src]
pub fn use_uniform_vec4(&self, name: &str, data: &Vec4) -> Result<(), Error>
[src]Send the given Vec4 value to this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform vec4
, meaning it is uniformly available across all processing of vertices and fragments.
pub fn use_uniform_mat2(&self, name: &str, data: &Mat2) -> Result<(), Error>
[src]
pub fn use_uniform_mat2(&self, name: &str, data: &Mat2) -> Result<(), Error>
[src]Send the given Mat2 value to this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform mat2
, meaning it is uniformly available across all processing of vertices and fragments.
pub fn use_uniform_mat3(&self, name: &str, data: &Mat3) -> Result<(), Error>
[src]
pub fn use_uniform_mat3(&self, name: &str, data: &Mat3) -> Result<(), Error>
[src]Send the given Mat3 value to this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform mat3
, meaning it is uniformly available across all processing of vertices and fragments.
pub fn use_uniform_mat4(&self, name: &str, data: &Mat4) -> Result<(), Error>
[src]
pub fn use_uniform_mat4(&self, name: &str, data: &Mat4) -> Result<(), Error>
[src]Send the given Mat4 value to this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform mat4
, meaning it is uniformly available across all processing of vertices and fragments.
pub fn use_texture(
&self,
texture: &impl Texture,
texture_name: &str
) -> Result<(), Error>
[src]
pub fn use_texture(
&self,
texture: &impl Texture,
texture_name: &str
) -> Result<(), Error>
[src]Use the given Texture2D in this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform sampler2D
and can only be accessed in the fragment shader.
pub fn use_texture_array(
&self,
texture: &impl TextureArray,
texture_name: &str
) -> Result<(), Error>
[src]
pub fn use_texture_array(
&self,
texture: &impl TextureArray,
texture_name: &str
) -> Result<(), Error>
[src]Use the given TextureArray in this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform sampler2DArray
and can only be accessed in the fragment shader.
pub fn use_texture_cube(
&self,
texture: &impl TextureCube,
texture_name: &str
) -> Result<(), Error>
[src]
pub fn use_texture_cube(
&self,
texture: &impl TextureCube,
texture_name: &str
) -> Result<(), Error>
[src]Use the given TextureCube in this shader program and associate it with the given named variable.
The glsl shader variable must be of type uniform samplerCube
and can only be accessed in the fragment shader.
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,
cull: CullType,
viewport: Viewport,
count: u32
)
[src]
&self,
render_states: RenderStates,
cull: CullType,
viewport: Viewport,
count: u32
)
pub fn draw_arrays_instanced(
&self,
render_states: RenderStates,
cull: CullType,
viewport: Viewport,
count: u32,
instance_count: u32
)
[src]
&self,
render_states: RenderStates,
cull: CullType,
viewport: Viewport,
count: u32,
instance_count: u32
)
pub fn draw_elements(
&self,
render_states: RenderStates,
cull: CullType,
viewport: Viewport,
element_buffer: &ElementBuffer
)
[src]
&self,
render_states: RenderStates,
cull: CullType,
viewport: Viewport,
element_buffer: &ElementBuffer
)
pub fn draw_subset_of_elements(
&self,
render_states: RenderStates,
cull: CullType,
viewport: Viewport,
element_buffer: &ElementBuffer,
first: u32,
count: u32
)
[src]
&self,
render_states: RenderStates,
cull: CullType,
viewport: Viewport,
element_buffer: &ElementBuffer,
first: u32,
count: u32
)
pub fn draw_elements_instanced(
&self,
render_states: RenderStates,
cull: CullType,
viewport: Viewport,
element_buffer: &ElementBuffer,
count: u32
)
[src]
&self,
render_states: RenderStates,
cull: CullType,
viewport: Viewport,
element_buffer: &ElementBuffer,
count: u32
)