Discussion:
[build] Building OSG with OpenGL ES 2
joey pedroza
2014-09-26 18:10:06 UTC
Permalink
Hi Team,

It was decided that it is a priority to get this project to run on windows. So I went down the path of trying to get it to work. That is my life right now.

Unfortunately they don't want to use SDL 2.

Here is where I'm at currently, I have been able to successfully compile the latest OSG with OpenGLES2.0 by removing the two files suggested GraphicsWindowWin32 and PixelBufferWin32. I am using PowerVR open gl libraries. This is an emulator. It currently works for the overlay project so I know this will work here.

Now I need to pass a graphic context to my code but the samples I saw do this. and I no longer have GraphicsWindowWin32? how else can I get a gc?

osg::ref_ptr<osg::Referenced> windata = new osgViewer::GraphicsWindowWin32::WindowData( hwnd );
/** WindowData is used to pass in the Win32 window handle attached the GraphicsContext::Traits structure.*/
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;
traits->x = 0;
traits->y = 0;
traits->width = 800;
traits->height = 600;
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->inheritedWindowData = windata;
osg::ref_ptr<osg::GraphicsContext> gc = osg::GraphicsContext::createGraphicsContext( traits.get() );
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
camera->setGraphicsContext( gc );
camera->setViewport( new osg::Viewport(0, 0, traits->width, traits->height) );
camera->setClearMask( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
camera->setClearColor( osg::Vec4f(0.2f, 0.2f, 0.4f, 1.0f) );
camera->setProjectionMatrixAsPerspective( 30.0f,(double)traits->width/(double)traits->height,1.0,1000.0 );
g_viewer = new osgViewer::Viewer;
g_viewer->setCamera( camera.get() );
g_viewer->setSceneData( osgDB::readNodeFile("cessna.osg") );
g_viewer->setKeyEventSetsDone( 0 );
g_viewer->setCameraManipulator( new osgGA::TrackballManipulator );

In our overlay project which is where we get the graphic context that we want to pass on to osg the code is like so
case WM_CREATE:
egl_window = hWnd;

//Store the device context.
hDC = GetDC(hWnd);

//Get the default display.
egl_display = eglGetDisplay(hDC);
//eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);

//Initialize EGL.
eglInitialize(egl_display, &egl_major_version, &egl_minor_version);

//Make OpenGL ES the current API.
eglBindAPI(EGL_OPENGL_ES_API);

//Find a configuration that matches all requirements.
eglChooseConfig(egl_display, egl_config_attributes, &egl_config, 1, &configs);

//Create a drawing surface.
egl_surface = eglCreateWindowSurface(egl_display, egl_config, egl_window, NULL);

//Create a context.
egl_context = eglCreateContext(egl_display, egl_config, NULL, egl_context_attributes);

//Bind the context to the current thread and use window surface for drawing.
eglMakeCurrent(egl_display, egl_surface, egl_surface, egl_context);

//Specify the minimum number of video frame periods per buffer swap.
//If interval is set to a value of 0, buffer swaps are not synchronized to a video frame,
//and the swap happens as soon as the render is complete.
eglSwapInterval(egl_display, 1);
//eglSwapInterval(egl_display, 0);

//Get the version of OpenGL ES and GL Shading Language.
opengl_es_version = glGetString(GL_VERSION);
glsl_version = glGetString(GL_SHADING_LANGUAGE_VERSION);

//Set the clear values for the color buffer.
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);

//Set the OpenGL display settings.
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glDepthFunc(GL_LEQUAL);
glClearDepthf(1.0f);
glDepthRangef(0.0f, 1.0f);

//Load the default shader program.
shader.load_default_shader();
default_shader_program = shader.get_default_shader_program();

//Generate texture names.
generate_texture_names(texture_id);

Thank you!

Cheers,
joey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61182#61182
Chris Hanson
2014-09-26 19:16:08 UTC
Permalink
You need to be using GraphicsWindowEmbedded, and your call to
eglGetDisplay() should use EGL_DEFAULT_DISPLAY .
Post by joey pedroza
Hi Team,
It was decided that it is a priority to get this project to run on
windows. So I went down the path of trying to get it to work. That is my
life right now.
Unfortunately they don't want to use SDL 2.
Here is where I'm at currently, I have been able to successfully compile
the latest OSG with OpenGLES2.0 by removing the two files suggested
GraphicsWindowWin32 and PixelBufferWin32. I am using PowerVR open gl
libraries. This is an emulator. It currently works for the overlay
project so I know this will work here.
Now I need to pass a graphic context to my code but the samples I saw do
this. and I no longer have GraphicsWindowWin32? how else can I get a gc?
osg::ref_ptr<osg::Referenced> windata = new
osgViewer::GraphicsWindowWin32::WindowData( hwnd );
/** WindowData is used to pass in the Win32 window handle attached the
GraphicsContext::Traits structure.*/
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new
osg::GraphicsContext::Traits;
traits->x = 0;
traits->y = 0;
traits->width = 800;
traits->height = 600;
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->inheritedWindowData = windata;
osg::ref_ptr<osg::GraphicsContext> gc =
osg::GraphicsContext::createGraphicsContext( traits.get() );
osg::ref_ptr<osg::Camera> camera = new osg::Camera;
camera->setGraphicsContext( gc );
camera->setViewport( new osg::Viewport(0, 0, traits->width,
traits->height) );
camera->setClearMask( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
camera->setClearColor( osg::Vec4f(0.2f, 0.2f, 0.4f, 1.0f) );
camera->setProjectionMatrixAsPerspective(
30.0f,(double)traits->width/(double)traits->height,1.0,1000.0 );
g_viewer = new osgViewer::Viewer;
g_viewer->setCamera( camera.get() );
g_viewer->setSceneData( osgDB::readNodeFile("cessna.osg") );
g_viewer->setKeyEventSetsDone( 0 );
g_viewer->setCameraManipulator( new osgGA::TrackballManipulator );
In our overlay project which is where we get the graphic context that we
want to pass on to osg the code is like so
egl_window = hWnd;
//Store the device context.
hDC = GetDC(hWnd);
//Get the default display.
egl_display = eglGetDisplay(hDC);
//eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
//Initialize EGL.
eglInitialize(egl_display, &egl_major_version,
&egl_minor_version);
//Make OpenGL ES the current API.
eglBindAPI(EGL_OPENGL_ES_API);
//Find a configuration that matches all requirements.
eglChooseConfig(egl_display, egl_config_attributes, &egl_config, 1, &configs);
//Create a drawing surface.
egl_surface = eglCreateWindowSurface(egl_display, egl_config,
egl_window, NULL);
//Create a context.
egl_context = eglCreateContext(egl_display, egl_config, NULL,
egl_context_attributes);
//Bind the context to the current thread and use window surface for drawing.
eglMakeCurrent(egl_display, egl_surface, egl_surface, egl_context);
//Specify the minimum number of video frame periods per buffer swap.
//If interval is set to a value of 0, buffer swaps are not
synchronized to a video frame,
//and the swap happens as soon as the render is complete.
eglSwapInterval(egl_display, 1);
//eglSwapInterval(egl_display, 0);
//Get the version of OpenGL ES and GL Shading Language.
opengl_es_version = glGetString(GL_VERSION);
glsl_version = glGetString(GL_SHADING_LANGUAGE_VERSION);
//Set the clear values for the color buffer.
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
//Set the OpenGL display settings.
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
glDepthFunc(GL_LEQUAL);
glClearDepthf(1.0f);
glDepthRangef(0.0f, 1.0f);
//Load the default shader program.
shader.load_default_shader();
default_shader_program = shader.get_default_shader_program();
//Generate texture names.
generate_texture_names(texture_id);
Thank you!
Cheers,
joey
------------------
http://forum.openscenegraph.org/viewtopic.php?p=61182#61182
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
Chris 'Xenon' Hanson, omo sanza lettere. Xenon-***@public.gmane.org
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
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography
• Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS •
Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
joey pedroza
2014-09-26 19:44:07 UTC
Permalink
Hi,

Thanks for the quick update, is GraphicsWindowEmbedded a OSG class or is that a project setting. I haven't been able to find much on what that is so I can apply it. Is there an example?

Thank you!

Cheers,
joey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61185#61185
Chris Hanson
2014-09-26 20:21:40 UTC
Permalink
It's an existing class:
http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00351.html

The osgviewerGLUT.cpp example uses it.
Post by joey pedroza
Hi,
Thanks for the quick update, is GraphicsWindowEmbedded a OSG class or is
that a project setting. I haven't been able to find much on what that is
so I can apply it. Is there an example?
Thank you!
Cheers,
joey
------------------
http://forum.openscenegraph.org/viewtopic.php?p=61185#61185
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
Chris 'Xenon' Hanson, omo sanza lettere. Xenon-***@public.gmane.org
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
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography
• Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS •
Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
joey pedroza
2014-09-26 23:43:42 UTC
Permalink
Hi,

Thanks, I was able to find some other examples once I knew what I was looking for, but that portion of code seems to compile but the part that is failing for me is the line of code below. It crashes saying something about invalid pointer. Before that line worked for me just fine. Does Read Node use anything from the two files I deleted, see my line below.

osg::ref_ptr<osg::Node> globeE = osgDB::readNodeFile("C:\\workspace\\data\\world.tif");

I've used other sample nodes but they all crash with the same thing, about an invalid pointer. I stepped into it and eventually I get the error.

Another question I have the create EGL stuff, I build my embedded stuff after all the EGL is created?


Thank you!

Cheers,
joey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61189#61189
Chris Hanson
2014-09-27 18:15:19 UTC
Permalink
Are the various plugins available at runtime?

Turn on OSG_NOTIFY up as high as it can go (DEBUG_FP) and see what it says.
Post by joey pedroza
Hi,
Thanks, I was able to find some other examples once I knew what I was
looking for, but that portion of code seems to compile but the part that is
failing for me is the line of code below. It crashes saying something
about invalid pointer. Before that line worked for me just fine. Does Read
Node use anything from the two files I deleted, see my line below.
osg::ref_ptr<osg::Node> globeE =
osgDB::readNodeFile("C:\\workspace\\data\\world.tif");
I've used other sample nodes but they all crash with the same thing, about
an invalid pointer. I stepped into it and eventually I get the error.
Another question I have the create EGL stuff, I build my embedded stuff
after all the EGL is created?
Thank you!
Cheers,
joey
------------------
http://forum.openscenegraph.org/viewtopic.php?p=61189#61189
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
Chris 'Xenon' Hanson, omo sanza lettere. Xenon-***@public.gmane.org
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
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography
• Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS •
Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
joey pedroza
2014-09-29 17:46:01 UTC
Permalink
Hi,

I say that the plugins are available as I copied all generated exe's and dll's to the working directory. But here is what the debug window shows when I try to read a node. A few thing to note.
1. I had it working with OpenGL 1.0 or whatever the defaults were.
2. I rebuilt everything with Open GLES2.0. To do that I deleted the pixel and graphicwindow32 files from the OSGViewer project.
3. Per the suggestions above I am trying to pass it my own graphic context.
4. The code compiles and runs but crashes when trying to read a node.
This is where I am currently stuck and not sure why it would do this as not sure that any of the changes I made would impact reading a node.
5. Oh I added the environment variable OSG_NOTIFY_LEVEL and set it to DEBUG_FP not sure what more we expect to see but I pasted what I saw below.

First-chance exception at 0x000007fefd8c940d in osgjoeytest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0025b330..
First-chance exception at 0x000007fefd8c940d in osgjoeytest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x00258e60..
First-chance exception at 0x000007fefd8c940d in osgjoeytest.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..
First-chance exception at 0x000007fefd8c940d in osgjoeytest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x00258e60..
Unhandled exception at 0x000007fefd8c940d in osgjoeytest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x00258e60..

Just in case this is part of the code I am trying to run. This was taken from the GLUT example. I am in the middle of trying another example that is different.

//Display the window.
ShowWindow(hWnd, SW_SHOW);
////////////////////////////////////////HWND/////////////////////////////////////////////
// create the view of the scene.
osg::ref_ptr<osgViewer::Viewer> viewerE = new osgViewer::Viewer;
viewerE->setReleaseContextAtEndOfFrameHint(false);
osg::observer_ptr<osgViewer::GraphicsWindow> window = viewerE->setUpViewerAsEmbeddedInWindow(100,100,800,600);
//osg::ref_ptr<osg::Node> globeE = osgDB::readNodeFile("C:\\workspace\\EarthFiles\\joey.earth");
osg::ref_ptr<osg::Node> globeE = osgDB::readNodeFile("C:\\workspace\\osgEarthProject\\data\\world.tif");
osg::ref_ptr<osgEarth::MapNode> mapNodeE = MapNode::get(globeE);
osg::Group* rootE = new osg::Group();
rootE->addChild( mapNodeE );
viewerE->setSceneData(rootE);
viewerE->setCameraManipulator(new osgGA::FlightManipulator());
//viewer->addEventHandler(new osgViewer::StatsHandler);
viewerE->realize();


Other example I'm in the middle of looking at not sure which is the way to go so feel free to let me know.
// graphics window embedded [x,y,w,h parameters don't seem to do anything??]
m_osg_winEmb = new osgViewer::GraphicsWindowEmbedded(0,0,this->width(),this->height());

// sets the viewport as described here http://www.opengl.org/sdk/docs/man/xhtml/glViewport.xml
// but (x=0 and y=0) correspond to (0,0) of the entire window and not just our local item bounds
m_osg_viewer.getCamera()->setViewport(new osg::Viewport(0,0,this->width(),this->height()));
m_osg_viewer.getCamera()->setGraphicsContext(m_osg_winEmb.get());
m_osg_viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);

Thank you!

Cheers,
joey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61204#61204
joey pedroza
2014-09-29 18:04:13 UTC
Permalink
Hi,

screen shot of what the cmd window shows.



Thank you!

Cheers,
joey[/img]

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




Attachments:
Loading Image...
joey pedroza
2014-09-29 19:04:39 UTC
Permalink
Hi,

Update: turns out if I run it in release mode it doesn't crash so my problem must be that in debug mode I have issues, will figure that out later. Currently trying to get it to work by passing it my own graphic context.


Thank you!

Cheers,
joey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61206#61206
joey pedroza
2014-09-29 21:22:55 UTC
Permalink
Hi,

Well more progress, I can set the background color but nothing appears on screen. baby steps :) any hint as to what else I may want to look into as to why nothing is seen on screen except for the background color would be greatly appreciated

Thank you!

Cheers,
joey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61208#61208
Chris Hanson
2014-09-30 00:28:49 UTC
Permalink
Are you 100% sure your shaders are compiling? Did you turn OSG's Notify
level to DEBUG_FP?
Post by joey pedroza
Hi,
Well more progress, I can set the background color but nothing appears on
screen. baby steps :) any hint as to what else I may want to look into as
to why nothing is seen on screen except for the background color would be
greatly appreciated
Thank you!
Cheers,
joey
------------------
http://forum.openscenegraph.org/viewtopic.php?p=61208#61208
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
Chris 'Xenon' Hanson, omo sanza lettere. Xenon-***@public.gmane.org
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
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography
• Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS •
Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
joey pedroza
2014-09-30 01:59:10 UTC
Permalink
Hi,

everything in OSG was compiled successfully. I even compiled the projects one at a time. Since then I have done it twice once for debug and again for release. But to be safe and not waste anyone's time how can I be certain other than seeing the entire OSG project compile with no errors.
And yes I did set the environment to DEBUG_FP and it definitely gives me more information so the notify is working.


Thank you!

Cheers,
joey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61210#61210
Alistair Baxter
2014-09-30 10:56:57 UTC
Permalink
Did you do the following?

* Edit the osg::getGLExtensionFuncPtr function to load libgles2d.dll for debug builds

I had that problem with Debug builds using gles2 on Windows, all of the opengl extension function pointers were set up wrongly because it was trying to read the release opengl dll. That was for ANGLE, it's possible that your DLL is named differently.
Chris Hanson
2014-09-30 14:39:32 UTC
Permalink
Post by joey pedroza
everything in OSG was compiled successfully. I even compiled the projects
one at a time.

I'm not sure you understand. GLSL shaders are compiled at runtime by the
OpenGL driver. If there are errors in your GLSL code, they won't show up
until runtime, when the shader will fail to compile. OSG will log an error
to the OSG NOTIFY stream.
​
Post by joey pedroza
so the notify is working.
We don't care if it's _working_. We care about whether there are any
significant errors in the OSG Notify output? Have you looked at it? it's
probably telling you what's going wrong.
joey pedroza
2014-09-30 19:49:18 UTC
Permalink
Hi Team,

Yup your right I did not understand. Thanks for clearing that up. I will see what I can dig up and what errors I'm getting. My app does not have a command window so I need to figure out how to get all printouts to show up on my debug window.

...


Thank you!

Cheers,
joey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61217#61217
Chris Hanson
2014-09-30 20:33:53 UTC
Permalink
Post by joey pedroza
Yup your right I did not understand. Thanks for clearing that up. I will
see what I can dig up and what errors I'm getting. My app does not have a
command window so I need to figure out how to get all printouts to show up
on my debug window.
http://article.gmane.org/gmane.comp.graphics.openscenegraph.user/1296
--
Chris 'Xenon' Hanson, omo sanza lettere. Xenon-***@public.gmane.org
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
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography
• Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS •
Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
joey pedroza
2014-10-01 00:22:54 UTC
Permalink
Hi,

well I just had it run as a console and was able to see the output. But attached you can see what my output is.

Seems to be stuck with "Adding parent0000000002869(Error) There is no context bound to the current thread."


Thank you!

Cheers,
joey

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




Attachments:
http://forum.openscenegraph.org//files/output_159.txt
Chris Hanson
2014-10-01 16:19:49 UTC
Permalink
Are you intentionally multithreading?

Did you create and bind a context before performing the operation (seems
like maybe a load?) that is throwing that error?
Post by joey pedroza
Hi,
well I just had it run as a console and was able to see the output. But
attached you can see what my output is.
Seems to be stuck with "Adding parent0000000002869(Error) There is no
context bound to the current thread."
Thank you!
Cheers,
joey
------------------
http://forum.openscenegraph.org/viewtopic.php?p=61219#61219
http://forum.openscenegraph.org//files/output_159.txt
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
Chris 'Xenon' Hanson, omo sanza lettere. Xenon-***@public.gmane.org
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
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography
• Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS •
Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
joey pedroza
2014-10-01 17:38:52 UTC
Permalink
Hi,

I had my OSG view setup function being called in the wrong place. So that was my silly mistake. But now I get this error.

(Error) in function: glBindTexture GL: 501 (GL_INVALID_VALUE) VF: 501 (invalid value)

I also see this not sure what it means or even if it's bad.

"getCoordinateFrame(0 -1 0)
no coordinate system found, using default orientation"

I feel like I'm so close, hopefully I am :)

Thank you!

Cheers,
joey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61230#61230
Chris Hanson
2014-10-01 17:52:43 UTC
Permalink
Without knowing what your code is doing, It's hard to say.

Telepathic debugging suggests you are attempting to bind a texture that
does not have any mipmaps generated, but you are
using GL_TEXTURE_MIN_FILTER=GL_NEAREST_MIPMAP_LINEAR which then requires
mipmaps.

https://web.archive.org/web/20110712123054/http://www.opengl.org/wiki/Common_Mistakes#Creating_a_Texture
​

Do you have mipmaps for that texture? Is
GL_TEXTURE_MIN_FILTER=GL_NEAREST_MIPMAP_LINEAR (or some other mode that
uses mipmaps)?
joey pedroza
2014-10-01 21:53:16 UTC
Permalink
Hi,

hopefully the file attached can help show what I'm trying to do.

Thank you!

Cheers,
joey

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




Attachments:
http://forum.openscenegraph.org//files/codesnippets_145.cpp
Chris Hanson
2014-10-01 23:19:32 UTC
Permalink
Incomplete. What/where is generate_texture_names()?
Post by joey pedroza
Hi,
hopefully the file attached can help show what I'm trying to do.
Thank you!
Cheers,
joey
------------------
http://forum.openscenegraph.org/viewtopic.php?p=61232#61232
http://forum.openscenegraph.org//files/codesnippets_145.cpp
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
Chris 'Xenon' Hanson, omo sanza lettere. Xenon-***@public.gmane.org
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
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography
• Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS •
Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
joey pedroza
2014-10-01 23:35:13 UTC
Permalink
Hi,

Yes it was just some code snippets. out of all you saw nothing jumped out or at least am I on the right track? To answer your question on that one function it makes an open GL call and you can see the function below.
Out of all the things and different combinations I tried I did comment out loading textures and did not behave any different.

void generate_texture_names(GLuint texture_id_array[]) {
//Generate texture names (10 total).
glGenTextures(10, texture_id_array);
}


Thank you!

Cheers,
joey

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61234#61234
joey pedroza
2014-10-03 18:10:20 UTC
Permalink
Hi,

Progress! This is where I'm at, I don't see any errors (log is attached) but my terrain is only blue(image attached). Since I don't see errors I don't know what to do next. Any help would be appreciated.

I haven't commented out or altered the OSG code other than removing windows32 and pixel file mentioned earlier in the thread.

I'm guessing that since I'm using GLES2.0 that some functionalities just are not being implemented? Don't know as I'm a newbie at this and this is what the company wants(run the code in windows) so this is my life unfortunately.


Thank you!

Cheers,
joey

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




Attachments:
http://forum.openscenegraph.org//files/temp_838.txt
Loading Image...
Chris Hanson
2014-10-03 21:15:40 UTC
Permalink
Did the code come with GLES2 shaders already set up? What does the program
look like when run on a genuine GLES2 device? What is the source of the
terrain? VPB? OSGEarth? Some random OpenFlight file?
Post by joey pedroza
Hi,
Progress! This is where I'm at, I don't see any errors (log is attached)
but my terrain is only blue(image attached). Since I don't see errors I
don't know what to do next. Any help would be appreciated.
I haven't commented out or altered the OSG code other than removing
windows32 and pixel file mentioned earlier in the thread.
I'm guessing that since I'm using GLES2.0 that some functionalities just
are not being implemented? Don't know as I'm a newbie at this and this is
what the company wants(run the code in windows) so this is my life
unfortunately.
Thank you!
Cheers,
joey
------------------
http://forum.openscenegraph.org/viewtopic.php?p=61248#61248
http://forum.openscenegraph.org//files/temp_838.txt
http://forum.openscenegraph.org//files/smple_207.png
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
--
Chris 'Xenon' Hanson, omo sanza lettere. Xenon-***@public.gmane.org
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
Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography
• Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS •
Android
@alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775)
623-PIXL [7495]
joey pedroza
2014-10-03 23:44:30 UTC
Permalink
Hi,

not sure on the GLES2 shaders. I will check. Also I have not ran this on our GLES2 device yet. They don't want me to bother unless I can get it to work on Windows 7 with an emulator. As we believe it will run on our target even though with my experience so far I'm going to be in a world of adventure :) The source of the terrain is tms files created with osgearth_package from our dem elevation files. It only has elevation. Attached you will find an image of what it looks like when I run desktop openGL, seems like everything is working except I don't see the contour colors. I posted that error on the osgEarth forum to see if they know what that is. The error I got was "[osgEarth]* [CountourMap] Failed to reserve a texture image unit; disabled.". Attached is an image of what it looks lik
e with desktop OpenGL.

I will try to clean up all of my code and post for reference.

Thank you!

Cheers,
joey

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




Attachments:
Loading Image...

Loading...