# vtkUnstructuredGrid Phong and Gouraud shading

**URL:** https://discourse.vtk.org/t/vtkunstructuredgrid-phong-and-gouraud-shading/198
**Category:** Support
**Created:** [February 1, 2019, 5:34pm UTC](https://discourse.vtk.org/t/vtkunstructuredgrid-phong-and-gouraud-shading/198 "2019-02-01T17:34:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nebulaekg](https://discourse.vtk.org/user_avatar/discourse.vtk.org/nebulaekg/32/82_2.png) [@nebulaekg](https://discourse.vtk.org/u/nebulaekg)
#### Post date: [February 1, 2019, 5:34pm UTC](https://discourse.vtk.org/t/vtkunstructuredgrid-phong-and-gouraud-shading/198/1 "2019-02-01T17:34:49Z")

</div>

Hi, I am new to VTK and try to figure out how to do Phong and Gouraud shading for a vtkUnstructuredGrid. I have tried vtkUnstructuredGrid --\> vtkDataSetSurfaceFilter --\> vtkPolyDataNormals --\> mapper, but still cannot get a desired smooth shading.

```
vtkSmartPointer<vtkDataSetSurfaceFilter> surfaceFilter = vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
surfaceFilter->SetInputData(ugrid);
surfaceFilter->Update();
vtkPolyData* polydata = surfaceFilter->GetOutput();
vtkSmartPointer<vtkPolyDataNormals> polynormals = vtkSmartPointer<vtkPolyDataNormals>::New();
polynormals->SetInputData(polydata);
polynormals->SetConsistency(true);
polynormals->SetComputePointNormals(true);
polynormals->SetComputeCellNormals(true);
polynormals->SetAutoOrientNormals(true);
polynormals->SetFeatureAngle(10.0);
polynormals->Update();
mapper->SetInputConnection(polynormals->GetOutputPort());

```

And for the actor I set

`actor->GetProperty()->SetInterpolationToPhong();`
