Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 http://forum.openscenegraph.org//files/smple_207.png ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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? On Fri, Oct 3, 2014 at 12:10 PM, joey pedroza jpedr...@thex1.com wrote: 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 http://forum.openscenegraph.org//files/smple_207.png ___ 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 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] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 like 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: http://forum.openscenegraph.org//files/gl02_107.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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? On Tue, Sep 30, 2014 at 6:22 PM, joey pedroza jpedr...@thex1.com wrote: 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 parent02869(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 ___ 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 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] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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)? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
Incomplete. What/where is generate_texture_names()? On Wed, Oct 1, 2014 at 3:53 PM, joey pedroza jpedr...@thex1.com wrote: 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 ___ 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 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] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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. 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. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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. 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 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] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 parent02869(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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 0x07fefd8c940d in osgjoeytest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x0025b330.. First-chance exception at 0x07fefd8c940d in osgjoeytest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x00258e60.. First-chance exception at 0x07fefd8c940d in osgjoeytest.exe: Microsoft C++ exception: [rethrow] at memory location 0x.. First-chance exception at 0x07fefd8c940d in osgjoeytest.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x00258e60.. Unhandled exception at 0x07fefd8c940d 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_ptrosgViewer::Viewer viewerE = new osgViewer::Viewer; viewerE-setReleaseContextAtEndOfFrameHint(false); osg::observer_ptrosgViewer::GraphicsWindow window = viewerE-setUpViewerAsEmbeddedInWindow(100,100,800,600); //osg::ref_ptrosg::Node globeE = osgDB::readNodeFile(C:\\workspace\\EarthFiles\\joey.earth); osg::ref_ptrosg::Node globeE = osgDB::readNodeFile(C:\\workspace\\osgEarthProject\\data\\world.tif); osg::ref_ptrosgEarth::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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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: http://forum.openscenegraph.org//files/screenshot_173.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
Are you 100% sure your shaders are compiling? Did you turn OSG's Notify level to DEBUG_FP? On Mon, Sep 29, 2014 at 3:22 PM, joey pedroza jpedr...@thex1.com wrote: 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 ___ 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 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] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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. On Fri, Sep 26, 2014 at 5:43 PM, joey pedroza jpedr...@thex1.com wrote: 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_ptrosg::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 ___ 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 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] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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_ptrosg::Referenced windata = new osgViewer::GraphicsWindowWin32::WindowData( hwnd ); /** WindowData is used to pass in the Win32 window handle attached the GraphicsContext::Traits structure.*/ osg::ref_ptrosg::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_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext( traits.get() ); osg::ref_ptrosg::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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
You need to be using GraphicsWindowEmbedded, and your call to eglGetDisplay() should use EGL_DEFAULT_DISPLAY . On Fri, Sep 26, 2014 at 12:10 PM, joey pedroza jpedr...@thex1.com wrote: 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_ptrosg::Referenced windata = new osgViewer::GraphicsWindowWin32::WindowData( hwnd ); /** WindowData is used to pass in the Win32 window handle attached the GraphicsContext::Traits structure.*/ osg::ref_ptrosg::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_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext( traits.get() ); osg::ref_ptrosg::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 ___ 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 •
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
It's an existing class: http://trac.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00351.html The osgviewerGLUT.cpp example uses it. On Fri, Sep 26, 2014 at 1:44 PM, joey pedroza jpedr...@thex1.com wrote: 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 ___ 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 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] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
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_ptrosg::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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
Hi, Well for now we decided to just continue on Windows and then worry about getting everything on our Linux target later. Possibly in the future will just develop and debug in native linux and not worry about Windows so we'll see. Thank you! Cheers, joey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61024#61024 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
Are you using the PowerVR Insider SDK framework on your embedded Linux platform? If so, then you can probably use the same code on both platforms to integrate a GraphicsWindowEmbedded with direct calls to update osg via the frame() function in the drawing callback their framework provides. You might need to do a bit of manual render state resetting before and after to ensure that both systems work together properly. If osg's existing Linux support, or some template you got from elsewhere is what you're using on Linux, then you might as well just use Desktop OpenGL on Windows, and either just try to avoid the Fixed-function pipeline and other stuff unavailable in OpenGL ES, or specifically to strip them out using osg's CMAKE build options. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
Hi Joey I achieved a result by using SDL 2 with EGL enabled, see a sample app for a derived from osg project ( it is almost osg just compiled to be used under emscripten ), hope the code helps https://github.com/Kurdakov/emscripten_OSG/blob/master/examples/osgviewerSDL2EmscriptenSTATIC/osgviewerSDL2Emscripten.cpp in case you are interested - I used ANGLE ad OpenGL ES 2.0 provider ( not any wgl functions ) but to force SDL 2 to use ANGLE in file \SDL-2.0.x\src\video\windows\SDL_windowsopengl.c in function void WIN_GL_InitExtensions(_THIS) I had to comment following lines if (HasExtension(WGL_EXT_create_context_es2_profile, extensions)) { _this-gl_data-HAS_WGL_EXT_create_context_es2_profile = SDL_TRUE; } hope those steps are not intimidating. Regards Sergey On Wed, Sep 10, 2014 at 9:22 AM, Chris Hanson xe...@alphapixel.com wrote: Unfortunately, GLES2 on Windows is not so easy, because there really isn't a GraphicWindowEGL implementation that would work on Windows. I started writing one, but got bogged down and had to abandon it. You might consider not compiling the GraphicsWindowWin32 code and just using GraphicsWindowEmbedded and using EGL functions in your app's code to create a context, and then pass it to OSG. Also, we might be able to help you more if we knew what exactly you were trying to accomplish in the end. ___ 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] [build] Building OSG with OpenGL ES 2
From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Chris Hanson Sent: 10 September 2014 06:22 To: OpenSceneGraph Users Subject: Re: [osg-users] [build] Building OSG with OpenGL ES 2 You might consider not compiling the GraphicsWindowWin32 code and just using GraphicsWindowEmbedded and using EGL functions in your app's code to create a context, and then pass it to OSG. I would concur with that. The relevant lines from my previous post about using ANGLE on Windows are probably: · Remove GraphicsWindowWin32 and PixelBufferWin32 cpp files from the osgViewer project · Edit the osg::getGLExtensionFuncPtr function to load libgles2d.dll for debug builds But like Chris says, that will leave you without a native GraphicsWindow implementation, unless you’re planning to use GraphicsWindowEmbedded with an OpenGL context that you set up yourself. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
Hi, Wow thanks everyone for your feedback. So let me get your guys opinion on this, I am building a synthetic terrain map using osgearth. But we are overlaying the map with our own stuff. I was actually trying to merge his code onto my project following the teapot example. But found out the other project is making ES2.0 calls. So I decided to build OSG to support ES2.0 and that lead me to this post. Our target in the end is Embeded Linux, Ubuntu I think and the overlay stuff is written using OpenGL ES 2.0. Because they are expecting it to be embedded. Currently the overlay is running on windows with the ES2.0 and it is using PowerVR as the emulator. I thought I could do the same thing compile OSG for ES2.0 and use the powervr emulator. But as you saw this post I never compiled OSG successfully. So should I develop one project in windows for osgearth and then just clone the code to another project that is made for the Linux embedded target? I really rather see if I can figure this out so that I can run the proje cts together on windows for future development/maintainability/debugging purposes. Thank you! Cheers, joey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61012#61012 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
For the most part, ES2 is a subset of desktop OpenGL. It's probably easier to get the ES2 code built and running with desktop GL than it is to go the other way. On Wed, Sep 10, 2014 at 10:52 AM, joey pedroza jpedr...@thex1.com wrote: Hi, Wow thanks everyone for your feedback. So let me get your guys opinion on this, I am building a synthetic terrain map using osgearth. But we are overlaying the map with our own stuff. I was actually trying to merge his code onto my project following the teapot example. But found out the other project is making ES2.0 calls. So I decided to build OSG to support ES2.0 and that lead me to this post. Our target in the end is Embeded Linux, Ubuntu I think and the overlay stuff is written using OpenGL ES 2.0. Because they are expecting it to be embedded. Currently the overlay is running on windows with the ES2.0 and it is using PowerVR as the emulator. I thought I could do the same thing compile OSG for ES2.0 and use the powervr emulator. But as you saw this post I never compiled OSG successfully. So should I develop one project in windows for osgearth and then just clone the code to another project that is made for the Linux embedded target? I really rather see if I can figure this out so that I can run the proje cts together on windows for future development/maintainability/debugging purposes. Thank you! Cheers, joey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=61012#61012 ___ 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 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] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [build] Building OSG with OpenGL ES 2
Hi, Is there a document that has step by step instructions to build OSG with the OpenGL ES2 option. I set the options with cmake as I have found in a few posts but I get unreferenced symbols etc for the following this is not a complete list: wglGetCurrentContext wglShareLists wglMakeCurrent wglCreateContext wglGetProcAddress wglDeleteContext glBindTexter glgetinteger I built it just fine with the defaults and even developed a project. Now I am trying to build everything for OpenGL ES2 and am having issues. I am using a windows 7 PC and will be using PowerVR Graphics as the emulator, any help on this would be great, the end target will be Linux but we do all of our development in windows Thank you! Cheers, joey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=60996#60996 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [build] Building OSG with OpenGL ES 2
Unfortunately, GLES2 on Windows is not so easy, because there really isn't a GraphicWindowEGL implementation that would work on Windows. I started writing one, but got bogged down and had to abandon it. You might consider not compiling the GraphicsWindowWin32 code and just using GraphicsWindowEmbedded and using EGL functions in your app's code to create a context, and then pass it to OSG. Also, we might be able to help you more if we knew what exactly you were trying to accomplish in the end. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org