Struct turbine_scene3d::Scene [−][src]
pub struct Scene {
pub settings: SceneSettings,
pub projection: Matrix4<f32>,
pub camera: Matrix4<f32>,
pub model: Matrix4<f32>,
// some fields omitted
}
Expand description
Stores scene data.
Fields
settings: SceneSettings
Scene settings.
projection: Matrix4<f32>
Projection transform.
camera: Matrix4<f32>
Camera transform.
model: Matrix4<f32>
Model transform.
Implementations
Create new scene.
Set projection matrix.
Load texture from path.
Create vertex shader from source.
pub fn fragment_shader(
&mut self,
fragment_shader_src: &str
) -> Result<FragmentShader, String>
pub fn fragment_shader(
&mut self,
fragment_shader_src: &str
) -> Result<FragmentShader, String>
Create fragment shader from source.
pub fn program_from_vertex_fragment(
&mut self,
vertex_shader: VertexShader,
fragment_shader: FragmentShader
) -> Program
pub fn program_from_vertex_fragment(
&mut self,
vertex_shader: VertexShader,
fragment_shader: FragmentShader
) -> Program
Create program from vertex and fragment shader.
pub fn matrix4_uniform(
&mut self,
program: Program,
name: &str
) -> Result<Matrix4Uniform, String>
pub fn matrix4_uniform(
&mut self,
program: Program,
name: &str
) -> Result<Matrix4Uniform, String>
Create 4D matrix uniform.
pub fn vector2_uniform(
&mut self,
program: Program,
name: &str
) -> Result<Vector2Uniform, String>
pub fn vector2_uniform(
&mut self,
program: Program,
name: &str
) -> Result<Vector2Uniform, String>
Create 2D vector uniform.
pub fn vector3_uniform(
&mut self,
program: Program,
name: &str
) -> Result<Vector3Uniform, String>
pub fn vector3_uniform(
&mut self,
program: Program,
name: &str
) -> Result<Vector3Uniform, String>
Create 3D vector uniform.
Create f32 uniform.
Create vertex array.
Create uv buffer.
pub fn color_buffer(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> ColorBuffer
pub fn color_buffer(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> ColorBuffer
Create color buffer.
pub fn vertex_buffer2(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> VertexBuffer2
pub fn vertex_buffer2(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> VertexBuffer2
Create vertex buffer for 2D coordinates.
pub fn vertex_buffer3(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> VertexBuffer3
pub fn vertex_buffer3(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> VertexBuffer3
Create vertex buffer for 3D coordinates.
pub fn normal_buffer(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> NormalBuffer
pub fn normal_buffer(
&mut self,
vertex_array: VertexArray,
attribute: u32,
data: &[f32]
) -> NormalBuffer
Create normal buffer.
Use program.
Set model-view-projection transform uniform.
Set view transform uniform.
Set model transform uniform.
Set matrix uniform.
Set 2D vector uniform.
Set 3D vector uniform.
Set f32 uniform.
Set texture.
Translate model in global coordinates.
Rotate model around x axis with degrees.
Rotate model around y axis with degrees.
Rotate model around z axis with degrees.
Rotate model around axis with degrees.
Push model transfrom to transform stack.
Pop model transform from transform stack.
Enable framebuffer sRGB.
Disable framebuffer sRGB.
Enable blend.
Disable blend.
Enable cull face.
Disable cull face.
Cull front face.
Cull back face.
Cull both front and back face.
Draws triangles.
Draws triangle strip.
Draws points.
Draws lines.
Executes commands in command list.
Draws a command list from frame graph.