- Timestamp:
- Aug 2, 2019, 4:15:02 AM (5 years ago)
- Branches:
- feature/imgui-sdl, master, points-test
- Children:
- 4f63fa8
- Parents:
- 621664a
- git-author:
- Dmitry Portnoy <dmp1488@…> (08/02/19 04:01:00)
- git-committer:
- Dmitry Portnoy <dmp1488@…> (08/02/19 04:15:02)
- Location:
- shaders
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
shaders/shader.frag
r621664a rfba08f2 2 2 #extension GL_ARB_separate_shader_objects : enable 3 3 4 layout(binding = 1) uniform sampler2D texSampler; 5 4 6 layout(location = 0) in vec3 fragColor; 7 layout(location = 1) in vec2 fragTexCoord; 5 8 6 9 layout(location = 0) out vec4 outColor; 7 10 8 11 void main() { 9 outColor = vec4(fragColor, 1.0); 12 // outColor = vec4(fragColor, 1.0); 13 // outColor = texture(texSampler, fragTexCoord); 14 outColor = vec4(fragColor * texture(texSampler, fragTexCoord).rgb, 1.0); 10 15 } -
shaders/shader.vert
r621664a rfba08f2 1 1 #version 450 2 2 #extension GL_ARB_separate_shader_objects : enable 3 4 vec2 positions[3] = vec2[]( 5 vec2( 0.0, 0.5), 6 vec2(-0.5, -0.5), 7 vec2( 0.5, -0.5) 8 ); 3 9 4 10 layout (binding = 0) uniform UniformBufferObject { … … 10 16 layout(location = 0) in vec2 inPosition; 11 17 layout(location = 1) in vec3 inColor; 18 layout(location = 2) in vec2 inTexCoord; 12 19 13 20 layout(location = 0) out vec3 fragColor; 21 layout(location = 1) out vec2 fragTexCoord; 14 22 15 23 void main() { 16 gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0); 24 // gl_Position = ubo.proj * ubo.view * ubo.model * vec4(inPosition, 0.0, 1.0); 25 gl_Position = ubo.proj * ubo.view * ubo.model * vec4(positions[gl_VertexIndex], -5.0, 1.0); 17 26 fragColor = inColor; 27 fragTexCoord = inTexCoord; 18 28 }
Note:
See TracChangeset
for help on using the changeset viewer.