# VTK Build in ios OpenGL Error 1282

**URL:** https://discourse.vtk.org/t/vtk-build-in-ios-opengl-error-1282/4304
**Category:** Support
**Created:** [September 26, 2020, 9:10am UTC](https://discourse.vtk.org/t/vtk-build-in-ios-opengl-error-1282/4304 "2020-09-26T09:10:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![wonki](https://discourse.vtk.org/user_avatar/discourse.vtk.org/wonki/32/2345_2.png) [@wonki](https://discourse.vtk.org/u/wonki)
#### Post date: [September 26, 2020, 9:10am UTC](https://discourse.vtk.org/t/vtk-build-in-ios-opengl-error-1282/4304/1 "2020-09-26T09:10:12Z")

</div>

Hello~ I’m freshman at researching volume rendering of medical data.

I’m stuck at error of opengl long time… Help me please.

Build VTK Tag 8.2 for ios by cmake.

I set the build option like this

- VTK\_IOS\_BUILD to true
- Module\_vtkDicom to true
- Module vtkIOImage to true
- Module vtkIOGeometry to true
- Module vtkInteractionStyle to true
- Module vtkRenderingOpenGL to true
- Module vtkRenderingVolumeOpenGL to true
- OpenGL\_ES\_VERSION to 3.0
- CMAKE\_FRAMEWORK\_INSTALL\_PREFIX to /usr/local/frameworks

And I build `vtk.framework` well. And I have an few error with running `examples/ios/volumerenderer` application in vtk example ios. Resolved othre errors, it left one error finally. But I can’t find what cause this error…

Rendering data is sample `mr-head.nrrd` that is 3 dimension 256 by 256 by 130 and byte data type. Error message occured like this.

```auto
Generic Warning: In /Users/wonkieun/Documents/Project/VTK/Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx, line 1230

Error after glDrawElements in RenderVolumeGeometry! 1 OpenGL errors detected

0 : (1282) Invalid operation

Generic Warning: In /Users/wonkieun/Documents/Project/VTK/Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx, line 1230

Error after glDrawElements in RenderVolumeGeometry! 1 OpenGL errors detected

0 : (1282) Invalid operation

```

Strongly, I want to render volume of medical data by ipad… Please help me.

---

<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: [September 28, 2020, 3:25pm UTC](https://discourse.vtk.org/t/vtk-build-in-ios-opengl-error-1282/4304/2 "2020-09-28T15:25:43Z")

</div>

Hi, friend,

Can you post the link to the example you’re trying to run?

cheers,

Paulo

---

<div class="post-metadata">

### Author: ![wonki](https://discourse.vtk.org/user_avatar/discourse.vtk.org/wonki/32/2345_2.png) [@wonki](https://discourse.vtk.org/u/wonki)
#### Post date: [October 6, 2020, 1:20am UTC](https://discourse.vtk.org/t/vtk-build-in-ios-opengl-error-1282/4304/3 "2020-10-06T01:20:07Z")

</div>

I tried to basic sample volume render application in vtk. (in [link](https://github.com/Kitware/VTK/tree/master/Examples/iOS/VolumeRender)))

New vtk 7.0.0 built by same option wokrs well now.

But I met other problem. Well… sample [data](https://www.slicer.org/wiki/File:CT-chest.nrrd) is rendered normally, but other datas are not.

I want to know the supported data specification in ios vtk and opengl es3.

File type (nrrd, dcm, vtk…), data type (unsigned byte, short, int, float…), resolution (like 512 x 512x 130) are that I want to know. I can’t find them… Information is too little.

```
// sample CT-chest.nrrrd : normally rendering
NRRD0004
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html
type: int
dimension: 3
space: left-posterior-superior
sizes: 512 512 139
space directions: (0.76171898841857932,0,0) (0,0.76171898841857932,0) (0,0,2.5)
kinds: domain domain domain
endian: little
encoding: raw
space origin: (-195.00000000000003,-171.69999694824224,-347.75000000000011)

// other data : nor working
NRRD0004
# Complete NRRD file format specification at:
# http://teem.sourceforge.net/nrrd/format.html
type: short
dimension: 3
space: left-posterior-superior
sizes: 512 512 187
space directions: (0.728515625,0,0) (0,0.728515625,0) (0,0,2)
kinds: domain domain domain
endian: little
encoding: raw
space origin: (-187.1357421875,-320.13574218750006,1444)
```

---

<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: [October 8, 2020, 5:52pm UTC](https://discourse.vtk.org/t/vtk-build-in-ios-opengl-error-1282/4304/4 "2020-10-08T17:52:16Z")

</div>

Hello, friend,

That link to the example you posted is broken. But googling a bit for “gl error 1282 Invalid operation” led me to some shader errors. Anyway, without the source code I’m just guessing.

cheers,

Paulo
