slicing artifact when rendering semi-transparent mesh

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

slicing artifact when rendering semi-transparent mesh

leonid

Dear all,

I have a triangle mesh with no non-manifold edges, with computed normals and correctly oriented
triangles.  The mesh is available at:

        http://schket.freeshell.org/prog/chamber-euclidean.vtk

I want to render it semi-transparent.

Paraview renders it perfectly.  But when I render it in VTK, using this straightforward code:

    import vtk

    def main():
        window = vtk.vtkRenderWindow()
        window.SetSize(500, 500)
        ren = vtk.vtkRenderer()
        window.AddRenderer(ren)
        interactor = vtk.vtkRenderWindowInteractor()
        interactor.SetRenderWindow(window)
        interactor.Initialize()
        reader = vtk.vtkXMLPolyDataReader()
        reader.SetFileName('chamber-euclidean.vtp')
        reader.Update()
        polydata = reader.GetOutput()
        mapper = vtk.vtkPolyDataMapper()
        mapper.SetInputData(polydata)
        actor = vtk.vtkActor()
        actor.SetMapper(mapper)
        actor.GetProperty().SetOpacity(0.5)
        ren.AddActor(actor)
        interactor.Start()

    main()

I get artifacts which look like there are some slicing planes inside the mesh (in reality there
are none).

The artifacts are observed only at certain viewing angles.

You can see an image with artifacts here:

        http://schket.freeshell.org/prog/artifact-image2.png

The artifacts occur both with VTK 6.3 and vtk 7.0, both on Windows and on Linux.  The hardware
is NVIDIA.  Paraview on the same hardware renders without artifacts.

What am I doing wrong?  How to get rid of them?

Many thanks,

leonid

                                           
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: slicing artifact when rendering semi-transparent mesh

leonid
My mesh is produced by vtkMarchingCubes, and I can see that its nodes line up in neat lines (I'm attaching the image "original-edges.png" to illustrate it).

I ran 200 iterations of vtkSmoothPolyData filter, and I can see much less regularity in mesh nodes (see the attachment "smoothed200-edges.png")

The artifacts are now reduced, and they also became less regular, but they are still too noticeable for my purposes.

The question still remains - why are there no artifacts in Paraview?





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: slicing artifact when rendering semi-transparent mesh

RobertS
Hi,
try to use depth peeling as described here
http://www.vtk.org/Wiki/VTK/Depth_Peeling

Robert

-----Original Message-----
From: vtkusers [mailto:[hidden email]] On Behalf Of leonid
Sent: Monday, June 19, 2017 12:22 PM
To: [hidden email]
Subject: Re: [vtkusers] slicing artifact when rendering semi-transparent
mesh

My mesh is produced by vtkMarchingCubes, and I can see that its nodes line
up in neat lines (I'm attaching the image "original-edges.png" to illustrate
it).

I ran 200 iterations of vtkSmoothPolyData filter, and I can see much less
regularity in mesh nodes (see the attachment "smoothed200-edges.png")

The artifacts are now reduced, and they also became less regular, but they
are still too noticeable for my purposes.

The question still remains - why are there no artifacts in Paraview?

<http://vtk.1045678.n5.nabble.com/file/n5743684/original-edges.png>

<http://vtk.1045678.n5.nabble.com/file/n5743684/smoothed200-edges.png>

<http://vtk.1045678.n5.nabble.com/file/n5743684/smoothed200-artifacts.png>



--
View this message in context:
http://vtk.1045678.n5.nabble.com/slicing-artifact-when-rendering-semi-transp
arent-mesh-tp5743682p5743684.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at:
http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers
Loading...