[vtkusers] Making vertices "glow"

Jana Sefcikova neollie at gmail.com
Thu Aug 2 18:07:17 EDT 2012


Hi David, I have only algorithmical idea,* *I never made it.
Let d be radius of glowing. Let p_g be some glowing point. Than each point
p_n having distance d(p_g, p_n) would obtain for example glowing factor
g(p_g,p_n) =1/d*d(p_g,p_n).
If d(p_g,p_n) > d than it should be clamped to 0.  This is simple metric.
Now having more glowing poinst , we could use blending of all glowing
factors.
If there is a sequence of glowing point G= {d_g1,...,d_gm} than final
glowing factor for point p_n could be weighted average of all glowing
factors g(p_n,d_gi).
Final color of the point would be blending of  glowing point color
penalized by glowing factor with original color .

I would choose shaders for implementation. Than you can glow also space
around point.
Here is same idea, you will pass all glowing points to the shader, and for
each vertex fragment you will compute distance to all that glowing points
and mix appropriately color. Thus also space fragment will obtain color
influenced by glowing points.

But there is also way make it purely as vtkAlgorithm, you can ignore actors
and implement algorithm that would return color directly, space will not be
glowed.
You can take glowing point and using breath-first compute glowing factor
iterating through their adjacent vertices until preset distance  and
accumulating glowing factor.
Than mix color inside algorithm directly.

This is my first idea.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120803/b051fc59/attachment.htm>


More information about the vtkusers mailing list