Differential D15898 Diff 56015 source/blender/draw/engines/overlay/shaders/overlay_particle_vert.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/shaders/overlay_particle_vert.glsl
| Show All 10 Lines | |||||
| { | { | ||||
| /* The quaternion representation here stores the w component in the first index. */ | /* The quaternion representation here stores the w component in the first index. */ | ||||
| return vec + 2.0 * cross(quat.yzw, cross(quat.yzw, vec) + quat.x * vec); | return vec + 2.0 * cross(quat.yzw, cross(quat.yzw, vec) + quat.x * vec); | ||||
| } | } | ||||
| void main() | void main() | ||||
| { | { | ||||
| /* Drawsize packed in alpha. */ | /* Drawsize packed in alpha. */ | ||||
| float draw_size = color.a; | float draw_size = ucolor.a; | ||||
| vec3 world_pos = part_pos; | vec3 world_pos = part_pos; | ||||
| #ifdef USE_DOTS | #ifdef USE_DOTS | ||||
| gl_Position = point_world_to_ndc(world_pos); | gl_Position = point_world_to_ndc(world_pos); | ||||
| /* World sized points. */ | /* World sized points. */ | ||||
| gl_PointSize = sizePixel * draw_size * drw_view.winmat[1][1] * sizeViewport.y / gl_Position.w; | gl_PointSize = sizePixel * draw_size * drw_view.winmat[1][1] * sizeViewport.y / gl_Position.w; | ||||
| #else | #else | ||||
| Show All 10 Lines | |||||
| #endif | #endif | ||||
| /* Coloring */ | /* Coloring */ | ||||
| if ((vclass & VCLASS_EMPTY_AXES) != 0) { | if ((vclass & VCLASS_EMPTY_AXES) != 0) { | ||||
| /* See VBO construction for explanation. */ | /* See VBO construction for explanation. */ | ||||
| finalColor = vec4(clamp(pos * 10000.0, 0.0, 1.0), 1.0); | finalColor = vec4(clamp(pos * 10000.0, 0.0, 1.0), 1.0); | ||||
| } | } | ||||
| else if (part_val < 0.0) { | else if (part_val < 0.0) { | ||||
| finalColor = vec4(color.rgb, 1.0); | finalColor = vec4(ucolor.rgb, 1.0); | ||||
| } | } | ||||
| else { | else { | ||||
| finalColor = vec4(texture(weightTex, part_val).rgb, 1.0); | finalColor = vec4(texture(weightTex, part_val).rgb, 1.0); | ||||
| } | } | ||||
| view_clipping_distances(world_pos); | view_clipping_distances(world_pos); | ||||
| } | } | ||||