Applying lighting to texture

#1

In a previous project we used a OpenGL fragment shader to apply lighting effect to an input texture. E.g. the final color of the fragment was the source texture multiplied by the lighting value calculated in the fragment shader.

Is there a way to do something similar to this with Vtk or would we have to use a custom fragment shader? Currently when we apply a texture to a surface it looks like the lighting does not affect the texel coloring.

#2

In case it helps anyone else had some success by calling vtkMapper::InterpolateScalarsBeforeMappingOn

(Peter) #3

actor->GetProperty->SetInterpolationToPhong or Goraud for example. Play with ambient, diffuse and specular and texture blendmode.

#4

Thanks Peter