Thanks for your explanation David. This is a shame as I would expect it is a fairly common requirement for a user to toggle scalars on/off, which perhaps only affect part of an actor, therefore the other parts of the actor logically should stay looking exactly the same as before. I am assuming there is no way to only assign scalars to a portion of an actors cells.<br>
<br>Regards,<br><br><br>Andrew<br><br><br><br><div class="gmail_quote">On 12 April 2011 18:59, David Gobbi <span dir="ltr">&lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Okay, here is my best explanation of what is going on.  Someone<br>
please correct me if there are mistakes.<br>
<br>
The use of lighting coefficients is limited when using scalars.<br>
Generally, VTK uses the scalars as the diffuse color while ignoring<br>
the diffuse coefficient (i.e. assuming it is 1.0).  The ambient and<br>
specular colors and coefficients are used as specified in the<br>
property, i.e. they are not taken from the scalars.<br>
<br>
This behavior can be slightly modified via the mapper<br>
SetScalarMaterialMode method, by making it so that the ambient<br>
color tracks the scalars, or so that both ambient and diffuse color<br>
tracks the scalars.<br>
<br>
Long story short: diffuse coefficient is ignored when using scalars.<br>
This does not appear to be a bug, I think this was done intentionally<br>
to keep the mapper implementation from becoming too complex.<br>
Kind of surprising that it isn&#39;t better documented, though.<br>
<br>
 - David<br>
<br>
<br>
On Tue, Apr 12, 2011 at 10:49 AM, David Gobbi &lt;<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>&gt; wrote:<br>
&gt; Hi Andrew,<br>
&gt;<br>
&gt; I&#39;m not 100% sure on this, but I think it has to do with the<br>
&gt; ScalarMaterialMode in the mapper.  Try doing this, for instance, to<br>
&gt; see if it helps:<br>
&gt;<br>
&gt; mapper-&gt;SetScalarMaterialModeToAmbientAndDiffuse();<br>
&gt;<br>
&gt; The PolyDataMapper seems to use glColor() for color scalars, but it<br>
&gt; uses glMaterial() for the property color, and I think that this is<br>
&gt; responsible for the different behavior.<br>
&gt;<br>
&gt;  - David<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Apr 12, 2011 at 10:23 AM, andrew.derek.ward<br>
&gt; &lt;<a href="mailto:andrew.derek.ward@gmail.com">andrew.derek.ward@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; I am trying to determine how lighting works in colour scalar mode.<br>
&gt;&gt;<br>
&gt;&gt; I have an actor of colour (255,0,0) with ambient lighting set to 0.1 and<br>
&gt;&gt; diffuse lighting set to 0.7<br>
&gt;&gt;<br>
&gt;&gt; Without scalars, this actor looks fine, but if I enable scalars giving every<br>
&gt;&gt; cell the same colour (255,0,0) the<br>
&gt;&gt; diffuse lighting coefficient does not seem to have any affect.<br>
&gt;&gt;<br>
&gt;&gt; It is as though VTK locks the diffuse lighting coefficient to 1.0 when<br>
&gt;&gt; scalars are enabled, giving me a brighter<br>
&gt;&gt; looking actor than my original non-scalar coloured one.<br>
&gt;&gt;<br>
&gt;&gt; This appears to be similar to these unanswered questions:<br>
&gt;&gt; <a href="http://www.vtk.org/pipermail/vtkusers/1999-July/050896.html" target="_blank">http://www.vtk.org/pipermail/vtkusers/1999-July/050896.html</a><br>
&gt;&gt; <a href="http://www.vtk.org/pipermail/vtkusers/2002-October/063444.html" target="_blank">http://www.vtk.org/pipermail/vtkusers/2002-October/063444.html</a><br>
&gt;&gt;<br>
&gt;&gt; Any help/explanation greatly appreciated.<br>
&gt;&gt;<br>
&gt;&gt; Regards,<br>
&gt;&gt;<br>
&gt;&gt; Andrew<br>
&gt;<br>
</blockquote></div><br>