pub struct Shader { /* private fields */ }
Implementations§
Source§impl Shader
impl Shader
pub const PASS_VERTEX_2D: &'static str = r#"#version 300 es layout(location = 0) in vec2 a_position; layout(location = 2) in vec4 a_color; out vec4 v_color; void main() { gl_Position = vec4(a_position, 0.0, 1.0); v_color = a_color; } "#
pub const PASS_VERTEX_3D: &'static str = r#"#version 300 es layout(location = 0) in vec3 a_position; layout(location = 3) in vec4 a_color; out vec4 v_color; void main() { gl_Position = vec4(a_position, 1.0); v_color = a_color; } "#
pub const PASS_FRAGMENT: &'static str = r#"#version 300 es precision highp float; precision highp int; in vec4 v_color; out vec4 o_color; void main() { o_color = v_color; } "#
pub const COLORED_VERTEX_2D: &'static str = r#"#version 300 es layout(location = 0) in vec2 a_position; layout(location = 2) in vec4 a_color; out vec4 v_color; uniform mat4 u_projection_view; void main() { gl_Position = u_projection_view * vec4(a_position, 0.0, 1.0); v_color = a_color; } "#
pub const COLORED_VERTEX_3D: &'static str = r#"#version 300 es layout(location = 0) in vec3 a_position; layout(location = 3) in vec4 a_color; out vec4 v_color; uniform mat4 u_projection_view; void main() { gl_Position = u_projection_view * vec4(a_position, 1.0); v_color = a_color; } "#
pub const TEXTURED_VERTEX_2D: &'static str = r#"#version 300 es layout(location = 0) in vec2 a_position; layout(location = 1) in vec3 a_uv; layout(location = 2) in vec4 a_color; out vec4 v_color; out vec3 v_uv; uniform mat4 u_projection_view; void main() { gl_Position = u_projection_view * vec4(a_position, 0.0, 1.0); v_color = a_color; v_uv = a_uv; } "#
pub const TEXTURED_VERTEX_3D: &'static str = r#"#version 300 es layout(location = 0) in vec3 a_position; layout(location = 2) in vec3 a_uv; layout(location = 3) in vec4 a_color; out vec4 v_color; out vec3 v_uv; uniform mat4 u_projection_view; void main() { gl_Position = u_projection_view * vec4(a_position, 1.0); v_color = a_color; v_uv = a_uv; } "#
pub const TEXTURED_FRAGMENT: &'static str = r#"#version 300 es precision highp float; precision highp int; precision highp sampler2DArray; in vec4 v_color; in vec3 v_uv; out vec4 o_color; uniform sampler2DArray u_image; void main() { o_color = texture(u_image, v_uv) * v_color; } "#
pub const TEXT_VERTEX: &'static str = r#"#version 300 es layout(location = 0) in vec2 a_position; layout(location = 1) in vec3 a_uv; layout(location = 2) in vec4 a_color; out vec4 v_color; out vec3 v_uv; uniform mat4 u_projection_view; void main() { gl_Position = u_projection_view * vec4(a_position, 0.0, 1.0); v_color = a_color; v_uv = a_uv; } "#
pub const TEXT_FRAGMENT: &'static str = r#"#version 300 es precision highp float; precision highp int; precision highp sampler2DArray; in vec4 v_color; in vec3 v_uv; out vec4 o_color; uniform sampler2DArray u_image; void main() { float alpha = texture(u_image, v_uv).x; o_color = vec4(v_color.xyz, v_color.w * alpha); } "#
pub fn handle(&self) -> GlowProgram
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Shader
impl !RefUnwindSafe for Shader
impl !Send for Shader
impl !Sync for Shader
impl Unpin for Shader
impl !UnwindSafe for Shader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more