Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Vertex Shader
- #version 450
- #extension GL_ARB_separate_shader_objects : enable
- layout(binding = 0) uniform UniformBufferObject
- {
- mat4 model;
- mat4 view;
- mat4 proj;
- } ubo;
- layout(location = 0) in vec2 inPosition;
- layout(location = 1) in vec3 inColor;
- layout(location = 0) out vec3 fragColor;
- layout(location = 1) out vec2 fragPosition;
- void main()
- {
- gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0);
- fragColor = inColor;
- fragPosition = inPosition;
- }
- // Fragment Shader
- #version 450
- #extension GL_ARB_separate_shader_objects : enable
- layout(location = 0) in vec3 fragColor;
- layout(location = 1) in vec2 fragPosition;
- layout(location = 0) out vec4 outColor;
- vec2 lightPos = {0.5, 0.7};
- void main()
- {
- //float intensity = length(inPosition - lightPos) * 0.5;
- outColor = vec4(fragColor, 1.0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement