# Quadratic quad rendering difference between 9.2.6 and 9.4.1

**URL:** https://discourse.vtk.org/t/quadratic-quad-rendering-difference-between-9-2-6-and-9-4-1/15199
**Category:** Support
**Created:** [January 22, 2025, 8:58pm UTC](https://discourse.vtk.org/t/quadratic-quad-rendering-difference-between-9-2-6-and-9-4-1/15199 "2025-01-22T20:58:27Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![biagas](https://discourse.vtk.org/user_avatar/discourse.vtk.org/biagas/32/7380_2.png) [@biagas](https://discourse.vtk.org/u/biagas)
#### Post date: [January 22, 2025, 8:58pm UTC](https://discourse.vtk.org/t/quadratic-quad-rendering-difference-between-9-2-6-and-9-4-1/15199/1 "2025-01-22T20:58:27Z")

</div>

Can anyone explain what changed between 9.2.6 (on the left) and 9.4.1 (on the right) that would result in such a drastic difference in rendering?  
 ![RenderingQuadraticQuads](https://discourse.vtk.org/uploads/default/original/2X/3/334bc0594bb14a2478a7e800c372f368040ef4b3.png)

I understand that I can tessellate and get better results, I am just surprised at the change.

Here’s the source code used to generate the images.

```auto
#include <vtkActor.h>
#include <vtkDataSetMapper.h>
#include <vtkDataSetReader.h>
#include <vtkInteractorStyleTrackballCamera.h>
#include <vtkLookupTable.h>
#include <vtkNew.h>
#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>

int
main(int argc, char **argv)
{
  vtkNew<vtkDataSetReader> reader;
  reader->SetFileName("quadraticQuads.vtk");
  reader->Update();

  vtkNew<vtkLookupTable> lut;
  lut->SetHueRange(0.6667, 0.0);

  vtkNew<vtkDataSetMapper> mapper; 

  mapper->SetInputConnection(reader->GetOutputPort());
  mapper->SetLookupTable(lut);
  mapper->ScalarVisibilityOn();
  mapper->SetScalarRange(-1, 1);
  mapper->SetInterpolateScalarsBeforeMapping(0);

  vtkNew<vtkActor> actor; 
  actor->SetMapper(mapper);

  vtkNew<vtkRenderer> renderer;
  vtkNew<vtkRenderWindow> renwin;
  renwin->AddRenderer(renderer);
  vtkNew<vtkInteractorStyleTrackballCamera> style; 
  vtkNew<vtkRenderWindowInteractor> iren;
  iren->SetInteractorStyle(style);
  iren->SetRenderWindow(renwin);
 
  renderer->AddActor(actor);
  renwin->Render();
  iren->Start();

  return 0;
}

```

Here’s the contents of the vtk file:

```auto
# vtk DataFile Version 4.2
vtk output
ASCII
DATASET UNSTRUCTURED_GRID
POINTS 25 double
1 0 0 1 0 0.5 1 0 1 
1 0 1.5 1 0 2 0.7071067 0.7071067 0 
0.7071067 0.7071067 0.5 0.7071067 0.7071067 1 0.7071067 0.7071067 1.5 
0.7071067 0.7071067 2 0 1 0 0 1 0.5 
0 1 1 0 1 1.5 0 1 2 
-0.7071067 0.7071067 0 -0.7071067 0.7071067 0.5 -0.7071067 0.7071067 1 
-0.7071067 0.7071067 1.5 -0.7071067 0.7071067 2 -1 0 0 
-1 0 0.5 -1 0 1 -1 0 1.5 
-1 0 2 
CELLS 4 36
8 0 2 12 10 1 7 11 5 
8 2 4 14 12 3 9 13 7 
8 10 12 22 20 11 17 21 15 
8 12 14 24 22 13 19 23 17 

CELL_TYPES 4
23
23
23
23

POINT_DATA 25
SCALARS foo double
LOOKUP_TABLE default
1 1 1 1 1 0.7071067 0.7071067 0.7071067 0.7071067 
0.7071067 0 0 0 0 0 -0.7071067 -0.7071067 -0.7071067 
-0.7071067 -0.7071067 -1 -1 -1 -1 -1 

```

---

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [January 23, 2025, 2:29pm UTC](https://discourse.vtk.org/t/quadratic-quad-rendering-difference-between-9-2-6-and-9-4-1/15199/2 "2025-01-23T14:29:39Z")

</div>

Both geometries are clearly different, hence different results.

They seem to have the same vertexes, but topology is being differently interpreted from the file.

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [January 23, 2025, 3:08pm UTC](https://discourse.vtk.org/t/quadratic-quad-rendering-difference-between-9-2-6-and-9-4-1/15199/3 "2025-01-23T15:08:23Z")

</div>

Loading your VTK file in ParaView 5.13.1 and setting NonLinear Subdivision Level to 4 shows:

 ![Subdivision 4](https://discourse.vtk.org/uploads/default/original/2X/c/c5da81af386c96b718dd44f1e39456aaaedee2be.jpeg)

For subdivision 1 I get:

 ![Subdivision 1](https://discourse.vtk.org/uploads/default/original/2X/9/93375badb1a07ba82583d763db80f8533e6d434c.jpeg)

and for subdivision 0 I get:

 ![image](https://discourse.vtk.org/uploads/default/original/2X/b/b3621c502ccd2cfd4c23e37b25c60726aba4f3b7.jpeg)

Given that there are 4 cells the results make sense to me. I am not sure how you would get the result from 9.2.6, so I would call this a bug fix.

You might be able to fix the hard shadows in your 9.4.1 image by adding another light source or using the light kit: see View \> Light Inspector in ParaView.

---

<div class="post-metadata">

### Author: ![biagas](https://discourse.vtk.org/user_avatar/discourse.vtk.org/biagas/32/7380_2.png) [@biagas](https://discourse.vtk.org/u/biagas)
#### Post date: [January 23, 2025, 6:55pm UTC](https://discourse.vtk.org/t/quadratic-quad-rendering-difference-between-9-2-6-and-9-4-1/15199/4 "2025-01-23T18:55:49Z")

</div>

Looking back, I think VTK version 8 yielded the same results as 9.4.1, so I agree with the assessment it is a bug fix. Thanks for the replies!
