[vtkusers] Scalars and diffuse lighting

David Gobbi david.gobbi at gmail.com
Tue Apr 12 12:49:10 EDT 2011


Hi Andrew,

I'm not 100% sure on this, but I think it has to do with the
ScalarMaterialMode in the mapper.  Try doing this, for instance, to
see if it helps:

mapper->SetScalarMaterialModeToAmbientAndDiffuse();

The PolyDataMapper seems to use glColor() for color scalars, but it
uses glMaterial() for the property color, and I think that this is
responsible for the different behavior.

 - David


On Tue, Apr 12, 2011 at 10:23 AM, andrew.derek.ward
<andrew.derek.ward at gmail.com> wrote:
> Hello,
>
> I am trying to determine how lighting works in colour scalar mode.
>
> I have an actor of colour (255,0,0) with ambient lighting set to 0.1 and
> diffuse lighting set to 0.7
>
> Without scalars, this actor looks fine, but if I enable scalars giving every
> cell the same colour (255,0,0) the
> diffuse lighting coefficient does not seem to have any affect.
>
> It is as though VTK locks the diffuse lighting coefficient to 1.0 when
> scalars are enabled, giving me a brighter
> looking actor than my original non-scalar coloured one.
>
> This appears to be similar to these unanswered questions:
> http://www.vtk.org/pipermail/vtkusers/1999-July/050896.html
> http://www.vtk.org/pipermail/vtkusers/2002-October/063444.html
>
> Any help/explanation greatly appreciated.
>
> Regards,
>
> Andrew



More information about the vtkusers mailing list