mirror of https://github.com/Leinnan/doppler.git
62 lines
1.0 KiB
Rust
62 lines
1.0 KiB
Rust
// settings
|
|
pub const SCR_WIDTH: u32 = 1280;
|
|
pub const SCR_HEIGHT: u32 = 720;
|
|
|
|
pub const VERTEX_SHADER_SRC: &str = r#"
|
|
#version 330 core
|
|
layout (location = 0) in vec3 aPos;
|
|
layout (location = 1) in vec2 aTexCoord;
|
|
|
|
out vec2 TexCoord;
|
|
|
|
uniform mat4 model;
|
|
uniform mat4 view;
|
|
uniform mat4 projection;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = projection * view * model * vec4(aPos, 1.0f);
|
|
TexCoord = vec2(aTexCoord.x, aTexCoord.y);
|
|
}
|
|
"#;
|
|
|
|
pub const FRAGMENT_SHADER_SRC: &str = r#"
|
|
#version 330 core
|
|
out vec4 FragColor;
|
|
|
|
in vec3 ourColor;
|
|
in vec2 TexCoord;
|
|
|
|
// texture sampler
|
|
uniform sampler2D texture1;
|
|
|
|
void main()
|
|
{
|
|
FragColor = texture(texture1, TexCoord);
|
|
}
|
|
"#;
|
|
|
|
pub const SH_FRAG_LAMP: &str = r#"
|
|
#version 330 core
|
|
out vec4 FragColor;
|
|
|
|
void main()
|
|
{
|
|
FragColor = vec4(1.0); // set alle 4 vector values to 1.0
|
|
}
|
|
"#;
|
|
|
|
pub const SH_VERT_LAMP: &str = r#"
|
|
#version 330 core
|
|
layout (location = 0) in vec3 aPos;
|
|
|
|
uniform mat4 model;
|
|
uniform mat4 view;
|
|
uniform mat4 projection;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = projection * view * model * vec4(aPos, 1.0);
|
|
}
|
|
"#;
|