Re: [osg-users] Running OSG models on OpenGLES2.0

2016-03-14 Thread Chris Hanson
On Mon, Mar 14, 2016 at 1:30 PM, Hyun Kwon  wrote:

>
> I agree, but some information can not be disclosed here.
>

  Well, we're probably at the limit of what we can help you with in a
public forum then.



> So, from what I understood so far, if someone like me integrated the OSG
> layer into some OpenGLES system, there's not much way (examples) to
> validate the platform. In that way, I thought I'd be able
> to isolate problems at least.
>


  Yes, and no. usually someone porting to OpenGL ES2 will already have a
test model with GLES2-compliant shaders before porting and will know what
to expect. OSG is not itself very ES-centric, so it doesn't have a lot of
ES-compliant test examples that also work in non-ES.

  If you want more help, I'd suggest contracting someone (like my company,
AlphaPixel) who can execute an NDA and help you actually troubleshoot your
live code and data. AlphaPixel has gobs of experience with OSG on OpenGL ES.

-- 
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] Running OSG models on OpenGLES2.0

2016-03-14 Thread Hyun Kwon
Hi Chris,


From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of Chris 
Hanson [xe...@alphapixel.com]
Sent: Monday, March 14, 2016 12:09 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Running OSG models on OpenGLES2.0

So, to really help you any further, we'd probably need to see the model and how 
it renders on desktop and GLES2. Otherwise, it's too non-specific of a question 
to have a singular answer.

Remember, desktop FFP GL has a LOT of features, many of which may not be 
emulated by whatever shader you've attached to make GLES2 work.

I agree, but some information can not be disclosed here. So, from what I 
understood so far, if someone like me integrated the OSG layer into some 
OpenGLES system, there's not much way (examples) to validate the platform. In 
that way, I thought I'd be able to isolate problems at least.

Thanks,
-hyun


On Mon, Mar 14, 2016 at 12:48 PM, Hyun Kwon 
<hyun.k...@xilinx.com<mailto:hyun.k...@xilinx.com>> wrote:
Hi,


From: osg-users 
[osg-users-boun...@lists.openscenegraph.org<mailto:osg-users-boun...@lists.openscenegraph.org>]
 on behalf of Chris Hanson [xe...@alphapixel.com<mailto:xe...@alphapixel.com>]
Sent: Monday, March 14, 2016 9:58 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Running OSG models on OpenGLES2.0

"The fragment language has no default precision qualifier for floating point 
types.  Hence for float, floating
point vector and matrix variable declarations, either the declaration must 
include a precision qualifier or
the default float precision must have been previously declared. Similarly, 
there is no default precision
qualifier for any of the image types,  or any of the following sampler types in 
any of the languages:"
So basically I always had the luck to have sloppy drivers :-) and one must 
indeed add the precision qualifiers or define the default precision.

  I think the NVidia drivers play sloppy. Others may be the same way.

Thanks for the input. Now it comes back to my original question. I've added 
precision qualifiers to compile shaders, but the models from 
OpenSceneGraph-Data still don't get rendered correctly (similar to the model 
that I have). I can run all of those fine on desktop with OpenGL. Maybe most of 
those are not OpenGLES2.0 compatible. I guess there's some incompatibility 
between pieces.

Thanks,
-hyun

Cheers
Sebastian.


--
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<https://twitter.com/alphapixel> 
facebook.com/alphapixel<http://facebook.com/alphapixel> (775) 623-PIXL [7495]


This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.


___
osg-users mailing list
osg-users@lists.openscenegraph.org<mailto: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<https://twitter.com/alphapixel> 
facebook.com/alphapixel<http://facebook.com/alphapixel> (775) 623-PIXL [7495]


This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.

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


Re: [osg-users] Running OSG models on OpenGLES2.0

2016-03-14 Thread Chris Hanson
So, to really help you any further, we'd probably need to see the model and
how it renders on desktop and GLES2. Otherwise, it's too non-specific of a
question to have a singular answer.

Remember, desktop FFP GL has a LOT of features, many of which may not be
emulated by whatever shader you've attached to make GLES2 work.

On Mon, Mar 14, 2016 at 12:48 PM, Hyun Kwon <hyun.k...@xilinx.com> wrote:

> Hi,
>
> --
> *From:* osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf
> of Chris Hanson [xe...@alphapixel.com]
> *Sent:* Monday, March 14, 2016 9:58 AM
> *To:* OpenSceneGraph Users
> *Subject:* Re: [osg-users] Running OSG models on OpenGLES2.0
>
> "The fragment language has no default precision qualifier for floating
>> point types.  Hence for float, floating
>> point vector and matrix variable declarations, either the declaration
>> must include a precision qualifier or
>> the default float precision must have been previously declared.
>> Similarly, there is no default precision
>> qualifier for any of the image types,  or any of the following sampler
>> types in any of the languages:"
>> So basically I always had the luck to have sloppy drivers :-) and one
>> must indeed add the precision qualifiers or define the default precision.
>>
>
>   I think the NVidia drivers play sloppy. Others may be the same way.
>
> Thanks for the input. Now it comes back to my original question. I've
> added precision qualifiers to compile shaders, but the models from
> OpenSceneGraph-Data still don't get rendered correctly (similar to the
> model that I have). I can run all of those fine on desktop with OpenGL.
> Maybe most of those are not OpenGLES2.0 compatible. I guess there's some
> incompatibility between pieces.
>
> Thanks,
> -hyun
>
> Cheers
>> Sebastian.
>>
>
>
> --
> 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 <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
> 623-PIXL [7495]
>
>
> This email and any attachments are intended for the sole use of the named
> recipient(s) and contain(s) confidential information that may be
> proprietary, privileged or copyrighted under applicable law. If you are not
> the intended recipient, do not read, copy, or forward this email message or
> any attachments. Delete this email message and any attachments immediately.
>
>
> ___
> 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 <https://twitter.com/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] Running OSG models on OpenGLES2.0

2016-03-14 Thread Hyun Kwon
Hi,


From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of Chris 
Hanson [xe...@alphapixel.com]
Sent: Monday, March 14, 2016 9:58 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Running OSG models on OpenGLES2.0

"The fragment language has no default precision qualifier for floating point 
types.  Hence for float, floating
point vector and matrix variable declarations, either the declaration must 
include a precision qualifier or
the default float precision must have been previously declared. Similarly, 
there is no default precision
qualifier for any of the image types,  or any of the following sampler types in 
any of the languages:"
So basically I always had the luck to have sloppy drivers :-) and one must 
indeed add the precision qualifiers or define the default precision.

  I think the NVidia drivers play sloppy. Others may be the same way.

Thanks for the input. Now it comes back to my original question. I've added 
precision qualifiers to compile shaders, but the models from 
OpenSceneGraph-Data still don't get rendered correctly (similar to the model 
that I have). I can run all of those fine on desktop with OpenGL. Maybe most of 
those are not OpenGLES2.0 compatible. I guess there's some incompatibility 
between pieces.

Thanks,
-hyun

Cheers
Sebastian.


--
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<https://twitter.com/alphapixel> 
facebook.com/alphapixel<http://facebook.com/alphapixel> (775) 623-PIXL [7495]


This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.

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


Re: [osg-users] Running OSG models on OpenGLES2.0

2016-03-14 Thread Sebastian Messerschmidt

Am 14.03.2016 um 17:35 schrieb Chris Hanson:


Can't you try some other GLES applications(plain OpenGL-ES without
OSG) and check their shader code? I believe there is a problem
with your system/driver, as there is no need to explicitly issuing
the precision in normal cases.


  I thought some drivers were more strict about this?
  I remember having some embedded GLES drivers having fits until we 
added precision qualifiers, and maybe some desktop ones did at some 
point too.

That would be strange but not impossible in the world of OpenGL-Drivers ;-)
I read the OpenGL ES shading language as "you don't need to put 
precision qualifiers unless" (Any floating point ... can have the type 
preceeded 4.7.3 "Precision Qualifiers") followed by the 4.7.4 which 
seems to explain it.
There are deafult precisions for float in the vertex shader, but not in 
the fragment shader


"The fragment language has no default precision qualifier for floating 
point types.  Hence for float, floating
point vector and matrix variable declarations, either the declaration 
must include a precision qualifier or
the default float precision must have been previously declared. 
Similarly, there is no default precision
qualifier for any of the image types,  or any of the following sampler 
types in any of the languages:"


So basically I always had the luck to have sloppy drivers :-) and one 
must indeed add the precision qualifiers or define the default precision.


Cheers
Sebastian.





--
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


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


Re: [osg-users] Running OSG models on OpenGLES2.0

2016-03-14 Thread Chris Hanson
>
> "The fragment language has no default precision qualifier for floating
> point types.  Hence for float, floating
> point vector and matrix variable declarations, either the declaration must
> include a precision qualifier or
> the default float precision must have been previously declared. Similarly,
> there is no default precision
> qualifier for any of the image types,  or any of the following sampler
> types in any of the languages:"
> So basically I always had the luck to have sloppy drivers :-) and one must
> indeed add the precision qualifiers or define the default precision.
>

  I think the NVidia drivers play sloppy. Others may be the same way.


> Cheers
> Sebastian.
>

-- 
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] Running OSG models on OpenGLES2.0

2016-03-14 Thread Chris Hanson
>
> Can't you try some other GLES applications(plain OpenGL-ES without OSG)
> and check their shader code? I believe there is a problem with your
> system/driver, as there is no need to explicitly issuing the precision in
> normal cases.
>

  I thought some drivers were more strict about this?

  I remember having some embedded GLES drivers having fits until we added
precision qualifiers, and maybe some desktop ones did at some point too.


-- 
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] Running OSG models on OpenGLES2.0

2016-03-14 Thread Sebastian Messerschmidt

Hi Chrisitan,
Hi,

I am not sure if the original poster is aware of this, the 
osgvertexattributes osg sample code is able to generate shaders from 
fixed function pipeline state sets in the scene graph and applies 
these shaders to the geometry.


http://trac.openscenegraph.org/projects/osg//browser/OpenSceneGraph/trunk/examples/osgvertexattributes/osgvertexattributes.cpp
Thanks for the pointer, but I was under the impression this done 
automatically by osg when the core profile is used 
(setUseVertexAttributeAliasing and setUseModelViewAndProjectionUniforms 
on the State).
Anyways, the example illustrates how to traverse a scene to adapt to 
modern OpenGL.


Cheers
Sebastian


Christian


Hi Sebastian,

Thanks for the reply.


*From:* osg-users [osg-users-boun...@lists.openscenegraph.org
<mailto:osg-users-boun...@lists.openscenegraph.org>] on behalf of
Sebastian Messerschmidt [sebastian.messerschm...@gmx.de
<mailto:sebastian.messerschm...@gmx.de>]
*Sent:* Sunday, March 13, 2016 4:03 AM
*To:* OpenSceneGraph Users
    *Subject:* Re: [osg-users] Running OSG models on OpenGLES2.0

Hi Hyun,



Hi Chris,

I tried most of examples. Now I'm focusing on glsl_simple.osgt as
it looks simple, but only the second row of shapes shows. If I
modify the vertex shader a little, I get to see both first/second
row.

Can you tell us which platform you are using?  You usually don't
have to add precision qualifiers to make shaders work.

I have Xilinx ZynqMP SoC with MALI 400MP, and I'm running Ubuntu on 
it. I also have Yocto built rootfs. I've integrated the MALI OpenGLES2 
library/driver there, and I'm building OSG manually. It fails to 
compile if I don't add the precision for float & int in shaders. The 
OSG build configuration is more or less as below (it's for 3.4.0), 
with some addition to point to EGL/OPENGLES2 libraries and headers:


...

I've received some OSG model (file.osg) from someone, and I was
able to run it on the desktop (OpenGL). I was told the OSG model
runs on OpenGLES2.0. For me to run it on OpenGLES2, I added the
precision qualifiers to build, but the result still doesn't look
correct. I'm not sure if more / what modification is needed. For
example, I modified the OSG shader generator, but it didn't help.
Does OSG layers completely abstract underlying APIs (OpenGL,
OpenGLES,,,), meaning the OSG models are API independent? or does
each OSG model have some API specific code? For example, I don't
see any precision qualifiers in OSG examples, and does that mean
those models are not for OpenGLES2.0?

OSG doesn't completely abstract the APIs, but it can be built
specifically to work with OpenGL ES, by using the compiler flags
you used. You will however have to put some work into it, since
you will have to write shaders. Since you are not telling us which
"shader generator" you are using, it is hard to guess what you are
trying to achieve.
There is not something like "models for OpenGLES2.0". You will
have to write appropriate shaders and might have to run some
visitors to change fixed function pipeline functions in to
uniforms/attributes of the model.
For instance osg::Material is not working outside the
compatibility -profiles, so might have to run a visitor, that
parses osg::Material instances and replaces them with uniforms or
per-vertex attributes which you will have to evaluate in the shader.




I'm trying to figure out where the issue comes from: OSG model,
OSG layers, OpenGLES library.


Chris asked you for an example model that is not working. You
mentioned the glsl-simple model, which from a glance doesn't have
ES-compatible code. The easiest thing to do is to start with a
model(preferably not containing shaders) and a simple ES-Shader.
Unfortunately the examples here are relatively rare. Might be a
great opportunity to create some minimalistic core/ES-based shader
example and to extend the OpenGL-ES pseudo loader.

If there are already OSG models confirmed to work with OpenGLES2, I'd 
use those to validate my platform. But, none of examples in 
OpenSceneGraph-Data shows correct results on my platform (nothing 
displayed except the glsl_simple.osgt)comparing to results from 
desktop with OpenGL. Once my platform is confirmed to work, I will be 
able to focus on debugging the model. With lack of OSG / shader 
experience, I can't easily tell where the issue comes from, and I'm 
looking for references for validation.
Can't you try some other GLES applications(plain OpenGL-ES without 
OSG)  and check their shader code? I believe there is a problem with 
your system/driver, as there is no need to explicitly issuing the 
precision in normal cases.


All models should work in th

Re: [osg-users] Running OSG models on OpenGLES2.0

2016-03-14 Thread Christian Buchner
Hi,

I am not sure if the original poster is aware of this, the
osgvertexattributes osg sample code is able to generate shaders from fixed
function pipeline state sets in the scene graph and applies these shaders
to the geometry.

http://trac.openscenegraph.org/projects/osg//browser/OpenSceneGraph/trunk/examples/osgvertexattributes/osgvertexattributes.cpp

Christian

2016-03-14 11:02 GMT+01:00 Sebastian Messerschmidt <
sebastian.messerschm...@gmx.de>:

> Am 14.03.2016 um 09:16 schrieb Hyun Kwon:
>
> Hi Sebastian,
>
> Thanks for the reply.
>
> --
> *From:* osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf
> of Sebastian Messerschmidt [sebastian.messerschm...@gmx.de]
> *Sent:* Sunday, March 13, 2016 4:03 AM
> *To:* OpenSceneGraph Users
> *Subject:* Re: [osg-users] Running OSG models on OpenGLES2.0
>
> Hi Hyun,
>
>
> Hi Chris,
>
>
> I tried most of examples. Now I'm focusing on glsl_simple.osgt as it looks
> simple, but only the second row of shapes shows. If I modify the vertex
> shader a little, I get to see both first/second row.
>
> Can you tell us which platform you are using?  You usually don't have to
> add precision qualifiers to make shaders work.
>
> I have Xilinx ZynqMP SoC with MALI 400MP, and I'm running Ubuntu on it. I
> also have Yocto built rootfs. I've integrated the MALI OpenGLES2
> library/driver there, and I'm building OSG manually. It fails to compile if
> I don't add the precision for float & int in shaders. The OSG build
> configuration is more or less as below (it's for 3.4.0), with some addition
> to point to EGL/OPENGLES2 libraries and headers:
>
> ...
>
> I've received some OSG model (file.osg) from someone, and I was able to
> run it on the desktop (OpenGL). I was told the OSG model runs on
> OpenGLES2.0. For me to run it on OpenGLES2, I added the precision
> qualifiers to build, but the result still doesn't look correct. I'm not
> sure if more / what modification is needed. For example, I modified the OSG
> shader generator, but it didn't help. Does OSG layers completely abstract
> underlying APIs (OpenGL, OpenGLES,,,), meaning the OSG models are API
> independent? or does each OSG model have some API specific code? For
> example, I don't see any precision qualifiers in OSG examples, and does
> that mean those models are not for OpenGLES2.0?
>
> OSG doesn't completely abstract the APIs, but it can be built specifically
> to work with OpenGL ES, by using the compiler flags you used. You will
> however have to put some work into it, since you will have to write
> shaders. Since you are not telling us which "shader generator" you are
> using, it is hard to guess what you are trying to achieve.
> There is not something like "models for OpenGLES2.0". You will have to
> write appropriate shaders and might have to run some visitors to change
> fixed function pipeline functions in to uniforms/attributes of the model.
> For instance osg::Material is not working outside the compatibility
> -profiles, so might have to run a visitor, that parses osg::Material
> instances and replaces them with uniforms or per-vertex attributes which
> you will have to evaluate in the shader.
>
>
>
> I'm trying to figure out where the issue comes from: OSG model, OSG
> layers, OpenGLES library.
>
>
> Chris asked you for an example model that is not working. You mentioned
> the glsl-simple model, which from a glance doesn't have ES-compatible code.
> The easiest thing to do is to start with a model(preferably not containing
> shaders) and a simple ES-Shader.
> Unfortunately the examples here are relatively rare. Might be a great
> opportunity to create some minimalistic core/ES-based shader example and to
> extend the OpenGL-ES pseudo loader.
>
> If there are already OSG models confirmed to work with OpenGLES2, I'd use
> those to validate my platform. But, none of examples in OpenSceneGraph-Data
> shows correct results on my platform (nothing displayed except the
> glsl_simple.osgt) comparing to results from desktop with OpenGL. Once my
> platform is confirmed to work, I will be able to focus on debugging the
> model. With lack of OSG / shader experience, I can't easily tell where the
> issue comes from, and I'm looking for references for validation.
>
> Can't you try some other GLES applications(plain OpenGL-ES without OSG)
> and check their shader code? I believe there is a problem with your
> system/driver, as there is no need to explicitly issuing the precision in
> normal cases.
> All models should work in theory if you have some minimal shader for it.
> Out of my head a minimal shader should look like the following. It will
> display a red-colored version of your geometry

Re: [osg-users] Running OSG models on OpenGLES2.0

2016-03-14 Thread Sebastian Messerschmidt

Am 14.03.2016 um 09:16 schrieb Hyun Kwon:


Hi Sebastian,

Thanks for the reply.


*From:* osg-users [osg-users-boun...@lists.openscenegraph.org] on
behalf of Sebastian Messerschmidt [sebastian.messerschm...@gmx.de]
*Sent:* Sunday, March 13, 2016 4:03 AM
*To:* OpenSceneGraph Users
*Subject:* Re: [osg-users] Running OSG models on OpenGLES2.0

Hi Hyun,



Hi Chris,

I tried most of examples. Now I'm focusing on glsl_simple.osgt as
it looks simple, but only the second row of shapes shows. If I
modify the vertex shader a little, I get to see both first/second
row.

Can you tell us which platform you are using?  You usually don't
have to add precision qualifiers to make shaders work.

I have Xilinx ZynqMP SoC with MALI 400MP, and I'm running Ubuntu on 
it. I also have Yocto built rootfs. I've integrated the MALI OpenGLES2 
library/driver there, and I'm building OSG manually. It fails to 
compile if I don't add the precision for float & int in shaders. The 
OSG build configuration is more or less as below (it's for 3.4.0), 
with some addition to point to EGL/OPENGLES2 libraries and headers:


...

I've received some OSG model (file.osg) from someone, and I was
able to run it on the desktop (OpenGL). I was told the OSG model
runs on OpenGLES2.0. For me to run it on OpenGLES2, I added the
precision qualifiers to build, but the result still doesn't look
correct. I'm not sure if more / what modification is needed. For
example, I modified the OSG shader generator, but it didn't help.
Does OSG layers completely abstract underlying APIs (OpenGL,
OpenGLES,,,), meaning the OSG models are API independent? or does
each OSG model have some API specific code? For example, I don't
see any precision qualifiers in OSG examples, and does that mean
those models are not for OpenGLES2.0?

OSG doesn't completely abstract the APIs, but it can be built
specifically to work with OpenGL ES, by using the compiler flags
you used. You will however have to put some work into it, since
you will have to write shaders. Since you are not telling us which
"shader generator" you are using, it is hard to guess what you are
trying to achieve.
There is not something like "models for OpenGLES2.0". You will
have to write appropriate shaders and might have to run some
visitors to change fixed function pipeline functions in to
uniforms/attributes of the model.
For instance osg::Material is not working outside the
compatibility -profiles, so might have to run a visitor, that
parses osg::Material instances and replaces them with uniforms or
per-vertex attributes which you will have to evaluate in the shader.




I'm trying to figure out where the issue comes from: OSG model,
OSG layers, OpenGLES library.


Chris asked you for an example model that is not working. You
mentioned the glsl-simple model, which from a glance doesn't have
ES-compatible code. The easiest thing to do is to start with a
model(preferably not containing shaders) and a simple ES-Shader.
Unfortunately the examples here are relatively rare. Might be a
great opportunity to create some minimalistic core/ES-based shader
example and to extend the OpenGL-ES pseudo loader.

If there are already OSG models confirmed to work with OpenGLES2, I'd 
use those to validate my platform. But, none of examples in 
OpenSceneGraph-Data shows correct results on my platform (nothing 
displayed except the glsl_simple.osgt)comparing to results from 
desktop with OpenGL. Once my platform is confirmed to work, I will be 
able to focus on debugging the model. With lack of OSG / shader 
experience, I can't easily tell where the issue comes from, and I'm 
looking for references for validation.
Can't you try some other GLES applications(plain OpenGL-ES without OSG)  
and check their shader code? I believe there is a problem with your 
system/driver, as there is no need to explicitly issuing the precision 
in normal cases.

All models should work in theory if you have some minimal shader for it.
Out of my head a minimal shader should look like the following. It will 
display a red-colored version of your geometry.


Vertex:
#version 100
attribute vec4 osg_Vertex;
uniform mat4 osg_ModelViewProjectionMatrix;

void main()
{
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
}

Fragment:

#version 100

void main()
{
gl_FragColor = vec4(1,0,0,1);
}

Setting this shader to you scene should display everything correct. If 
my code is valid, it should compile without any precision qualifiers.


Cheers
Sebastian



Thanks,
-hyun



Thanks,
-hyun



Cheers
Sebastian



*From:* osg-users [osg-users-boun...@lists.openscenegraph.org

Re: [osg-users] Running OSG models on OpenGLES2.0

2016-03-14 Thread Hyun Kwon
Hi Sebastian,

Thanks for the reply.


From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of 
Sebastian Messerschmidt [sebastian.messerschm...@gmx.de]
Sent: Sunday, March 13, 2016 4:03 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Running OSG models on OpenGLES2.0

Hi Hyun,


Hi Chris,

I tried most of examples. Now I'm focusing on glsl_simple.osgt as it looks 
simple, but only the second row of shapes shows. If I modify the vertex shader 
a little, I get to see both first/second row.
Can you tell us which platform you are using?  You usually don't have to add 
precision qualifiers to make shaders work.

I have Xilinx ZynqMP SoC with MALI 400MP, and I'm running Ubuntu on it. I also 
have Yocto built rootfs. I've integrated the MALI OpenGLES2 library/driver 
there, and I'm building OSG manually. It fails to compile if I don't add the 
precision for float & int in shaders. The OSG build configuration is more or 
less as below (it's for 3.4.0), with some addition to point to EGL/OPENGLES2 
libraries and headers:

cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_OSG_EXAMPLES=ON \
-DOPENGL_PROFILE=GLES2 \
-DOPENGL_glu_LIBRARY= \
-DGL_HEADER_HAS_GLINT64:INTERNAL=0 \
-DGL_HEADER_HAS_GLUINT64:INTERNAL=0 \
-DOSG_GLU_AVAILABLE=OFF \
-DOSG_GL1_AVAILABLE=OFF \
-DOSG_GL2_AVAILABLE=OFF \
-DOSG_GL3_AVAILABLE=OFF \
-DOSG_GLES1_AVAILABLE=OFF \
-DOSG_GLES2_AVAILABLE=ON \
-DOPENGL_egl_LIBRARY='-lEGL' \
-DOPENGL_LIBRARY='-lGLESv2' \
-DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF \
-DOSG_GL_MATRICES_AVAILABLE=OFF \
-DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF \
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF \
-DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF \
-DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF \
-DPOPPLER_HAS_CAIRO_EXITCODE=0 \

I've received some OSG model (file.osg) from someone, and I was able to run it 
on the desktop (OpenGL). I was told the OSG model runs on OpenGLES2.0. For me 
to run it on OpenGLES2, I added the precision qualifiers to build, but the 
result still doesn't look correct. I'm not sure if more / what modification is 
needed. For example, I modified the OSG shader generator, but it didn't help. 
Does OSG layers completely abstract underlying APIs (OpenGL, OpenGLES,,,), 
meaning the OSG models are API independent? or does each OSG model have some 
API specific code? For example, I don't see any precision qualifiers in OSG 
examples, and does that mean those models are not for OpenGLES2.0?
OSG doesn't completely abstract the APIs, but it can be built specifically to 
work with OpenGL ES, by using the compiler flags you used. You will however 
have to put some work into it, since you will have to write shaders. Since you 
are not telling us which "shader generator" you are using, it is hard to guess 
what you are trying to achieve.
There is not something like "models for OpenGLES2.0". You will have to write 
appropriate shaders and might have to run some visitors to change fixed 
function pipeline functions in to uniforms/attributes of the model.
For instance osg::Material is not working outside the compatibility -profiles, 
so might have to run a visitor, that parses osg::Material instances and 
replaces them with uniforms or per-vertex attributes which you will have to 
evaluate in the shader.


I'm trying to figure out where the issue comes from: OSG model, OSG layers, 
OpenGLES library.

Chris asked you for an example model that is not working. You mentioned the 
glsl-simple model, which from a glance doesn't have ES-compatible code. The 
easiest thing to do is to start with a model(preferably not containing shaders) 
and a simple ES-Shader.
Unfortunately the examples here are relatively rare. Might be a great 
opportunity to create some minimalistic core/ES-based shader example and to 
extend the OpenGL-ES pseudo loader.

If there are already OSG models confirmed to work with OpenGLES2, I'd use those 
to validate my platform. But, none of examples in OpenSceneGraph-Data shows 
correct results on my platform (nothing displayed except the glsl_simple.osgt) 
comparing to results from desktop with OpenGL. Once my platform is confirmed to 
work, I will be able to focus on debugging the model. With lack of OSG / shader 
experience, I can't easily tell where the issue comes from, and I'm looking for 
references for validation.

Thanks,
-hyun

Thanks,
-hyun


Cheers
Sebastian


From: osg-users 
[osg-users-boun...@lists.openscenegraph.org<mailto:osg-users-boun...@lists.openscenegraph.org>]
 on behalf of Chris Hanson [xe...@alphapixel.com<mailto:xe...@alphapixel.com>]
Sent: Friday, March 11, 2

Re: [osg-users] Running OSG models on OpenGLES2.0

2016-03-13 Thread Sebastian Messerschmidt

Hi Hyun,



Hi Chris,

I tried most of examples. Now I'm focusing on glsl_simple.osgt as it 
looks simple, but only the second row of shapes shows. If I modify the 
vertex shader a little, I get to see both first/second row.
Can you tell us which platform you are using?  You usually don't have to 
add precision qualifiers to make shaders work.


I've received some OSG model (file.osg) from someone, and I was able 
to run it on the desktop (OpenGL). I was told the OSG model runs on 
OpenGLES2.0. For me to run it on OpenGLES2, I added the precision 
qualifiers to build, but the result still doesn't look correct. I'm 
not sure if more / what modification is needed. For example, I 
modified the OSG shader generator, but it didn't help. Does OSG layers 
completely abstract underlying APIs (OpenGL, OpenGLES,,,), meaning the 
OSG models are API independent? or does each OSG model have some API 
specific code? For example, I don't see any precision qualifiers in 
OSG examples, and does that mean those models are not for OpenGLES2.0?
OSG doesn't completely abstract the APIs, but it can be built 
specifically to work with OpenGL ES, by using the compiler flags you 
used. You will however have to put some work into it, since you will 
have to write shaders. Since you are not telling us which "shader 
generator" you are using, it is hard to guess what you are trying to 
achieve.
There is not something like "models for OpenGLES2.0". You will have to 
write appropriate shaders and might have to run some visitors to change 
fixed function pipeline functions in to uniforms/attributes of the model.
For instance osg::Material is not working outside the compatibility 
-profiles, so might have to run a visitor, that parses osg::Material 
instances and replaces them with uniforms or per-vertex attributes which 
you will have to evaluate in the shader.




I'm trying to figure out where the issue comes from: OSG model, OSG 
layers, OpenGLES library.


Chris asked you for an example model that is not working. You mentioned 
the glsl-simple model, which from a glance doesn't have ES-compatible 
code. The easiest thing to do is to start with a model(preferably not 
containing shaders) and a simple ES-Shader.
Unfortunately the examples here are relatively rare. Might be a great 
opportunity to create some minimalistic core/ES-based shader example and 
to extend the OpenGL-ES pseudo loader.



Thanks,
-hyun



Cheers
Sebastian



*From:* osg-users [osg-users-boun...@lists.openscenegraph.org] on 
behalf of Chris Hanson [xe...@alphapixel.com]

*Sent:* Friday, March 11, 2016 5:27 PM
*To:* OpenSceneGraph Users
*Subject:* Re: [osg-users] Running OSG models on OpenGLES2.0

OGL ES requires a shader.​

Many of the OSG-Data models don't have shaders built into them, and 
will not transform and rasterize as a result.


Which OSG model did you try that had most surfaces transparent?


This email and any attachments are intended for the sole use of the 
named recipient(s) and contain(s) confidential information that may be 
proprietary, privileged or copyrighted under applicable law. If you 
are not the intended recipient, do not read, copy, or forward this 
email message or any attachments. Delete this email message and any 
attachments immediately.




___
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] Running OSG models on OpenGLES2.0

2016-03-12 Thread Hyun Kwon
Hi Chris,

I tried most of examples. Now I'm focusing on glsl_simple.osgt as it looks 
simple, but only the second row of shapes shows. If I modify the vertex shader 
a little, I get to see both first/second row.

I've received some OSG model (file.osg) from someone, and I was able to run it 
on the desktop (OpenGL). I was told the OSG model runs on OpenGLES2.0. For me 
to run it on OpenGLES2, I added the precision qualifiers to build, but the 
result still doesn't look correct. I'm not sure if more / what modification is 
needed. For example, I modified the OSG shader generator, but it didn't help. 
Does OSG layers completely abstract underlying APIs (OpenGL, OpenGLES,,,), 
meaning the OSG models are API independent? or does each OSG model have some 
API specific code? For example, I don't see any precision qualifiers in OSG 
examples, and does that mean those models are not for OpenGLES2.0?

I'm trying to figure out where the issue comes from: OSG model, OSG layers, 
OpenGLES library.

Thanks,
-hyun


From: osg-users [osg-users-boun...@lists.openscenegraph.org] on behalf of Chris 
Hanson [xe...@alphapixel.com]
Sent: Friday, March 11, 2016 5:27 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Running OSG models on OpenGLES2.0

OGL ES requires a shader.​

Many of the OSG-Data models don't have shaders built into them, and will not 
transform and rasterize as a result.

Which OSG model did you try that had most surfaces transparent?


This email and any attachments are intended for the sole use of the named 
recipient(s) and contain(s) confidential information that may be proprietary, 
privileged or copyrighted under applicable law. If you are not the intended 
recipient, do not read, copy, or forward this email message or any attachments. 
Delete this email message and any attachments immediately.

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


Re: [osg-users] Running OSG models on OpenGLES2.0

2016-03-11 Thread Chris Hanson
OGL ES requires a shader.​

Many of the OSG-Data models don't have shaders built into them, and will
not transform and rasterize as a result.

Which OSG model did you try that had most surfaces transparent?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org