diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2022-08-30 21:21:09 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2022-08-30 21:21:09 +0300 |
commit | 627bd4c46a39ca15a3e12ff7339c66bfdf945936 (patch) | |
tree | 9807e26d32b51920aaca35a15c706e1b0107b401 /source/blender/draw/engines/overlay/shaders | |
parent | 6f52a118a0b0f185b2f17211dc7f86569663290e (diff) | |
parent | f20d0de3b7b4678257669d558a3ebb40115939c7 (diff) |
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'source/blender/draw/engines/overlay/shaders')
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh | 1 | ||||
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/overlay_edit_uv_stretching_vert.glsl | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh index 58f96110887..9396a6d3f2f 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_edit_mode_info.hh @@ -293,7 +293,6 @@ GPU_SHADER_CREATE_INFO(overlay_edit_uv_stretching_area) .do_static_compilation(true) .vertex_in(1, Type::FLOAT, "ratio") .push_constant(Type::FLOAT, "totalAreaRatio") - .push_constant(Type::FLOAT, "totalAreaRatioInv") .additional_info("overlay_edit_uv_stretching"); GPU_SHADER_CREATE_INFO(overlay_edit_uv_stretching_angle) diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_stretching_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_stretching_vert.glsl index bb086e8d9f5..9a3036d5940 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_stretching_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_uv_stretching_vert.glsl @@ -55,9 +55,9 @@ float angle_normalized_v2v2(vec2 v1, vec2 v2) return (q) ? a : M_PI - a; } -float area_ratio_to_stretch(float ratio, float tot_ratio, float inv_tot_ratio) +float area_ratio_to_stretch(float ratio, float tot_ratio) { - ratio *= (ratio > 0.0f) ? tot_ratio : -inv_tot_ratio; + ratio *= tot_ratio; return (ratio > 1.0f) ? (1.0f / ratio) : ratio; } @@ -74,7 +74,7 @@ void main() stretch = stretch; stretch = 1.0 - stretch * stretch; #else - float stretch = 1.0 - area_ratio_to_stretch(ratio, totalAreaRatio, totalAreaRatioInv); + float stretch = 1.0 - area_ratio_to_stretch(ratio, totalAreaRatio); #endif |