Created
August 6, 2020 19:41
-
-
Save pingpoli/2fda6c28d2d0a25c009ca184351a6e62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std::string SimpleParticleShader::VS = "#version 330 core\n" | |
"layout ( location = 0 ) in vec3 vertex_position;" | |
"layout ( location = 4 ) in vec4 position;" | |
"uniform mat4 M_v;" | |
"uniform mat4 M_p;" | |
"uniform float particleSize;" | |
"out float lifetime;" | |
"void main()" | |
"{" | |
" vec4 position_viewspace = M_v * vec4( position.xyz , 1 );" | |
" position_viewspace.xy += particleSize * (vertex_position.xy - vec2(0.5));" | |
" gl_Position = M_p * position_viewspace;" | |
" lifetime = position.w;" | |
"}"; | |
const std::string SimpleParticleShader::FS = "#version 330 core\n" | |
"in float lifetime;" | |
"out vec4 fragColor;" | |
"void main()" | |
"{" | |
" fragColor = vec4( 1.0 );" | |
"}"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment