Re: [osg-users] OT: VS2010 LNK2005 problem related to ostringstream
I have verified the build mode for all ingoing libraries. I build all the dependencies myself. Including OSG. The problem I have (which is OSG related), is that if I build without OSG support (no rendering), it all works. And I still use std::ostringstream and std::stringstream quite extensively... We still link against OpenThreads (but no rendering). So only when I link against osg (osg.lib, osgDB.lib, osgText.lib, osgShadow.lib, osgViewer.lib osgGA.lib) I get this problem. I have verified that osg (and OpenThreads) are all built consistently all over the field. Release and /MD (MultiThreadedDLL), which is default from CMake. So I can use/link against OpenThreads.lib, but not OSG... Rather nasty problem, I'm trying to reduce it, but I'm getting nowhere. And once again, same settings, same CMake version, same code all over the place, and it works in VS2008... /A On Thu, Aug 26, 2010 at 8:17 PM, Simon Hammett s.d.hamm...@googlemail.comwrote: Ah ok, then next things to check: Make absolutely sure you aren't mixing up objects libraries from the different builds. For my projects I include a vc version number in the name, so .vc7.lib/vc7.dll .vc9.lib/.vc9.dll and I also use the vc version in the name of output intermediate directory Then check all the code for any use of #pragma comment(lib, libname) and make sure any preprocessor guards that select different versions have been updated to know about vc2010. On 26 August 2010 18:37, Anders Backman ande...@cs.umu.se wrote: Well, I have verified that ALL the dependencies Im using are all built with /MD and NOT debug. Im building all of the dependencies for osg and our lib myself, so I got full control. Also, as I wrote before, I have even tried to build our libs using project files generated from cmake vs2008, build with vs2008 - works ok. Open same project files in vs2010 - problem occurs. Im using buildscripts to build dependencies, and it all works for vs2008... No external libraries, everything is built from code. For VS2010, all the dependencies (including osg 2.8.3) builds/links fine. But for my libs, I get the linking errors. Allowing multiple symbols sounds dangerous, and it did not resolve my problem... /A On Thu, Aug 26, 2010 at 7:26 PM, Simon Hammett s.d.hamm...@googlemail.com wrote: On 26 August 2010 17:35, Anders Backman ande...@cs.umu.se wrote: snip CMake defaults to /MD code generation (MultiThreaded). Im using this consistently over all my libraries (just double checked to be sure). Never use that setting unless you know what you are doing. Change every project to Multi-threaded Debug DLL (/MDd) for Debug builds and Multi-threaded DLL (/MD) for Release builds And it will all start working. Those Runtime library settings are the number one 'gotch-ya' for Visual studio, and Cmake defaulting to them is daft. -- http://www.ssTk.co.uk ___ 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 -- http://www.ssTk.co.uk ___ 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
[osg-users] Does OSG function over VNC?
Hi, I am new to OSG so be gentle. Many of my users want to run their gui on a remote server through VNC, however, when I run the osgviewer cow.osg over vnc nothing gets rendered and I get lots of errors echoed to the terminal such as: Got an X11ErrorHandling call display=0x643b30 event=0x4084f7c0 GLXBadRenderRequest Major opcode: 148 Minor opcode: 1 Error code: 157 Request serial: 1620 Current serial: 1621 ResourceID: 44 Even the very simple example in the quick start guide fails to render. glxgears runs fine so I know I can get a glx context. Actually osgviewer glsl_simple.osg renders its shapes but gives the following errors: VERTEX glCompileShader FAILED FRAGMENT glCompileShader FAILED glLinkProgram FAILED FRAGMENT glCompileShader FAILED VERTEX glCompileShader FAILED glLinkProgram FAILED Is using OSG over VNC just a bad idea or is there some flag(s) I need to toggle to turn off some incompatible rendering feature? Thank you! Cheers, Harry -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31085#31085 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpengGLES build failed
Hi, me too, Android. I have a completely compiling OSG build for Android (as static library only). I have did some mods to OpenThreads (rough... ;-), the buildsystem here and there and added some guarded includes for Android. Even osgViewer seems to compile just fine (I use GraphicsWindowEmbedded as dummy implementation). What is missing now is the connection between Android-Java and OSG. I will explain first how GL-Setup and Rendering is done with Android. The first steps are always done with Java, as the native kit does not support EGL or any other window handling. It is just able to do raw openGL ES calls (what khronos headers provide). Well, in the Android-Java-Environment, a GLSurfaceView ist created, which creates an EGLContext. Then, a GLSurfaceView.Renderer is attached to this GLSurfaceView. The renderer is called in a thread-loop (in the JVM) and draws a single frame with each call. These calls can then call (via JNI) native implementations for drawing with a native openGL-lib. And thats what I need now, a way to manually request a drawing-operation for a scene. I would start with one scene first, and see how that could work. What I understand of osg is, that it provides always at least one thread to do all the work (Threading-Model Singlethreaded as simplest example). Here, I have to provide a way, to remove the actual drawing request (but still doing event handling seems fine) and offer some way for the JVM-Render-Thread to execute the rendering for a single frame (of the scene). I believe, the needed modifications can be done in osgViewer, but I don't really understand how osg starts to render a single frame, e.g. which class calls which class (especially which class is the root for starting off to render a frame). Okay, I will do some more rtfs, but perhaps someone can enlighten me and give me some hints on how to do it the best way. Cheers, Rutton -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31086#31086 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [forum] Rotation problem with Quaternions
Hi, I have the following situations. I get rotations in form of quaternions from a system, with a pre-defined coordinate system. These rotations are used to transform the view matrix later on. However, the difference of coordinate systems, conversion from quaternion to euler, matrix, etc. and the multiplication orders are giving me a headache. Bsaically what I have now is something like: Code: osg::Quat _orientation = ( osg::Matrix::rotate(_rawQuat) * osg::Matrix( 0.0, 0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) ).getRotate(); Here the second matrix basically should transform from local space to my world space. X axis represents yaw, Y pitch and Z roll. The orientation is pretty much correct... except the pitch is negated. (Up is down and down is up). So I figured, no problem. It's just a missing sign! ... if only reality was that simple. All my attempts to modify that second rotation matrix have failed. I end up creating Euler singularities or always exchange the wrong axes. This kind of made me lose my mind and perspective, because I think I no longer really understand what I'm doing. Can somebody help me understand this? Thank you! Cheers, Frank[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30954#30954 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpengGLES build failed
Hi Rutton, I'm not familiar with Andriod programming so can't help with the platform specifics, I'll try an make what suggests I can though. If you have a EGL context already then as you've picked up using osgViewer with GraphicsWindowEmbedded is the way forward. The osgviewerGLUT and osgviewerSDL examples illustrate how this can be done. As you will see from these examples a viewer.frame(); called when you want to render each new frame. This viewer.frame() method itself calls viewer.advance() to move the FrameStamp on one frame. The FrameStamp is used to synchronize all the updates and rendering so that all objects have the same reference and simulation time for that particular frame. Next the viewer.eventTraversal() is run which updates any CameraManipulator and EventHandler attached to the viewer. Next the viewer.updateTraversal() is called to animation any objects in the scene. Finally viewer.renderingTraversals() is called that coordinates the running of the cull and draw traversals. For your usage just calling viewer.frame() will probably be appropriate. Robert. On Thu, Aug 26, 2010 at 10:50 PM, Rutton Rankin rut...@web.de wrote: Hi, me too, Android. I have a completely compiling OSG build for Android (as static library only). I have did some mods to OpenThreads (rough... ;-), the buildsystem here and there and added some guarded includes for Android. Even osgViewer seems to compile just fine (I use GraphicsWindowEmbedded as dummy implementation). What is missing now is the connection between Android-Java and OSG. I will explain first how GL-Setup and Rendering is done with Android. The first steps are always done with Java, as the native kit does not support EGL or any other window handling. It is just able to do raw openGL ES calls (what khronos headers provide). Well, in the Android-Java-Environment, a GLSurfaceView ist created, which creates an EGLContext. Then, a GLSurfaceView.Renderer is attached to this GLSurfaceView. The renderer is called in a thread-loop (in the JVM) and draws a single frame with each call. These calls can then call (via JNI) native implementations for drawing with a native openGL-lib. And thats what I need now, a way to manually request a drawing-operation for a scene. I would start with one scene first, and see how that could work. What I understand of osg is, that it provides always at least one thread to do all the work (Threading-Model Singlethreaded as simplest example). Here, I have to provide a way, to remove the actual drawing request (but still doing event handling seems fine) and offer some way for the JVM-Render-Thread to execute the rendering for a single frame (of the scene). I believe, the needed modifications can be done in osgViewer, but I don't really understand how osg starts to render a single frame, e.g. which class calls which class (especially which class is the root for starting off to render a frame). Okay, I will do some more rtfs, but perhaps someone can enlighten me and give me some hints on how to do it the best way. Cheers, Rutton -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31086#31086 ___ 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] Does OSG function over VNC?
Hi Harry, VNC/GLX support is likely the problem rather than a specific problem with OSG. You say that glxgears works fine, and that running osgviewer glsl_simple.osg reports errors but in the end renders shapes. To me this suggests that the OSG has been able to create a graphics context, but the GL driver being just used simply doesn't support all the extensions. Does osgviewer glider.osg work OK? Robert. On Thu, Aug 26, 2010 at 10:42 PM, Harry Johnson harry_c_john...@yahoo.com wrote: Hi, I am new to OSG so be gentle. Many of my users want to run their gui on a remote server through VNC, however, when I run the osgviewer cow.osg over vnc nothing gets rendered and I get lots of errors echoed to the terminal such as: Got an X11ErrorHandling call display=0x643b30 event=0x4084f7c0 GLXBadRenderRequest Major opcode: 148 Minor opcode: 1 Error code: 157 Request serial: 1620 Current serial: 1621 ResourceID: 44 Even the very simple example in the quick start guide fails to render. glxgears runs fine so I know I can get a glx context. Actually osgviewer glsl_simple.osg renders its shapes but gives the following errors: VERTEX glCompileShader FAILED FRAGMENT glCompileShader FAILED glLinkProgram FAILED FRAGMENT glCompileShader FAILED VERTEX glCompileShader FAILED glLinkProgram FAILED Is using OSG over VNC just a bad idea or is there some flag(s) I need to toggle to turn off some incompatible rendering feature? Thank you! Cheers, Harry -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31085#31085 ___ 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] OpengGLES build failed
Hello folks, I will try that and report back my results on Android. I already read something after my post last night about osg::Viewer::frame somewhere. I love inheritance, it can make things really powerful. Thank you! Cheers, Rutton -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31093#31093 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to build OSG 2.9.8 for Emulator on linux
Hi List, I have built osg 2.9.8 on linux but i m not getting how to build as a emulator on linux. Thank you! Cheers, Parmar -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31094#31094 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to build OSG 2.9.8 for Emulator on linux
HI Paramar, On Fri, Aug 27, 2010 at 10:52 AM, Rakesh Parmar rakes...@kpitcummins.com wrote: I have built osg 2.9.8 on linux but i m not getting how to build as a emulator on linux. And what might you mean by emulator on linux as it really means nothing to me, I suspect others will also be rather clueless what you might mean. If you want effective support you need to specific about what you mean, you can't just wave you arms around and throw out meaningless words and expect others to know what's going on inside your head. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to build OSG 2.9.8 for Emulator on linux
Hi Roberts, I am really sorry for that. i would like to build OSG for OpenGL ES 2.0 but i dont have es 2.0 hardware. So i wanted to use es 2.0 emulator version of build .Before sending to forum i have searched on google but i didnt get it any info . i have read this link also. [url] http://www.openscenegraph.org/projects/osg/wiki/Community/OpenGL-ES [/url] but i am not getting how to do this. I have just started using OSG . So Please help me out. ... Thank you! Cheers, parmar -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31096#31096 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Rotation problem with Quaternions
Hi, don't try to make the rotation matrix manually, try using the makeRotate() function of the Matrixd class. It can take a vector to rotate about and an angle. Also, OSG has only one version (pre/post mult) of quat * vec and not the other. The conventions are also mixed up compared to matrices. see here: http://article.gmane.org/gmane.comp.graphics.openscenegraph.user/43425 So I'd suggest doing the multiplication and rotation using only matrices. It's OK to init a matrix from a quat. Make a simple test case for yourself to understand the order of operations (e.g. m1*m2*v versus v*m2*m1). cheers jp On 20/08/10 10:28, Frankie Avalon wrote: Hi, I have the following situations. I get rotations in form of quaternions from a system, with a pre-defined coordinate system. These rotations are used to transform the view matrix later on. However, the difference of coordinate systems, conversion from quaternion to euler, matrix, etc. and the multiplication orders are giving me a headache. Bsaically what I have now is something like: Code: osg::Quat _orientation = ( osg::Matrix::rotate(_rawQuat) * osg::Matrix( 0.0, 0.0, -1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) ).getRotate(); Here the second matrix basically should transform from local space to my world space. X axis represents yaw, Y pitch and Z roll. The orientation is pretty much correct... except the pitch is negated. (Up is down and down is up). So I figured, no problem. It's just a missing sign! ... if only reality was that simple. All my attempts to modify that second rotation matrix have failed. I end up creating Euler singularities or always exchange the wrong axes. This kind of made me lose my mind and perspective, because I think I no longer really understand what I'm doing. Can somebody help me understand this? Thank you! Cheers, Frank[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30954#30954 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to build OSG 2.9.8 for Emulator on linux
Hi Parmar, The settings for CMake are on the wiki page I specified. You'll need to download the GLES emulator libraries as well of course. The ones I used for Linux were from Imagination Technologies Ltd. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] backface and picking
self reply :) I have now good results using world coordinates, doing this : Code: osg::Vec3 n = hitr-getWorldIntersectNormal(); osg::Vec3 eye = window-osgViewer-getCamera()-getInverseViewMatrix().getTrans(); osg::Vec3 inter = hitr-getWorldIntersectPoint(); n.normalize(); osg::Vec3 eyeVec = inter-eye; eyeVec.normalize(); if (eyeVec*n0) { //here we are in front face case } But now, to close this subject, I just would like to understand why I have wrong results using local coordinates as in my previous post... if someone see where is the mistake... Eric -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31099#31099 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] restrict rotation of TrackballManipulator
Hi all, I am sorry to ask again, but I am just wondering why no one replied... Did I ask (a) wrong or frequently answered question(s)? Did I ask (a) question(s), that is/are answered somewhere else? (If yes, I would appreciate a pointer to that place, Google didn't help me...) Maybe did I ask in a wrong way? I am new to this list and a OSG newbie... With best regards, O. Baum 2010/8/25 O. Baum ol...@freenet.de: Hallo list, can anyone tell me how to restrict the rotation of the TrackballManipulator e.g. to the z-Axis (Yaw)? Another question: How can I prevent the TrackballManipulator from zooming and panning? Is there another way than deriving an own class from TrackballManipulator and overwriting the calcMovement() method? Thank you very much in advance for your replies! With best regards, -oli- ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] restrict rotation of TrackballManipulator
Hi Olli, unfortunately I can't help you. I'm myself strugglich around with trackball manipulator. This class is missing a lot of functionality for external influence. There is no interface to: - initiate rotation of trackbal easily by some external methods (was also no response on the list) - stop throw status by method Unfortunately I'm not good enough in Matrix operations to understand how to do this by the given get-/setMatrix calls. So far I failed doing it as desired. Reading the source code of trackball manipulator didn't help me. - Werner - On Friday 27 August 2010 14:56:55 O. Baum wrote: Hi all, I am sorry to ask again, but I am just wondering why no one replied... Did I ask (a) wrong or frequently answered question(s)? Did I ask (a) question(s), that is/are answered somewhere else? (If yes, I would appreciate a pointer to that place, Google didn't help me...) Maybe did I ask in a wrong way? I am new to this list and a OSG newbie... With best regards, O. Baum 2010/8/25 O. Baum ol...@freenet.de: Hallo list, can anyone tell me how to restrict the rotation of the TrackballManipulator e.g. to the z-Axis (Yaw)? Another question: How can I prevent the TrackballManipulator from zooming and panning? Is there another way than deriving an own class from TrackballManipulator and overwriting the calcMovement() method? Thank you very much in advance for your replies! With best regards, -oli- ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- TEXION Software Solutions TEXION GmbH - Rotter Bruch 26a - D 52068 Aachen - HRB 14999 Aachen Fon: +49 241 475757-0, Fax: +49 241 475757-29, web: http://www.texion.eu Geschäftsführer/Managing Director: Werner Modenbach ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] backface and picking
Hi Eric, On Fri, Aug 27, 2010 at 1:23 PM, Eric Pouliquen eric.pouliq...@gmail.com wrote: But now, to close this subject, I just would like to understand why I have wrong results using local coordinates as in my previous post... if someone see where is the mistake... If you have any transforms in your scene graph the local coordinates will be in a different coordinate frame to the eye point so it's not at all surprising that you'd get the wrong results. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] restrict rotation of TrackballManipulator
Hi Oli, In the svn/trunk version of the OSG the CameraManipulator classes have been revamped and included extra controls for how the manipulators handle events and map them to movement. Robert. On Wed, Aug 25, 2010 at 2:30 PM, O. Baum ol...@freenet.de wrote: Hallo list, can anyone tell me how to restrict the rotation of the TrackballManipulator e.g. to the z-Axis (Yaw)? Another question: How can I prevent the TrackballManipulator from zooming and panning? Is there another way than deriving an own class from TrackballManipulator and overwriting the calcMovement() method? Thank you very much in advance for your replies! With best regards, -oli- ___ 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] How to build OSG 2.9.8 for Emulator on linux
Hi Robert, Thanks for your reply. I have seen CMakeLists.txt ,here we have to change according to the link you have given to me , Code: OPTION(OSG_GL2_AVAILABLE Set to OFF to disable use of OpenGL 2.x functions library. ON) or some where else. I am not getting it. PLease guide me how to run es 2.0 example using OSG. If you provide any link or sample it will be great. PLease help me out. Thank you! Cheers, Rakesh -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31104#31104 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Rotate camera around the scene in osgViewer - simple way?
Hi, Is there a simple way to programmatically set rotation of a model in osgViewer? [code]myViewer-setSceneData(fancyObject); myViewer-run();[/code] After this code, the object is displayed statically in the window. To get it to rotate, the user must click and pull the object in the desired direction. What I am looking for is something like this: [code]myViewer-setSceneData(fancyObject); myViewer-cameraManipulator-rotate(angle, speed); myViewer-run();[/code] Is there such a thing, and if not what is the next-best? Thank you! Cheers, Dženan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31105#31105 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG using OpenGL ES 2.0 on IPhone
Ok, to keep this up to date, I managed to render a textured model using OpenGL ES 2.0 on the IPhone. But I am not sure whether this is the way to go... Vertex Shader: Code: varying highp vec2 tex_coord0; varying highp vec3 normal; varying highp vec4 position; void main(void) { tex_coord0 = gl_MultiTexCoord0.xy; normal = gl_Normal; position = gl_Vertex; gl_Position = gl_ModelViewProjectionMatrix * position; } Fragment Shader: Code: varying highp vec2 tex_coord0; varying highp vec3 normal; varying highp vec4 position; uniform sampler2D tex0; uniform highp vec4 light_pos; void main(void) { gl_FragColor = texture2D(tex0, tex_coord0) * (max(dot(normal, vec3(light_pos - position)) * 0.7, 0.3)); } I attach those shaders to the node containing the model: Code: osg::Program* program = new osg::Program; program-setName(shader2); program-addShader(new osg::Shader(osg::Shader::VERTEX, vertSource)); program-addShader(new osg::Shader(osg::Shader::FRAGMENT, fragSource)); model-getOrCreateStateSet()-setAttributeAndModes(program, osg::StateAttribute::ON); Using this code I get a textured model with some basic shading. But is this really the way to go? It feels so manual. But what ShaderGen does for OpenGL ES 2.0 does not work at all (does not compile due to usage of undefined variable names). Any hints or suggestions are very welcome! Furthermore I get tons of messages like: Code: Warning: detected OpenGL error GL_INVALID_ENUM after applying GLMode 0xba1 Warning: Material::apply(State) - not supported. Warning: detected OpenGL error GL_INVALID_ENUM after applying GLMode 0xde1 Warning: detected OpenGL error GL_INVALID_ENUM after applying GLMode 0xb50 Those modes correspond to GL_NORMALIZE, GL_TEXTURE_2D and GL_LIGHTING. Why does OSG still use them even it is compiled in OpenGL ES 2.0 mode? Am I doing something wrong? Or is it just work in progress? Thanks in advance, rti -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31107#31107 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] backface and picking
Hi Robert, thanks for your answer. I completely understand what you mean, but I've read in the doc about getEyePoint : Get the eye point in the local coordinate frame a given traversal point. So I don't understand in which coordinate frame these local coords are given in my sample code... Eric -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31109#31109 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] Problems with resizing
Hi there, I rise again this pretty old thread to add a detail: the aspect ratio of the camera is not automatically corrected when resizing the viewport. Is this operation left to users on purpose to be more generic? If you think it might be useful to integrate it in the resizeViewport method - maybe with an optional flag? - it is as simple as adding a call like: camera-setProjectionMatrixAsPerspective(fovy, ar, zNear, zFar); with the new AR, within the resizeViewport() method. I tested on my side and works as expected. Cheers, ricky On Tue, Apr 20, 2010 at 15:56, Art Tevs arti_t...@yahoo.de wrote: Hi folks, so, I just realized that the solution I posted yesterday is the same as was proposed by Mick. I just implemented another solution for proper resizing. You can find it in the svn. With the current implementation resizing works like a charm with almost any example (motionblur still make some small issues). Take a look into the viewer or HDR or DoF example, all of them works. There were several issues, I had to correct. One of them was to force to call osg::Texture::dirtyTextureObject() after resizing. In osg code if you call setTextureSize, then nothing else happens :( With this change it works better. Additionaly I put the solution as proposed by Mick and changed the size of every texture of the camera. Just take a look into examples. I will go for a release of osgPPU v0.6 (for osg 2.8.3) in the next days, I think. I hope now, the problem can be seen as solved to 95% :) Cheers, Art -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=27014#27014 ___ 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] OSG using OpenGL ES 2.0 on IPhone
Hi rti, How you have compiled and build for es 2.0 . Please explain to me i also want to build for es 2.0 using emulator. ... Thank you! Cheers, parmar -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=3#3 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Does OSG function over VNC?
Hi Robert, Yeah, I understand that the issue is with limited GLX support in the VNC server. However, seeing the glsl_simple.osg actually render, albeit with errors, makes me wonder if there isn't some switch to OSG that would result in it using a 'dumbed down' set of glx features with the understanding that performance/appearance will likely suffer. osgviewer glider.osg does not work. :( It also results in the GLXBadRenderRequest messages. I tried to include the glxinfo output for the VNC server in this post but the forums tell me I have to have 2 posts before I can post a URL... I guess it thinks some of the glxinfo output is actually a URL of some sort. Thank you! Cheers, Harry -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31112#31112 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Does OSG function over VNC?
Hi Harry, Have a look at TurboVNC: http://www.virtualgl.org/Downloads/TurboVNC http://www.virtualgl.org/Downloads/TurboVNCsean _ Sean Spicer Aqumin (www.aqumin.com) Office+1.713.781.2121 Mobile...+1.713.447.2706 Fax...+1.713.781.2123 On Fri, Aug 27, 2010 at 2:08 PM, Harry Johnson harry_c_john...@yahoo.comwrote: Hi Robert, Yeah, I understand that the issue is with limited GLX support in the VNC server. However, seeing the glsl_simple.osg actually render, albeit with errors, makes me wonder if there isn't some switch to OSG that would result in it using a 'dumbed down' set of glx features with the understanding that performance/appearance will likely suffer. osgviewer glider.osg does not work. :( It also results in the GLXBadRenderRequest messages. I tried to include the glxinfo output for the VNC server in this post but the forums tell me I have to have 2 posts before I can post a URL... I guess it thinks some of the glxinfo output is actually a URL of some sort. Thank you! Cheers, Harry -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31112#31112 ___ 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] Rotate camera around the scene in osgViewer - simple way?
Something quick and easy would be to calculate a new position for your camera on each frame and set the view matrix as part of a frame() loop. while(!myViewer-done()) { myViewer-getCamera()-setViewMatrix(whatever it should be this frame); myViewer-frame(); } Cheers, Tom -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31114#31114 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] backface and picking
Eric Pouliquen wrote: Hi Robert, thanks for your answer. I completely understand what you mean, but I've read in the doc about getEyePoint : Get the eye point in the local coordinate frame a given traversal point. So I don't understand in which coordinate frame these local coords are given in my sample code... For example, you have a box in the scene. The box is modeled in it's own local coordinate system (probably centered at (0,0,0). When the box is placed somewhere in the scene, though, it probably would have a transform node above it, placing it, for example, at (100, 100, 0). When your intersector hits it, if you just call getEyePoint(), you'll get a point somewhere near (0,0,0), because that is the box's local coordinate system. You need to apply the inverse view matrix to the point to get it in the world coordinate system. Make sense? --J ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] ANN: osgEarth 1.4 Available
Hi all, Cross posting this with the osgEarth forum. We've just tagged the osgEarth 1.4 release, you can get the latest code from SVN at: http://svn.osgearth.org/tags/osgearth_1.4_T2010-08-27/ You can also grab tarballs from: http://wush.net/websvn/osgearth/listing.php?repname=osgearthpath=%2Ftags%2F Go to http://osgearth.org for download instructions and documentation. Highlights of the osgEarth 1.4 release: Major features: * osgEarthDrivers API - Every osgEarth driver now has its own header-only API for configuring and loading layer types programmatically. * osgEarthSymbology - A new library for creating, manipulating, and symbolizing vector geometry. * Controls Toolkit - This osgEarthUtil namespace is a lightweight 2D UI toolkit for rendering HUDs, popups and text overlays. * Unlimited Image Layers - The new composite layering technique lets you add a virtually unlimited number of image layers to your map without multi-pass rendering. * Layer Opacity Control - New global uniforms let you control the relative opacity of each layer at runtime. * Rasterizing Feature Driver - The new agglite driver rasterizes vector data into image tiles and overlays them on the map. This driver uses the lite version of the AGG rendering * Inline Geometry - You can now specify inline geometry in a .earth file (instead of loading it from a file) using the OGC-WKT geometry notation. * Vertical Datums - Properly display EGM96 (MSL) data such as DTED using the new vdatum support * Blacklisting - TileSources? now blacklist tiles that have been requested and couldn't be retrieved so they aren't requested again, avoiding hammering servers with bad requests. * Data Extents - TileSources? report where they actually have data so that osgEarth doesn't make unnecessary requests to them. Useful when you have a server with many inset areas. Other new features: * AutoClipPlaneHandler - automatically optimize your clip planes based on distance to the horizon * SQLite caching - new sqlite cache type stores tiles in a sqlite db. * NASA WorldWind elevation reader * Graticule - lat/long lines (geocentric only - beta code) * OceanSurfaceNode - simple animated ocean geometry * WMS-T - preliminary support for time-animated layers * HTTP authentication support * Mask layers * UnifiedCubeProfile - for ingesting cube/quadsphere data sources * Triangulating Interpolator - new elevation interpolator for sim correlation support * Units - new class for converting linear and angular units Noteworthy fixes: * Better mime-type support in HTTPClient * Frame coherency for EarthManipulator tethering * Better memory management in sequential/preemptive modes * Better proxy support * Custom read/write mutex fixes some rare deadlock issues * Better vector rendering in some drivers * Avoiding making repeat requests for tiles that could not be retrieved in the database pager. Thanks for your support! Jason ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Rotate camera around the scene in osgViewer - simple way?
Hi, Well I was sort of hoping I could get away without constructing camera matrix, as it involves a bit of computation. If there is no quick and easy way to do it, I will just have to skip it (it is not that important for my project, as it is for debugging purposes). Thank you! Cheers, Dženan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31117#31117 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Bones Animation
Thanks Bob, thanks Jason! I'm already studying the animation exemples. Paul, my project will be a virtual painting atelier. It will have the virtual hand, a canvas and some cascate paint fluid simulated in Physx. I also need each finger's bounding box, or sphere, or any better approach to do the colision with fluid particles. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31118#31118 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Does OSG function over VNC?
Hi Sean, I did try turboVNC but it did not even provide a glx context. I had not also installed virtualgl however which may have solved the problem. The issue is that I cannot require my users to all have installed virtualgl and turbovnc. I am coding to a fairly vanilla debian install. So I take it there are not any switches or settings to allow me to turn off the less supported glx calls? Thank you! Cheers, Harry -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31119#31119 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Rotation problem with Quaternions
Hi, I have finally identified where to solve this problems. I just needed to swap/negate the axes of the quaternion (and conjugate the quaternion accordingly) I construct. After that I just used osg::Matrix::makeRotate(osg::Vec3 from, osg::Vec3 to) - which is easier to use to rotate by 90 degrees than axis angles (which is the variant you suggested) Thank you anyway :) Cheers, Frankie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=31120#31120 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org