Struct three_d::core::ImageCubeEffect [−][src]
pub struct ImageCubeEffect { /* fields omitted */ }
Expand description
A customizable cube effect. Used for rendering into all 6 sides of a cube map texture.
Implementations
Creates a new cube effect which applies the effect defined in the given fragment shader source to a side of a cube map when calling on of the render functions.
pub fn render(
&self,
side: CubeMapSide,
render_states: RenderStates,
viewport: Viewport
) -> ThreeDResult<()>
pub fn render(
&self,
side: CubeMapSide,
render_states: RenderStates,
viewport: Viewport
) -> ThreeDResult<()>
Applies the effect defined in the fragment shader source given at construction to the given side of a cube map. Must be called in a render target render function, for example in the callback function of Screen::write.
Methods from Deref<Target = Program>
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.
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.
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.
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.
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.
Send the given Quat 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.
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.
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.
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.
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.
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.
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.
Use the given UniformBuffer in this shader program and associate it with the given named variable.
Uses the given VertexBuffer in this shader program and associates it with the given named variable. Each value in the buffer is used when rendering one vertex using the Program::draw_arrays or Program::draw_elements methods. Therefore the buffer must contain the same number of values as the number of vertices specified in those draw calls.
pub fn use_attribute_instanced(
&self,
name: &str,
buffer: &InstanceBuffer
) -> ThreeDResult<()>
pub fn use_attribute_instanced(
&self,
name: &str,
buffer: &InstanceBuffer
) -> ThreeDResult<()>
Uses the given buffer data in this shader program and associates it with the given named variable. Each value in the buffer is used when rendering one instance using the Program::draw_arrays_instanced or Program::draw_elements_instanced methods. Therefore the buffer must contain the same number of values as the number of instances specified in those draw calls.
Uses the given VertexBuffer in this shader program and associates it with the given named variable. Each contiguous 2 values in the buffer are used when rendering one vertex using the Program::draw_arrays or Program::draw_elements methods. Therefore the buffer must contain 2 times the number of values as the number of vertices specified in those draw calls.
pub fn use_attribute_vec2_instanced(
&self,
name: &str,
buffer: &InstanceBuffer
) -> ThreeDResult<()>
pub fn use_attribute_vec2_instanced(
&self,
name: &str,
buffer: &InstanceBuffer
) -> ThreeDResult<()>
Uses the given buffer data in this shader program and associates it with the given named variable. Each contiguous 2 values in the buffer are used when rendering one instance using the Program::draw_arrays_instanced or Program::draw_elements_instanced methods. Therefore the buffer must contain 2 times the number of values as the number of instances specified in those draw calls.
Uses the given VertexBuffer in this shader program and associates it with the given named variable. Each contiguous 3 values in the buffer are used when rendering one instance using the Program::draw_arrays_instanced or Program::draw_elements_instanced methods. Therefore the buffer must contain 3 times the number of values as the number of instances specified in those draw calls.
pub fn use_attribute_vec3_instanced(
&self,
name: &str,
buffer: &InstanceBuffer
) -> ThreeDResult<()>
pub fn use_attribute_vec3_instanced(
&self,
name: &str,
buffer: &InstanceBuffer
) -> ThreeDResult<()>
Uses the given buffer data in this shader program and associates it with the given named variable. Each contiguous 3 values in the buffer are used when rendering one instance using the Program::draw_arrays_instanced or Program::draw_elements_instanced methods. Therefore the buffer must contain 3 times the number of values as the number of instances specified in those draw calls.
Uses the given VertexBuffer in this shader program and associates it with the given named variable. Each contiguous 4 values in the buffer are used when rendering one instance using the Program::draw_arrays_instanced or Program::draw_elements_instanced methods. Therefore the buffer must contain 4 times the number of values as the number of instances specified in those draw calls.
pub fn use_attribute_vec4_instanced(
&self,
name: &str,
buffer: &InstanceBuffer
) -> ThreeDResult<()>
pub fn use_attribute_vec4_instanced(
&self,
name: &str,
buffer: &InstanceBuffer
) -> ThreeDResult<()>
Uses the given buffer data in this shader program and associates it with the given named variable. Each contiguous 4 values in the buffer are used when rendering one instance using the Program::draw_arrays_instanced or Program::draw_elements_instanced methods. Therefore the buffer must contain 4 times the number of values as the number of instances specified in those draw calls.
Draws count
number of triangles with the given render states and viewport using this shader program.
Requires that all attributes and uniforms have been defined using the use_attribute and use_uniform methods.
Assumes that the data for the three vertices in a triangle is defined contiguous in each vertex buffer.
If you want to use an ElementBuffer, see Program::draw_elements.
pub fn draw_arrays_instanced(
&self,
render_states: RenderStates,
viewport: Viewport,
count: u32,
instance_count: u32
)
pub fn draw_arrays_instanced(
&self,
render_states: RenderStates,
viewport: Viewport,
count: u32,
instance_count: u32
)
Same as Program::draw_arrays except it renders ‘instance_count’ instances of the same set of triangles. Use the Program::use_attribute_instanced, Program::use_attribute_vec2_instanced, Program::use_attribute_vec3_instanced and Program::use_attribute_vec4_instanced methods to send unique data for each instance to the shader.
pub fn draw_elements(
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer
)
pub fn draw_elements(
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer
)
Draws the triangles defined by the given ElementBuffer with the given render states and viewport using this shader program. Requires that all attributes and uniforms have been defined using the use_attribute and use_uniform methods. If you do not want to use an ElementBuffer, see Program::draw_arrays. If you only want to draw a subset of the triangles in the given ElementBuffer, see Program::draw_subset_of_elements.
pub fn draw_subset_of_elements(
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer,
first: u32,
count: u32
)
pub fn draw_subset_of_elements(
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer,
first: u32,
count: u32
)
Draws a subset of the triangles defined by the given ElementBuffer with the given render states and viewport using this shader program. Requires that all attributes and uniforms have been defined using the use_attribute and use_uniform methods. If you do not want to use an ElementBuffer, see Program::draw_arrays.
pub fn draw_elements_instanced(
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer,
count: u32
)
pub fn draw_elements_instanced(
&self,
render_states: RenderStates,
viewport: Viewport,
element_buffer: &ElementBuffer,
count: u32
)
Same as Program::draw_elements except it renders ‘instance_count’ instances of the same set of triangles. Use the Program::use_attribute_instanced, Program::use_attribute_vec2_instanced, Program::use_attribute_vec3_instanced and Program::use_attribute_vec4_instanced methods to send unique data for each instance to the shader.
Returns true if this program uses the uniform with the given name.
Returns true if this program uses the attribute with the given name.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ImageCubeEffect
impl !Send for ImageCubeEffect
impl !Sync for ImageCubeEffect
impl Unpin for ImageCubeEffect
impl !UnwindSafe for ImageCubeEffect
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more