diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-02-28 09:21:27 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-02-28 09:21:27 +0300 |
commit | e7d57628c955c1843c70c8fc5023f5d8954847bd (patch) | |
tree | ebd1a94dba38fd2d958850f60a48263aae7ead63 /source/blender/gpu/shaders | |
parent | 5138fe3c0a24d5890438eed90a70401d90423356 (diff) |
OpenGL: keyframe shape fixes
- Size parameter is total size of the shape, not its radius (half size). Updated hard-coded sizes to match this.
- Shader expands size to include outline.
- Fixed fringe between outline color and transparent background.
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_keyframe_diamond_frag.glsl | 2 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_frag.glsl b/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_frag.glsl index 43a7e42153a..ebda79558c7 100644 --- a/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_frag.glsl @@ -29,7 +29,7 @@ void main() { float mid_stroke = 0.5 * (radii[1] + radii[2]); - vec4 backgroundColor = vec4(finalColor.rgb, 0.0); + vec4 backgroundColor = vec4(finalOutlineColor.rgb, 0.0); if (dist > mid_stroke) fragColor = mix(finalOutlineColor, backgroundColor, smoothstep(radii[1], radii[0], dist)); diff --git a/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl b/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl index 69afefa685f..6f33491af55 100644 --- a/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_keyframe_diamond_vert.glsl @@ -26,7 +26,7 @@ void main() { gl_Position = ModelViewProjectionMatrix * vec4(pos, 0.0, 1.0); // pass through unchanged - gl_PointSize = size; + gl_PointSize = size + pixel_fudge; // 0.5 pixel_fudge on either side finalColor = color; finalOutlineColor = outlineColor; |