Differential D6296 Diff 19900 source/blender/draw/engines/overlay/shaders/motion_path_point_vert.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/shaders/motion_path_point_vert.glsl
- This file was moved from source/blender/draw/modes/shaders/animviz_mpath_points_vert.glsl.
| uniform mat4 ViewProjectionMatrix; | uniform ivec4 mpathPointSettings; | ||||
| uniform int pointSize = 2; | |||||
| uniform int frameCurrent; | |||||
| uniform int cacheStart; | |||||
| uniform bool showKeyFrames = true; | uniform bool showKeyFrames = true; | ||||
| uniform bool useCustomColor; | |||||
| uniform vec3 customColor; | uniform vec3 customColor; | ||||
| uniform int stepSize; | |||||
| #define pointSize mpathPointSettings.x | |||||
| #define frameCurrent mpathPointSettings.y | |||||
| #define cacheStart mpathPointSettings.z | |||||
| #define stepSize mpathPointSettings.w | |||||
| in vec3 pos; | in vec3 pos; | ||||
| in int flag; | in int flag; | ||||
| #define MOTIONPATH_VERT_SEL (1 << 0) | #define MOTIONPATH_VERT_SEL (1 << 0) | ||||
| #define MOTIONPATH_VERT_KEY (1 << 1) | #define MOTIONPATH_VERT_KEY (1 << 1) | ||||
| out vec4 finalColor; | out vec4 finalColor; | ||||
| void main() | void main() | ||||
| { | { | ||||
| gl_Position = ViewProjectionMatrix * vec4(pos, 1.0); | gl_Position = ViewProjectionMatrix * vec4(pos, 1.0); | ||||
| gl_PointSize = float(pointSize + 2); | gl_PointSize = float(pointSize + 2); | ||||
| int frame = gl_VertexID + cacheStart; | int frame = gl_VertexID + cacheStart; | ||||
| finalColor = (useCustomColor) ? vec4(customColor, 1.0) : vec4(1.0); | bool use_custom_color = customColor.x >= 0.0; | ||||
| finalColor = (use_custom_color) ? vec4(customColor, 1.0) : vec4(1.0); | |||||
| /* Bias to reduce z fighting with the path */ | /* Bias to reduce z fighting with the path */ | ||||
| gl_Position.z -= 1e-4; | gl_Position.z -= 1e-4; | ||||
| if (gl_VertexID % stepSize == 0) { | if (gl_VertexID % stepSize == 0) { | ||||
| gl_PointSize = float(pointSize) + 4; | gl_PointSize = float(pointSize) + 4; | ||||
| } | } | ||||
| Show All 9 Lines | if (showKeyFrames) { | ||||
| */ | */ | ||||
| if (frame == frameCurrent) { | if (frame == frameCurrent) { | ||||
| gl_PointSize = float(pointSize + 8); | gl_PointSize = float(pointSize + 8); | ||||
| finalColor = colorCurrentFrame; | finalColor = colorCurrentFrame; | ||||
| /* Bias more to get these on top of keyframes */ | /* Bias more to get these on top of keyframes */ | ||||
| gl_Position.z -= 1e-4; | gl_Position.z -= 1e-4; | ||||
| } | } | ||||
| } | } | ||||
| gl_PointSize *= sizePixel; | |||||
| #ifdef USE_WORLD_CLIP_PLANES | |||||
| world_clip_planes_calc_clip_distance(pos); | |||||
| #endif | |||||
| } | } | ||||