<br><br><div class="gmail_quote">On Wed, Oct 24, 2012 at 1:18 PM, Tomas Sieger <span dir="ltr"><<a href="mailto:tomas.sieger@seznam.cz" target="_blank">tomas.sieger@seznam.cz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I've tracked the problem down a little bit deeper.<br>
<br>
I wanted to add some "use opengl" option to cranvas, but realized that<br>
some cranvas plots using glyphs *do* work even if using opengl. I<br>
found out that glyphs that specify stroke color as a vector of length<br>
at least two (!) work:<br>
     qdrawGlyph(painter,<br>
qglyphCircle(r=5),5,5,stroke=rep('#FF0000FF',2)) # works<br>
while those that specify stroke color as a single value do not:<br>
     qdrawGlyph(painter,<br>
qglyphCircle(r=5),5,5,stroke=rep('#FF0000FF',1)) # does not work<br>
as well as those without an explicit stroke color:<br>
     qdrawGlyph(painter, qglyphCircle(r=5),5,5) # does not work<br>
<br>
The length of the stroke color argument really makes a difference. If<br>
it is a vector of length >=2, stroke colors get passed to painters<br>
explicitly. If it is a single value, it sets the default color in the<br>
painter. In the first case, OpenGLPainter draws glyphs explicitly (and<br>
the glyph gets rendered correctly). In the latter case, the<br>
OpenGLPainter delegates the call to QtBasePainter::drawGlyphs (and the<br>
glyph gets not rendered).<br>
<br>
It makes me feel this might be a SW issue, not necessarily a HW one.<br>
<br></blockquote><div><br>Thanks a lot for looking into this in depth. Yes, there are two code paths that use the hardware differently. The multi-color case is actually the more complicated one, using modulation to color the same texture many times, so it's surprising that it works, while the simpler case is broken. One possible test is to use white, so that the glyph image is exactly the same in both cases. That would eliminate one difference at least. <br>
<br>Michael<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If it helps, there are some more details:<br>
in the first case, QtBasePainter::rasterizeGlyph gets called by<br>
OpenGLPainter with the following setting:<br>
- pen: width 0, color r=255,g=255,b=255,a=255, brush color<br>
r=255,g=255,b=255,a=255<br>
- brush color r=0,g=0,b=0,a=255<br>
- opacity 1<br>
and the glyph gets rendered;<br>
in the second case, QtBasePainter::rasterizeGlyph gets called by<br>
QtBasePainter with the following setting:<br>
- pen: width 0, color r=255,g=0,b=0,a=255, brush color r=255,g=0,b=0,a=255<br>
- brush color r=0,g=0,b=0,a=255<br>
- opacity 1<br>
so the red color is there, but the glyph gets not rendered.<br>
<br>
Unfortunately, I have no time to understand the code in detail, but I<br>
would happily provide you with some more debug info, if it helps.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tomas<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue, Oct 23, 2012 at 1:15 AM, Michael Lawrence<br>
<<a href="mailto:lawrence.michael@gene.com">lawrence.michael@gene.com</a>> wrote:<br>
> This is probably a hardware issue. Perhaps your card does not support point<br>
> sprites. I'm guessing that cranvas used circles in the past. Perhaps an<br>
> option could be added somewhere in the stack.<br>
><br>
> On Mon, Oct 22, 2012 at 8:08 AM, Tomas Sieger <<a href="mailto:tomas.sieger@seznam.cz">tomas.sieger@seznam.cz</a>><br>
> wrote:<br>
>><br>
>> Hi,<br>
>>  I'm unable to draw glyphs when using OpenGL to render my scene:<br>
>><br>
>> scene <- qscene()<br>
>> layer <- qlayer(scene, function(layer, painter) {<br>
>>     qdrawGlyph(painter, qglyphCircle(r=5),5,5) # doesn't work using OpenGL<br>
>>     qdrawCircle(painter, 2, 2, r=3) # always works<br>
>>     }, limits = qrect(0, 0, 10, 10))<br>
>> view <- qplotView(scene)<br>
>> print(view)<br>
>><br>
>> however, when I turn OpenGL off, it works:<br>
>><br>
>> scene <- qscene()<br>
>> layer <- qlayer(scene, function(layer, painter) {<br>
>>     qdrawGlyph(painter, qglyphCircle(r=5),5,5) # works if using SW driver<br>
>>     qdrawCircle(painter, 2, 2, r=3) # always works<br>
>>     }, limits = qrect(0, 0, 10, 10))<br>
>> view <- qplotView(scene,opengl=FALSE)<br>
>> print(view)<br>
>><br>
>> Is it a known issue?<br>
>> I'm running Qt 4.5.3.<br>
>> My video is Intel Corporation Cantiga Integrated Graphics Controller.<br>
>><br>
>> > sessionInfo()<br>
>> R version 2.15.0 (2012-03-30)<br>
>> Platform: i686-pc-linux-gnu (32-bit)<br>
>><br>
>> locale:<br>
>> [1] C<br>
>><br>
>> attached base packages:<br>
>> [1] stats     graphics  grDevices utils     datasets  methods   base<br>
>><br>
>> other attached packages:<br>
>> [1] qtpaint_0.9.0  qtbase_1.0.6   colorout_0.9-9<br>
>><br>
>> ---<br>
>><br>
>> BTW cranvas 'qscatter' (which is based on glyphs currently - and<br>
>> therefore is not working for me) worked for me some time ago (but I<br>
>> don't know whether it was using glyphs at that time), but I can't tell<br>
>> what of qtpaint/qtbase/cranvas/etc. I've upgraded, sorry :-(.<br>
>><br>
>> Regards,<br>
>>  Tomas<br>
>> _______________________________________________<br>
>> Qtinterfaces-devel mailing list<br>
>> <a href="mailto:Qtinterfaces-devel@lists.r-forge.r-project.org">Qtinterfaces-devel@lists.r-forge.r-project.org</a><br>
>><br>
>> <a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/qtinterfaces-devel</a><br>
><br>
><br>
</div></div></blockquote></div><br>