# Problem with ambient and specular color in vtkLight using vtk 8.2.0

**URL:** <https://discourse.vtk.org/t/problem-with-ambient-and-specular-color-in-vtklight-using-vtk-8-2-0/2566>\
**Category:** Support\
**Created:** [February 7, 2020, 4:19pm UTC](https://discourse.vtk.org/t/problem-with-ambient-and-specular-color-in-vtklight-using-vtk-8-2-0/2566 "2020-02-07T16:19:23Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![santichialvo](https://discourse.vtk.org/user_avatar/discourse.vtk.org/santichialvo/32/1248_2.png) [@santichialvo](https://discourse.vtk.org/u/santichialvo)\
**Post date:** [May 2, 2020, 1:41pm UTC](https://discourse.vtk.org/t/problem-with-ambient-and-specular-color-in-vtklight-using-vtk-8-2-0/2566/5 "2020-05-02T13:41:07Z")

</div>

Hi Paulo,  
[CMakeLists-gl1.txt](https://discourse.vtk.org/uploads/short-url/8dADe2JYea3r5sUJw2TEEQaf98u.txt) (969 Bytes) [CMakeLists-gl2.txt](https://discourse.vtk.org/uploads/short-url/vd1SKe66cYCv6t4HiNbqIQCMrty.txt) (971 Bytes) [DiffuseSpheres.cxx](https://discourse.vtk.org/uploads/short-url/oiLztcwzUAAiY0WDao6ggRpnL8x.cxx) (2.6 KB)  
Many thanks for your interest and your help. In order to explain myself better, I made an example to show the behavior of what I am facing and what I expect. I used the spheres tutorial and modify it a bit to fit my purposes.  
On the example, I have only one sphere in the origin (0, 0, 0) and two lights, one blue on the right (1, 0, 0) and the other, red on the left (-1, 0, 0). The sphere’s actor property has only set the specular power § and the specular coefficient (M) on the above equation. Then, I set the light color and specular color. In the red light, I set the specular component to (0.5, 0, 0) whereas in the blue light to (0, 0, 1).

In one case, I use VTK 6.3 with OpenGL backend and I obtain this result:

![image](https://discourse.vtk.org/uploads/default/original/2X/c/c3e6c6798d8f2530a8bfef5c9f03f144a483d062.png)

You can see that the red dot produced by the specular effect is a bit smaller than the blue one.

Then, I use the same VTK version but with OpenGL2 as backend:

![image](https://discourse.vtk.org/uploads/default/original/2X/c/c9c62620658d540f2c62a296cced8c4da7e10997.png)

The red dot produced by both lights is the same size. vtkLight::SetSpecularColor is completely ignored.

You mentioned that this can be a bug of 6.3 version, but in my opinion, it’s more related to OpenGL backend. Do you have any idea of what can be happening? If so, how can I reproduce the same results I get using OpenGL as backend, but using OpenGL2 instead? Attached is the source file with the corresponding CMake files.

Regards,  
Santiago.

---

_[View the full topic](https://discourse.vtk.org/t/problem-with-ambient-and-specular-color-in-vtklight-using-vtk-8-2-0/2566)._
