Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_2D_edituvs_stretch_vert.glsl
| Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
| #ifdef STRETCH_ANGLE | #ifdef STRETCH_ANGLE | ||||
| vec2 v1 = angle_to_v2(uv_angles.x * M_PI); | vec2 v1 = angle_to_v2(uv_angles.x * M_PI); | ||||
| vec2 v2 = angle_to_v2(uv_angles.y * M_PI); | vec2 v2 = angle_to_v2(uv_angles.y * M_PI); | ||||
| float uv_angle = angle_normalized_v2v2(v1, v2) / M_PI; | float uv_angle = angle_normalized_v2v2(v1, v2) / M_PI; | ||||
| float stretch = 1.0 - abs(uv_angle - angle); | float stretch = 1.0 - abs(uv_angle - angle); | ||||
| stretch = stretch; | stretch = stretch; | ||||
| stretch = 1.0 - stretch * stretch; | stretch = 1.0 - stretch * stretch; | ||||
| #else | #else | ||||
| float stretch = 1.0 - area_ratio_to_stretch(ratio, totalAreaRatio, -totalAreaRatioInv); | float stretch = 1.0 - area_ratio_to_stretch(ratio, totalAreaRatio, totalAreaRatioInv); | ||||
| #endif | #endif | ||||
| finalColor = vec4(weight_to_rgb(stretch), 1.0); | finalColor = vec4(weight_to_rgb(stretch), 1.0); | ||||
| } | } | ||||