Re: [osg-users] Use OSG with an existing renderer in OpenGL ES

2016-11-22 Thread Chris Hanson
Fabien, if you want someone do do a custom implementation of that sort of
thing, we can be hired to do so. ;)

On Mon, Nov 21, 2016 at 7:27 AM, Riccardo Corsi 
wrote:

> Hi Fabien,
>
> in your situation the approach suggested by Chris is certainly the most
> promising.
> Create a second GL context (shared), render everything you need to with
> osg in the second context to an FBO target and have Qt retrieve the fbo's
> texture content, to display it in one of its widgets/primitives.
> This way you don't need to know which GL states Qt/qml uses and/or
> modifies and you're sure neither qml nor osg rendering will be corrupted.
>
> You can find a sample integration I wrote some times ago here:
> https://github.com/rickyviking/qmlosg
> and a more recent example here: https://github.com/podsvirov/osgqtquick
>
> Ricky
>
>
> On Mon, Nov 21, 2016 at 11:52 AM, Robert Osfield  > wrote:
>
>> On 21 November 2016 at 09:12, Fabien Boco  wrote:
>> > This is why I'm looking for an OpenGL ES alternative for
>> glPush/PopAttrib which works fine on the Windows version application.
>>
>>
>> The alternative to using glPush/glPop on the OSG would be to dirty the
>> associated modes and attributes that are tracked in osg::State.  In
>> osg::State there are series of haveApplied*() methods to help with
>> tell the OSG's state tracking mechanism something has externally
>> changed.  This requires you to know what modes and attributes will
>> have been changed by the 3rd party code so it's not an easy
>> alternative to glPush/glPop.
>>
>> Personally I find Qt's approach of changing GL state problematic, I
>> much prefer windowing libraries to just create a graphics context and
>> leave GL work entirely to dedicated graphics libraries.
>>
>> Robert.
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com
http://www.alphapixel.com/
Training • Consulting • Contracting
3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 •
GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL
Legal/IP • Code Forensics • Digital Imaging • GIS • GPS •
osgEarth • Terrain • Telemetry • Cryptography • LIDAR • Embedded • Mobile •
iPhone/iPad/iOS • Android
@alphapixel  facebook.com/alphapixel (775)
623-PIXL [7495]
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Use OSG with an existing renderer in OpenGL ES

2016-11-21 Thread Riccardo Corsi
Hi Fabien,

in your situation the approach suggested by Chris is certainly the most
promising.
Create a second GL context (shared), render everything you need to with osg
in the second context to an FBO target and have Qt retrieve the fbo's
texture content, to display it in one of its widgets/primitives.
This way you don't need to know which GL states Qt/qml uses and/or modifies
and you're sure neither qml nor osg rendering will be corrupted.

You can find a sample integration I wrote some times ago here:
https://github.com/rickyviking/qmlosg
and a more recent example here: https://github.com/podsvirov/osgqtquick

Ricky


On Mon, Nov 21, 2016 at 11:52 AM, Robert Osfield 
wrote:

> On 21 November 2016 at 09:12, Fabien Boco  wrote:
> > This is why I'm looking for an OpenGL ES alternative for
> glPush/PopAttrib which works fine on the Windows version application.
>
>
> The alternative to using glPush/glPop on the OSG would be to dirty the
> associated modes and attributes that are tracked in osg::State.  In
> osg::State there are series of haveApplied*() methods to help with
> tell the OSG's state tracking mechanism something has externally
> changed.  This requires you to know what modes and attributes will
> have been changed by the 3rd party code so it's not an easy
> alternative to glPush/glPop.
>
> Personally I find Qt's approach of changing GL state problematic, I
> much prefer windowing libraries to just create a graphics context and
> leave GL work entirely to dedicated graphics libraries.
>
> Robert.
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Use OSG with an existing renderer in OpenGL ES

2016-11-21 Thread Robert Osfield
On 21 November 2016 at 09:12, Fabien Boco  wrote:
> This is why I'm looking for an OpenGL ES alternative for glPush/PopAttrib 
> which works fine on the Windows version application.


The alternative to using glPush/glPop on the OSG would be to dirty the
associated modes and attributes that are tracked in osg::State.  In
osg::State there are series of haveApplied*() methods to help with
tell the OSG's state tracking mechanism something has externally
changed.  This requires you to know what modes and attributes will
have been changed by the 3rd party code so it's not an easy
alternative to glPush/glPop.

Personally I find Qt's approach of changing GL state problematic, I
much prefer windowing libraries to just create a graphics context and
leave GL work entirely to dedicated graphics libraries.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Use OSG with an existing renderer in OpenGL ES

2016-11-21 Thread Fabien Boco
I'm actually facing the second situation. 

I'm trying to render some OSG with QML. Qt provide a "scope" where you can do 
your custom stuff (OSG here). If you know Qt : you have to connect a slot where 
you can do your custom OpenGL to a specific signal.

I already tried to play with contexts (as you did) but there's nothing to do =/

This is why I'm looking for an OpenGL ES alternative for glPush/PopAttrib which 
works fine on the Windows version application.

 --
Post generated by Mail2Forum[/quote]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69454#69454





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Use OSG with an existing renderer in OpenGL ES

2016-11-18 Thread Chris Hanson
Are you trying to render combined 3D scenes, or have OSG render a texture
that will be used on a surface within your other renderer's scene?

When we were faced with the second situation, what we did was to create a
whole new context (shared) for OSG let OSG render into a texture with that,
and then used the texture in the main scene.

What are you seeking to accomplish, bigger-picture wise?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Use OSG with an existing renderer in OpenGL ES

2016-11-18 Thread Fabien Boco
Hi,

I'm trying to use OSG with an existing renderer. I found the FAQ about it which 
advises us to use glPush/PopAttrib to make it work 
(.../faq#CanIuseOSGwithinanexistingrenderer)

But here's my problem : I'm moving an OSG app (running with QML) from Windows 
to iOS and iOS means OpenGL ES which doesn't includes glPop/PushAttrib 
functions (glPush/PopMatrix non either).
I tried to replace concerned function with manual 
glEnable/Disable(GL_DEPTH_TEST) etc... But it doesn't work. Errors are about 
"invalid framebuffer operation"
 
Does anyone have experimented OSG with an existing renderer on iOS or know 
about this kind of problem ?

Thank you!

Cheers,
Fabien

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69444#69444





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org