[osg-users] osgText::Text problem

Robert Osfield robert.osfield at gmail.com
Mon Aug 21 02:18:25 PDT 2017


Hi Bojan,

You don't provide enough details about your OSG version or build options to
know what might going on in your system.  The OSG shaders might be coming
form the OSG side or in your own application, there is no way from the
provided details we could guess.

Robert.



On 17 August 2017 at 13:24, Bojan Novak <bojan at lxnav.com> wrote:

> Hi,
>
> I recently ran into a problem regarding osgText::Text class. I generate a
> text label as follows:
>
> Code:
>
>         ref_ptr<osgText::Text> psText = new osgText::Text;
>         psText->setText("Some text");
>         psText->setDrawMode(osgText::Text::TEXT);
>         psText->setAxisAlignment(osgText::Text::XY_PLANE);
>         psText->setCharacterSizeMode(osgText::Text::SCREEN_COORDS);
>         psText->setCharacterSize(40));
>         psText->setFont("font/Roboto-Regular.ttf");
>         psText->setBackdropType(osgText::Text::OUTLINE);
>         psText->setBackdropColor(Vec4(0.0f, 0.0f, 0.0f, 1.0f));
>         Vec3 vPos = convertFromPolar(p.lon(), p.lat(), p.elev() + 100);
>         psText->setPosition(vPos);
>         psText->setColor(Vec4(0.99, 0.6, 0.95, 1.0));
>         psText->setAutoRotateToScreen(true);
>
>         m_psGeode->addDrawable(psText.get());
>
>
>
>
> On my Ubuntu Linux laptop, this runs well and I can see the text label on
> the screen.
> But when I compile the same application for an ARMv7 processor (with
> OpenGL/ES) and run it there, I get the following output messages on the
> console:
>
> Code:
>
> VERTEX glCompileShader "" FAILED
> VERTEX Shader "" infolog:
> (8) : error C7506: OpenGL/ES does not define the global variable
> gl_FrontColor
>
> FRAGMENT glCompileShader "" FAILED
> FRAGMENT Shader "" infolog:
> (4) : error C7573: OpenGL/ES requires precision specifier on float types
> (5) : error C7573: OpenGL/ES requires precision specifier on float types
> (6) : error C7506: OpenGL/ES does not define the global variable gl_Color
>
> glLinkProgram "" FAILED
>
>
>
>
> And in this case, the text label does not appear on the screen.
>
> Reading the error messages, my guess is that the shader generated to show
> these labels is not compatible with OpenGL/ES. Is it possible to find out
> the source code of the vertex and fragment shaders that get generated in
> this case? Or even better, what shaders should I use for the OpenGL/ES to
> show text labels?
>
> BTW, before someone tells me to check if the font file exists, it does, I
> double checked it and debug messages also confirm that. :)
>
> Thank you!
>
> Cheers,
> Bojan[/img][/code]
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=71432#71432
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170821/04e897c2/attachment.htm>


More information about the osg-users mailing list