[vtkusers] Bug in font rendering if shadow == true ?
Francois Bertel
francois.bertel at kitware.com
Sun Apr 6 09:11:35 EDT 2008
Hi Antoine,
Which class are you using to display the text given by your
screenshot? In other words, which class is using vtkFreeTypeUtilities
underneath in your case?
There are several of them using vtkFreeTypeUtilities:
vtkOpenGLFreeTypeTextMapper, vtkTextActor, vtkTextActor3D,
vtkTextRepresentation, vtkCaptionRepresentation.
It sounds like an issue with pre-multiplied rgb with an associated
alpha vs rgb which an unassociated alpha.
Can you send your OpenGL version and set of extensions, either by
sending the output of:
$ ctest -R LoadOpenGLExtension -V &> output.txt
or by using a platform specific method:
http://www.vtk.org/Wiki/VTK_FAQ#How_do_I_check_which_OpenGL_versions_or_extensions_are_supported_by_my_graphic_card_or_OpenGL_implementation.3F
On Sun, Apr 6, 2008 at 2:18 AM, Antoine Rosset <rossetantoine at bluewin.ch> wrote:
> It seems there is a problem with antialiased font rendering if shadow is
> activated. See the letters on the corners on this image:
> http://www.osirix-viewer.com/before.jp2 . See this image after the
> correction: http://www.osirix-viewer.com/after.jp2 .There are blending
> problems with the alpha channel.
>
> To correct this problem, I changed the vtkFreeTypeUtilities.cxx
> PopulateImageData :
>
>
> *data_ptr = static_cast<unsigned char>(
> data_min + data_range * tprop_r);
> data_ptr++;
>
>
> *data_ptr = static_cast<unsigned char>(
> data_min + data_range * tprop_g);
> data_ptr++;
>
>
> *data_ptr = static_cast<unsigned char>(
> data_min + data_range * tprop_b);
> data_ptr++;
>
>
> *data_ptr = static_cast<unsigned char>(
> data_min + data_range * (t_alpha + data_alpha * t_1_m_alpha));
>
> To
>
>
> *data_ptr = static_cast<unsigned char>(
> data_min + data_range * tprop_r*t_alpha +
> (*data_ptr * data_alpha) * t_1_m_alpha);
> data_ptr++;
>
> *data_ptr = static_cast<unsigned char>(
> data_min + data_range * tprop_g*t_alpha +
> (*data_ptr * data_alpha) * t_1_m_alpha);
> data_ptr++;
>
> *data_ptr = static_cast<unsigned char>(
> data_min + data_range * tprop_b*t_alpha +
> (*data_ptr * data_alpha) * t_1_m_alpha);
> data_ptr++;
>
> *data_ptr = static_cast<unsigned char>(
> data_min + data_range * (t_alpha + data_alpha * t_1_m_alpha));
>
> This correction was existing 3 years ago in the source code, but was removed
> : cvs diff
> (http://public.kitware.com/cgi-bin/viewcvs.cgi/Rendering/vtkFreeTypeUtilities.cxx?r1=1.29&r2=1.5.2.1)
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
--
François Bertel, PhD | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
| Clifton Park NY 12065, USA
More information about the vtkusers
mailing list