<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Utkarsh, dear all,<br>
    <br>
    thanks for your answer. This was just an example (maybe a rather
    stupid one). Please let me rephrase my question:<br>
    I am trying to extend the pointSprites plugin with my own shaders.
    For this I would like to pass up to 3 size parameters and the 4
    components of quarternions for orientation to the shader code.
    Currently I do it like this:<br>
    <br>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">void vtkPointSpriteProperty::Render(vtkActor *act, vtkRenderer *ren)
{
   <span style=" color:#800080;">vtkPainterPolyDataMapper</span><span style=" color:#000000;">*</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">mapper</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">vtkPainterPolyDataMapper</span><span style=" color:#000000;">::</span><span style=" color:#000000;">SafeDownCast</span><span style=" color:#000000;">(</span><span style=" color:#000000;">act</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">GetMapper</span><span style=" color:#000000;">());</span></pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">      </span><span style=" color:#808000;">if</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">)</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">      </span><span style=" color:#000000;">{</span></pre>
    <span style=" color:#c0c0c0;">                </span><span style="
      color:#000000;">mapper</span><span style=" color:#000000;">-></span><span
      style=" font-style:italic; color:#000000;">RemoveVertexAttributeMapping</span><span
      style=" color:#000000;">(</span><span style=" color:#008000;">"SizeParam1"</span><span
      style=" color:#000000;">);</span>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">MapDataArrayToVertexAttribute</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"SizeParam1"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam1ArrayName</span><span style=" color:#000000;">,</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">            </span><span style=" color:#800080;">vtkDataObject</span><span style=" color:#000000;">::</span><span style=" color:#800080;">FIELD_ASSOCIATION_POINTS</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#000080;">1</span><span style=" color:#000000;">);</span></pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">RemoveVertexAttributeMapping</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"SizeParam2"</span><span style=" color:#000000;">);</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">MapDataArrayToVertexAttribute</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"SizeParam2"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam2ArrayName</span><span style=" color:#000000;">,</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">            </span><span style=" color:#800080;">vtkDataObject</span><span style=" color:#000000;">::</span><span style=" color:#800080;">FIELD_ASSOCIATION_POINTS</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#000080;">1</span><span style=" color:#000000;">);</span></pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">RemoveVertexAttributeMapping</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"SizeParam3"</span><span style=" color:#000000;">);</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">MapDataArrayToVertexAttribute</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"SizeParam3"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam3ArrayName</span><span style=" color:#000000;">,</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">            </span><span style=" color:#800080;">vtkDataObject</span><span style=" color:#000000;">::</span><span style=" color:#800080;">FIELD_ASSOCIATION_POINTS</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#000080;">1</span><span style=" color:#000000;">);</span></pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">RemoveVertexAttributeMapping</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionW"</span><span style=" color:#000000;">);</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">MapDataArrayToVertexAttribute</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionW"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionWArrayName</span><span style=" color:#000000;">,</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">            </span><span style=" color:#800080;">vtkDataObject</span><span style=" color:#000000;">::</span><span style=" color:#800080;">FIELD_ASSOCIATION_POINTS</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#000080;">1</span><span style=" color:#000000;">);</span></pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">RemoveVertexAttributeMapping</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionX"</span><span style=" color:#000000;">);</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">MapDataArrayToVertexAttribute</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionX"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionXArrayName</span><span style=" color:#000000;">,</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">            </span><span style=" color:#800080;">vtkDataObject</span><span style=" color:#000000;">::</span><span style=" color:#800080;">FIELD_ASSOCIATION_POINTS</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#000080;">1</span><span style=" color:#000000;">);</span></pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">RemoveVertexAttributeMapping</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionY"</span><span style=" color:#000000;">);</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">MapDataArrayToVertexAttribute</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionY"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionYArrayName</span><span style=" color:#000000;">,</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">            </span><span style=" color:#800080;">vtkDataObject</span><span style=" color:#000000;">::</span><span style=" color:#800080;">FIELD_ASSOCIATION_POINTS</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#000080;">1</span><span style=" color:#000000;">);</span></pre>
    <pre style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
</pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">RemoveVertexAttributeMapping</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionZ"</span><span style=" color:#000000;">);</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">MapDataArrayToVertexAttribute</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionZ"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionZArrayName</span><span style=" color:#000000;">,</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">            </span><span style=" color:#800080;">vtkDataObject</span><span style=" color:#000000;">::</span><span style=" color:#800080;">FIELD_ASSOCIATION_POINTS</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#000080;">1</span><span style=" color:#000000;">);

</span>
<span style=" color:#000000;"><span style=" color:#c0c0c0;">    </span><span style=" color:#000000;"></span>
<span style=" color:#c0c0c0;">    </span></span><span style=" color:#000000;"><span style=" color:#000000;"><span style=" color:#c0c0c0;"></span><span style=" color:#808000;">if</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">Internal</span><span style=" color:#000000;">-></span><span style=" color:#800000;">PushedAttrib</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">==</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">0</span><span style=" color:#000000;">)</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">{</span>
<span style=" color:#c0c0c0;">      </span><span style=" color:#000000;">glPushAttrib</span><span style=" color:#000000;">(</span><span style=" color:#000080;">GL_ALL_ATTRIB_BITS</span><span style=" color:#000000;">);</span>
<span style=" color:#c0c0c0;">      </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">Internal</span><span style=" color:#000000;">-></span><span style=" color:#800000;">PushedAttrib</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">1</span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">}</span></span><span style=" color:#000000;"></span>
<span style=" color:#c0c0c0;">     

</span></span>
<span style=" color:#c0c0c0;">      </span><span style=" color:#000000;">glEnable</span><span style=" color:#000000;">(</span><span style=" color:#800080;">vtkgl</span><span style=" color:#000000;">::</span>VERTEX_PROGRAM_POINT_SIZE_ARB<span style=" color:#000000;">);

</span><span style=" color:#000000;"><span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">sizeParam1Span</span><span style=" color:#000000;">[</span><span style=" color:#000080;">2</span><span style=" color:#000000;">];</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">sizeParam1Span</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam1Range</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#000000;"></span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">sizeParam1Span</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam1Range</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam1Range</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">])</span><span style=" c
 olor:#0
00000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">AddShaderVariable</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"SizeParam1Span"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">2</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">sizeParam1Span</span><span style=" color:#000000;">);</span>


<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">sizeParam2Span</span><span style=" color:#000000;">[</span><span style=" color:#000080;">2</span><span style=" color:#000000;">];</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">sizeParam2Span</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam2Range</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">sizeParam2Span</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam2Range</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam2Range</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">])</span><span style=" c
 olor:#0
00000;"></span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">AddShaderVariable</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"SizeParam2Span"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">2</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">sizeParam2Span</span><span style=" color:#000000;">);</span>


<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">sizeParam3Span</span><span style=" color:#000000;">[</span><span style=" color:#000080;">2</span><span style=" color:#000000;">];</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">sizeParam3Span</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam3Range</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">*</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">factor</span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">sizeParam3Span</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam3Range</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">SizeParam3Range</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">])</span><span style=" c
 olor:#0
00000;"></span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">AddShaderVariable</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"SizeParam3Span"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">2</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">sizeParam3Span</span><span style=" color:#000000;">);</span>




<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">rotQionWSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">2</span><span style=" color:#000000;">];</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">rotQionWSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionWRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#000000;"></span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">rotQionWSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionWRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionWRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">])</span><span style=" color:#
 000000;
">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">AddShaderVariable</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionWSpan"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">2</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">rotQionWSpan</span><span style=" color:#000000;">);</span>


<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">rotQionXSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">2</span><span style=" color:#000000;">];</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">rotQionXSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionXRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">rotQionXSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionXRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionXRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">])</span><span style=" color:#
 000000;
">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">AddShaderVariable</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionXSpan"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">2</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">rotQionXSpan</span><span style=" color:#000000;">);</span>


<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">rotQionYSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">2</span><span style=" color:#000000;">];</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">rotQionYSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionYRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#000000;"></span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">rotQionYSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionYRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionYRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">])</span><span style=" color:#
 000000;
"></span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">AddShaderVariable</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionYSpan"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">2</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">rotQionYSpan</span><span style=" color:#000000;">);</span>


<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">rotQionZSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">2</span><span style=" color:#000000;">];</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">rotQionZSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionZRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">]</span><span style=" color:#000000;"></span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">rotQionZSpan</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionZRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">1</span><span style=" color:#000000;">]</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">-</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">RotQionZRange</span><span style=" color:#000000;">[</span><span style=" color:#000080;">0</span><span style=" color:#000000;">])</span><span style=" color:#
 000000;
">;</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">AddShaderVariable</span><span style=" color:#000000;">(</span><span style=" color:#008000;">"rotQionZSpan"</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">2</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">rotQionZSpan</span><span style=" color:#000000;">);

</span></span>
<span style=" color:#000000;"><span style=" color:#000000;"><span style=" color:#808000;">  this</span><span style=" color:#000000;">-></span><span style=" color:#800080;">Superclass</span><span style=" color:#000000;">::</span><span style=" font-style:italic; color:#000000;">Render</span><span style=" color:#000000;">(</span><span style=" color:#000000;">act</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">ren</span><span style=" color:#000000;">);</span></span>
}


in my vertex shader code I have something like this

in float SizeParam1;
</span><span style=" color:#000000;">in float SizeParam2;</span>
<span style=" color:#000000;">in float SizeParam3;</span>

<span style=" color:#808000;">uniform</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">vec2</span><span style=" color:#c0c0c0;"> </span>SizeParam1Span;
<span style=" color:#808000;">uniform</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">vec2</span><span style=" color:#c0c0c0;"> </span>SizeParam2Span;
<span style=" color:#808000;">uniform</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">vec2</span><span style=" color:#c0c0c0;"> </span>SizeParam3Span;

<span style=" color:#c0c0c0;">    </span><span style=" color:#808000;">vec3</span><span style=" color:#c0c0c0;"> </span>radius<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">vec3</span>(<span style=" color:#000080;">0.0</span>,<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">0.0</span>,<span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">0.0</span>);


<span style=" color:#c0c0c0;">    </span>radius.x<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>SizeParam1Span.x+SizeParam1*SizeParam1Span.y;
<span style=" color:#c0c0c0;">    </span>radius.y<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>SizeParam2Span.x+SizeParam2*SizeParam2Span.y;
<span style=" color:#c0c0c0;">    </span>radius.z<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>SizeParam3Span.x+SizeParam3*SizeParam3Span.y;

 ...


 
<span style=" color:#808000;">in</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span>rotQionW;
<span style=" color:#808000;">in</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span>rotQionX;
<span style=" color:#808000;">in</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span>rotQionY;
<span style=" color:#808000;">in</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">float</span><span style=" color:#c0c0c0;"> </span>rotQionZ;

<span style=" color:#808000;">uniform</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">vec2</span><span style=" color:#c0c0c0;"> </span>rotQionWSpan;
<span style=" color:#808000;">uniform</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">vec2</span><span style=" color:#c0c0c0;"> </span>rotQionXSpan;
<span style=" color:#808000;">uniform</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">vec2</span><span style=" color:#c0c0c0;"> </span>rotQionYSpan;
<span style=" color:#808000;">uniform</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">vec2</span><span style=" color:#c0c0c0;"> </span>rotQionZSpan;


<span style=" color:#c0c0c0;">  </span><span style=" color:#808000;">vec4</span><span style=" color:#c0c0c0;"> </span>rotQions=<span style=" color:#808000;">vec4</span>(<span style=" color:#000080;">1.0</span>,<span style=" color:#000080;">0.0</span>,<span style=" color:#000080;">0.0</span>,<span style=" color:#000080;">0.0</span>);


<span style=" color:#c0c0c0;">  </span>rotQions.w<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>rotQionWSpan.x<span style=" color:#c0c0c0;"> </span>+<span style=" color:#c0c0c0;"> </span>rotQionW<span style=" color:#c0c0c0;"> </span>*<span style=" color:#c0c0c0;"> </span>rotQionWSpan.y;
<span style=" color:#c0c0c0;">  </span>rotQions.x<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>rotQionXSpan.x<span style=" color:#c0c0c0;"> </span>+<span style=" color:#c0c0c0;"> </span>rotQionX<span style=" color:#c0c0c0;"> </span>*<span style=" color:#c0c0c0;"> </span>rotQionXSpan.y;
<span style=" color:#c0c0c0;">  </span>rotQions.y<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>rotQionYSpan.x<span style=" color:#c0c0c0;"> </span>+<span style=" color:#c0c0c0;"> </span>rotQionY<span style=" color:#c0c0c0;"> </span>*<span style=" color:#c0c0c0;"> </span>rotQionYSpan.y;
<span style=" color:#c0c0c0;">  </span>rotQions.z<span style=" color:#c0c0c0;"> </span>=<span style=" color:#c0c0c0;"> </span>rotQionZSpan.x<span style=" color:#c0c0c0;"> </span>+<span style=" color:#c0c0c0;"> </span>rotQionZ<span style=" color:#c0c0c0;"> </span>*<span style=" color:#c0c0c0;"> </span>rotQionZSpan.y;

  ...


I discovered that my the data of the field variable (<span style=" color:#c0c0c0;"></span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">...ArrayName</span>) passed into

<span style=" font-style:italic; color:#000000;">MapDataArrayToVertexAttribute</span><span style=" color:#000000;"></span>(...)

is somehow between 0 and 1. This is why I also have to pass the span to convert it back ( as it is done in the original pointSprite plugin code).


Even though I can render some geometry (for example ellipsoids) around several points/vertices (=this means my shader code works), I have the feeling that the Mapping to the individual vertices is not working as expected !

For example in the case of having three vertices of which each one has different values for SizeParam1, SizeParam2 and SizeParam3 - for example:

v1 : pos(0,0,0) SizeParam1 = 1.0, SizeParam2 = 1.0, SizeParam3 = 1.0
v2 : pos(0,1,0) SizeParam1 = 1.0, SizeParam2 = 2.0, SizeParam3 = 0.5
v3 : pos(0,0,1) SizeParam1 = 1.0, SizeParam2 = 1.0, SizeParam3 = 1.0


where the values for SizeParam1, SizeParam2 and SizeParam3 are taken from the selected fields (=multiblock, where individual blocks represent individual time steps) associated with the points/vertices.


Nevertheless the individual vertices do not seem to receive their correct values !
My current problem is that all of them are rendered the same size, thus I assume that the shader variables are not passed as expected.


The essential difference to the original pointSprites code is that I have several calls to 
</pre>
    <br>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">RemoveVertexAttributeMapping</span><span style=" color:#000000;">(</span><span style=" color:#008000;">...</span><span style=" color:#000000;">);</span></pre>
    <pre style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#c0c0c0;">        </span><span style=" color:#000000;">mapper</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">MapDataArrayToVertexAttribute</span><span style=" color:#000000;">(...);

whereas in the original pointSprites implementation there was only 1 call for the RadiusArray.
I checked with the debugger and found that the mappings are added to the array
</span><span style=" color:#000000;"><span style=" color:#c0c0c0;"></span><span style=" color:#800080;">vtkGenericVertexAttributeMapping</span>* mappings in

</span><span style=" color:#808000;">void</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">vtkPainterPolyDataMapper</span><span style=" color:#000000;">::</span><span style=" font-style:italic; color:#000000;">MapDataArrayToVertexAttribute</span><span style=" color:#000000;">(</span>
<span style=" color:#c0c0c0;">  </span><span style=" color:#808000;">const</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">char</span><span style=" color:#000000;">*</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">vertexAttributeName</span><span style=" color:#000000;">,</span>
<span style=" color:#c0c0c0;">  </span><span style=" color:#808000;">const</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">char</span><span style=" color:#000000;">*</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">dataArrayName</span><span style=" color:#000000;">,</span>
<span style=" color:#c0c0c0;">  </span><span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">field</span><span style=" color:#000000;">,</span>
<span style=" color:#c0c0c0;">  </span><span style=" color:#808000;">int</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">componentno</span><span style=" color:#000000;">)</span>
<span style=" color:#000000;">{</span>
<span style=" color:#c0c0c0;">  </span><span style=" color:#800080;">vtkGenericVertexAttributeMapping</span><span style=" color:#000000;">*</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">mappings</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000080;">0</span><span style=" color:#000000;">;</span>
<span style=" color:#c0c0c0;">  </span><span style=" color:#808000;">if</span><span style=" color:#000000;">(</span><span style=" color:#c0c0c0;"> </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">PainterInformation</span><span style=" color:#000000;">-></span><span style=" color:#000000;">Has</span><span style=" color:#000000;">(</span>
<span style=" color:#c0c0c0;">      </span><span style=" color:#800080;">vtkPrimitivePainter</span><span style=" color:#000000;">::</span><span style=" color:#000000;">DATA_ARRAY_TO_VERTEX_ATTRIBUTE</span><span style=" color:#000000;">())</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">)</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">{</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">mappings</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">vtkGenericVertexAttributeMapping</span><span style=" color:#000000;">::</span><span style=" color:#000000;">SafeDownCast</span><span style=" color:#000000;">(</span>
<span style=" color:#c0c0c0;">      </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">PainterInformation</span><span style=" color:#000000;">-></span><span style=" color:#000000;">Get</span><span style=" color:#000000;">(</span>
<span style=" color:#c0c0c0;">        </span><span style=" color:#800080;">vtkPolyDataPainter</span><span style=" color:#000000;">::</span><span style=" color:#000000;">DATA_ARRAY_TO_VERTEX_ATTRIBUTE</span><span style=" color:#000000;">()));</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">}</span>


<span style=" color:#c0c0c0;">  </span><span style=" color:#808000;">if</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">(</span><span style=" color:#000000;">mappings</span><span style=" color:#000000;">==</span><span style=" color:#000080;">NULL</span><span style=" color:#000000;">)</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">{</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">mappings</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">=</span><span style=" color:#c0c0c0;"> </span><span style=" color:#800080;">vtkGenericVertexAttributeMapping</span><span style=" color:#000000;">::</span><span style=" color:#000000;">New</span><span style=" color:#000000;">();</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#808000;">this</span><span style=" color:#000000;">-></span><span style=" color:#800000;">PainterInformation</span><span style=" color:#000000;">-></span><span style=" color:#000000;">Set</span><span style=" color:#000000;">(</span>
<span style=" color:#c0c0c0;">      </span><span style=" color:#800080;">vtkPolyDataPainter</span><span style=" color:#000000;">::</span><span style=" color:#000000;">DATA_ARRAY_TO_VERTEX_ATTRIBUTE</span><span style=" color:#000000;">(),</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">mappings</span><span style=" color:#000000;">);</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">mappings</span><span style=" color:#000000;">-></span><span style=" font-style:italic; color:#000000;">Delete</span><span style=" color:#000000;">();</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">}</span>


<span style=" color:#c0c0c0;">  </span><span style=" color:#000000;">mappings</span><span style=" color:#000000;">-></span><span style=" color:#000000;">AddMapping</span><span style=" color:#000000;">(</span>
<span style=" color:#c0c0c0;">    </span><span style=" color:#000000;">vertexAttributeName</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">dataArrayName</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">field</span><span style=" color:#000000;">,</span><span style=" color:#c0c0c0;"> </span><span style=" color:#000000;">componentno</span><span style=" color:#000000;">);</span>
<span style=" color:#000000;">}</span>



Nevertheless I do not know how to further investigate my problem or where to start looking for the actual mapping and data passing process.
Maybe anybody could point me to the catch here or to the interesting bits of code I should check or maybe explain me about the contraints when passing varying field data to shaders.

Is/Might the fact that I have a multi-block dataset somehow affecting the mapping process ?

Thanks

Best regards,

Florian
</pre>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">Am 15.11.2014 um 04:29 schrieb Utkarsh
      Ayachit:<br>
    </div>
    <blockquote
cite="mid:CADHSJjBAWrAMJOQjhWxF-Y1CKQo7FUQRo-i6uOJnCRP4fT0inA@mail.gmail.com"
      type="cite">
      <pre wrap="">Florian,

MapDataArrayToVertexAttribute expects the data array to be present in
the input data going into the mapper itself. I see you're creating a
new `darr`, but I don't see it being added to a dataset and then that
being passed on to the mapper. Are you doing that?

Having said that, you should look into adding a filter to add this
data array to your dataset, vtkProperty/vtkPointSpriteProperty isn't a
the best place to change input dataset being fed to the mapper.

Utkarsh

On Thu, Nov 13, 2014 at 7:19 AM, Florian Hoffmann
<a class="moz-txt-link-rfc2396E" href="mailto:florian.hoffmann@inutech.de"><florian.hoffmann@inutech.de></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">Dear all,

I am trying to reuse some code from the point sprites plugin.
I would like to pass some size information onto some shader code for nine
different points like this:

void vtkPointSpriteProperty::Render(vtkActor *act, vtkRenderer *ren)

{



   vtkPainterPolyDataMapper* mapper =

          vtkPainterPolyDataMapper::SafeDownCast(act->GetMapper());


   vtkSmartPointer<vtkDoubleArray> darr =
vtkSmartPointer<vtkDoubleArray>::New();

        darr->SetNumberOfTuples(9);

        darr->SetName("testArray");

        double size_tuple[1] = {0.2};

        darr->SetNumberOfComponents(1);


        darr->SetTupleValue(0, size_tuple);

        darr->SetTupleValue(1, size_tuple);

        darr->SetTupleValue(2, size_tuple);

        darr->SetTupleValue(3, size_tuple);

        darr->SetTupleValue(4, size_tuple);

        darr->SetTupleValue(5, size_tuple);

        darr->SetTupleValue(6, size_tuple);

        darr->SetTupleValue(7, size_tuple);

        darr->SetTupleValue(8, size_tuple);



   mapper->RemoveVertexAttributeMapping("SizeParam1");
   mapper->MapDataArrayToVertexAttribute("SizeParam1", darr->GetName(),

            vtkDataObject::FIELD_ASSOCIATION_POINTS, 0);



  glPushAttrib(GL_ALL_ATTRIB_BITS);

  glEnable(vtkgl::VERTEX_PROGRAM_POINT_SIZE_ARB);

  this->Superclass::Render(act, ren);
}

shader code :

attribute float SizeParam1;

attribute float SizeParam2;

attribute float SizeParam3;


vec3 GetSizeParams()

{

  vec3 sizeparams=vec3(0.0,0.5,0.8);

    sizeparams.x = SizeParam1;

//  sizeparams.y = SizeParam2;
//  sizeparams.z = SizeParam3;


  return sizeparams;

}



Question: How is the 0.2 stored in the tuple modified while passed to the
shader code ?

Because the value arriving in the
shader code seems to be different from the value 0.2 which is stored in the
tuples.
I noticed, because if I hardwire 0.2 in the shader code like this


vec3 GetSizeParams()

{

 vec3 sizeparams=vec3(0.2,0.5,0.8);

  return sizeparams;
}

I see a different rendering.

Could anyone please cast a light into this issue and tell me what I am doing
wrong or rather which settings influencing the mapping I should draw my
attention to ?

Thanks.

Best regards,

Florian

_______________________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Please keep messages on-topic and check the ParaView Wiki at:
<a class="moz-txt-link-freetext" href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://public.kitware.com/mailman/listinfo/paraview">http://public.kitware.com/mailman/listinfo/paraview</a>

</pre>
      </blockquote>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Mit freundlichen Grüßen
--
Dr.-Ing. Florian Hoffmann
inuTech GmbH            Phone    : +49-(0)911-323843-22
Fuerther Strasse 212    Fax      : +49-(0)911-323843-43
90429 Nuernberg         E-Mai l  : <a class="moz-txt-link-abbreviated" href="mailto:florian.hoffmann@inutech.de">florian.hoffmann@inutech.de</a>
Germany                 Internet : <a class="moz-txt-link-freetext" href="http://www.inutech.de">http://www.inutech.de</a>

inuTech GmbH
Sitz / Registered Office: Nuernberg
Handelsregister / Companies' Register: AG Nürnberg HRB Nr. 19026
Geschäftsführer / Managing Director: Frank Vogel

*****************************************************************
DIFFPACK - THE NEW GENERATION OF SIMULATION-SOFTWARE!

Go to <a class="moz-txt-link-freetext" href="http://www.diffpack.com">http://www.diffpack.com</a> to read the details
*****************************************************************
</pre>
  </body>
</html>