4
$\begingroup$

Retrogression in version 12.2 or 12.1

I am making an animation with transparency, antialiasing fails when the transparency reaches certain values, which brings a jitter. A minimalist example:

Graphics[{{Opacity[0.01],RGBColor[0.5,1,1],Disk[]},{Circle[],Line[CirclePoints[5]]}}]
Graphics[{{Opacity[0.05],RGBColor[0.1,0,0],Disk[]},{Circle[],Line[CirclePoints[5]]}}]

Manipulate[Graphics[{{Opacity[t],RGBColor[{5, 166, 238}/255.],Disk[]},{Circle[],Line[CirclePoints[5]]}},
  PlotRange->1.1],{t,0,0.3}]

enter image description here

$Version

13.2.1 for Microsoft Windows (64-bit) (January 27, 2023)

Can you reproduce it, is there a workaround?

$\endgroup$
2
  • $\begingroup$ You could rasterize it at a high resolution as a workaround, e.g do Rasterize[..., RasterSize->1024] $\endgroup$
    – flinty
    Mar 8, 2023 at 11:11
  • $\begingroup$ Looks like an interesting quirk with DX. Experimentally, you would need to keep the value of Opacity in the range of 0.012 to 1.0. $\endgroup$
    – ihojnicki
    Mar 8, 2023 at 15:27

1 Answer 1

2
$\begingroup$

You can use Style option RenderingOptions to directly control the anti-aliasing settings.

Style[
 Graphics[{{Opacity[0.05], RGBColor[0.1, 0, 0], Disk[]}, {Circle[], 
    Line[CirclePoints[5]]}}]
 , RenderingOptions -> {"HardwareAntialiasingQuality" -> 1.}
 ]

If you have a dedicated GPU that performs better than your integrated GPU then also try setting your dedicated GPU as the default renderer in your system settings for one of your system's supported "3DRenderingEngine". Then use that engine to render the graphic.

For example, with your dedicated GPU set as the default for your system's "Direct3D" renderer,

Style[
 Graphics[{{Opacity[0.05], RGBColor[0.1, 0, 0], Disk[]}, {Circle[], 
    Line[CirclePoints[5]]}}]
 , RenderingOptions -> {
   "3DRenderingEngine" -> "Direct3D"
   , "HardwareAntialiasingQuality" -> 1.
   }
 ]

Hope this helps.

$\endgroup$
1
  • 1
    $\begingroup$ Still a problem for me, the jitter can't be eliminated. $\endgroup$
    – matrix42
    Mar 12, 2023 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.