# Antialiasing Error in Setting Opacity of vtkTexturedSphereSource

**URL:** https://discourse.vtk.org/t/antialiasing-error-in-setting-opacity-of-vtktexturedspheresource/5560
**Category:** Support
**Created:** [April 16, 2021, 3:58pm UTC](https://discourse.vtk.org/t/antialiasing-error-in-setting-opacity-of-vtktexturedspheresource/5560 "2021-04-16T15:58:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![EchoVan](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/439d5e/32.png) [@EchoVan](https://discourse.vtk.org/u/EchoVan)
#### Post date: [April 16, 2021, 3:58pm UTC](https://discourse.vtk.org/t/antialiasing-error-in-setting-opacity-of-vtktexturedspheresource/5560/1 "2021-04-16T15:58:51Z")

</div>

I try to visualize some 3d scatter using vtkTexturedSphereSource. Everything seems well when I using **RenderWindow.SetMultiSamples(12)** to anti-aliasing as the users-guide commend. But when I set opacity by **RenderWindow.SetMultiSamples(12)**, **the sphere become semitransparent, and the antialiasing effect is disappeared**. Second, **when I add shadow for these sphere and set the opacity to less than 1, all of the sphere is vanished**. I don’t know where the question is. The code to set shadow as follow:

```
    shadows = vtk.vtkShadowMapPass()
    seq = vtk.vtkSequencePass()

    passes = vtk.vtkRenderPassCollection()
    passes.AddItem(shadows.GetShadowMapBakerPass())
    passes.AddItem(shadows)
    seq.SetPasses(passes)
    self.CameraPass = vtk.vtkCameraPass()
    self.CameraPass.SetDelegatePass(seq)

    self.Renderer.SetPass(self.CameraPass)

```

Thanks!

Opacity = 1:

 ![NoOpacity](https://discourse.vtk.org/uploads/default/original/2X/5/53d377432c9b72da36100bab91d12f0fc62eafa9.png)

Opacity = 0.3 and not set the shadow:

 ![Opacity](https://discourse.vtk.org/uploads/default/original/2X/f/f817e67ebc90c47f97964014b78c2da07818418f.jpeg)

---

<div class="post-metadata">

### Author: ![EchoVan](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/e/439d5e/32.png) [@EchoVan](https://discourse.vtk.org/u/EchoVan)
#### Post date: [April 17, 2021, 6:15am UTC](https://discourse.vtk.org/t/antialiasing-error-in-setting-opacity-of-vtktexturedspheresource/5560/2 "2021-04-17T06:15:11Z")

</div>

When I set **Render.SetUseFXAA(true)**, the semitransparent sphere antialiasing well!

---

<div class="post-metadata">

### Author: ![unhumano](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/u/3be4f8/32.png) [@unhumano](https://discourse.vtk.org/u/unhumano)
#### Post date: [March 23, 2023, 10:10am UTC](https://discourse.vtk.org/t/antialiasing-error-in-setting-opacity-of-vtktexturedspheresource/5560/3 "2023-03-23T10:10:13Z")

</div>

Did you made the spheres work under shadows?
