Commit 4897ffe
BUG: Ensure that distinct polygon collections are shaded identically (#12792)
* BUG: Ensure that distinct polygon collections are shaded identically
Right now, shading ratios are computed by computing a shade in [-1, 1] for each face from the normal vector, and then normalizing across the polygon collection so that the brightest face has shade=1, and the dimmest shade=0.5.
This behaves poorly with multiple polygon collections, as the normalization is internal to each.
This results in two polygons with the same orientation but in different collections ending up with different shadings.
Notably, this obstructs the shading of `ax.voxels()`.
This approach instead scales `[-1, 1]` to `[0.4, 1]`, ignoring the local brightness minima and maxima within a collection.
Some more noticeable effects of this change:
* Highlights will be darker, unless they were already directly facing the light source
* Contrast between extreme highlights and shadows will be slightly greater (from 1:0.5 to 1:0.4)
* fixup: Resolve PEP8 complaints1 parent 465f51a commit 4897ffe
File tree
6 files changed
+10
-3
lines changed- lib/mpl_toolkits
- mplot3d
- tests/baseline_images/test_mplot3d
6 files changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1774 | 1774 | | |
1775 | 1775 | | |
1776 | 1776 | | |
1777 | | - | |
1778 | | - | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
1779 | 1786 | | |
1780 | 1787 | | |
1781 | 1788 | | |
1782 | 1789 | | |
1783 | 1790 | | |
1784 | | - | |
| 1791 | + | |
1785 | 1792 | | |
1786 | 1793 | | |
1787 | 1794 | | |
| |||
Binary file not shown.
0 commit comments