[osg-users] Attach light to camera
Hi all I struggle to add a light to my viewer. I have the sky light illuminating the scene (light 0). Now I want to add a spotlight to illuminate the area right in front of my camera for night scenarios. I tried to attach the light to the scene and position it in a cull visitor in front of the viewer... but is there no way to attach the light directly to the camera node so that it is moved along with the camera? Anybody can give me some example code? Regards Daniel ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Streaming world and integer limits
I'm saying about position of a node. If I model earth (for example) then the camera (for example) or another node will move from southern pole (0, 0) to equator (0, MAX_INT) and then it will move again to southern pole though it increments its position (not decrements), due to integer overflow (MAX_INT + inc_pos = inc_pos). Again, if I have a node with position (200, 200) and a child node with position (MAX_INT, MAX_INT) the result position of the child's node will be MAX_INT + 200, MAX_INT + 200. That means integer overflow again. These two cases are not clear for me. Sorry, if I've expressed myself not so clearly. Thanks for your answers. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50875#50875 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] HELP~OSG forAndroid crashed~~~
Jan Ciger wrote: Hello Houhouh (sorry if that isn't your name, but you didn't provide one ...), You haven't provided the ABI you have compiled for, but seeing that your device has Tegra 2 SoC, I suspect that the crash comes from the lack of support for the Neon instructions on it. These are similar to the SSE instructions on x86, unfortunately they are an optional part of the ARM specification, so not all vendors implement them. Nvidia chose not to and thus Tegra 2 doesn't have them :( (however, the newer Tegra 3 does, go figure ...) You can solve this either by switching to the v5 ABI (armeabi instead of armeabi-v7a in your Application.mk file) that doesn't use Neon or by disabling Neon instructions and recompiling OSG again. I believe this is actually documented in the Android part of the website too. Regards, Jan -- Post generated by Mail2Forum Hello,Jan i am sorry that didnot say it clear : Android NDK: Building application 'local' for ABI 'armeabi' Android NDK: Using target toolchain 'arm-linux-androideabi-4.4.3' for 'armeabi' ABI i have compiled for ABI 'armeabi'. i followed the cookbook and commented LOCAL_ARM_NEON := true in PlatformSpecifics\Android\Android.mk.modules.in and commented armeabi-v7aalso in .mk file both in cmake build folder or osgAndroidExampleGLES1/jni/ Application.mk So,did i disable the Neon instructions clean? i used cygwin to build the whole work,and i used CMAKE commond as shows follow and NDK version is r7: cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DOSG_GL_MATRICES_AVAILABLE=ON -DOSG_GL_VERTEX_FUNCS_AVAILABLE=ON -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=ON -DOSG_GL_FIXED_FUNCTION_AVAILABLE=ON -DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF -DOSG_GL1_AVAILABLE=OFF -DOSG_GL2_AVAILABLE=OFF -DOSG_GL3_AVAILABLE=OFF -DOSG_GLES1_AVAILABLE=ON -DOSG_GLES2_AVAILABLE=OFF -DJ=4 -DANDROID_NDK=$NDK -DANDROID_STL=gnustl_static -DCMAKE_INSTALL_PREFIX=/cygdrive/c/cygwin/usr/local/osgNOneon Now,the statuation is that the apk can run normally,NOT crashed at once.Then , it will crash anytime.The apk is unstatble for use. i was disturbed by this bug for a month , thank you very much! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50827#50827 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OpenSceneGraph for Beginners tutorial help requested
Hi, I've been working with the OSG Beginners book. I am trying to get the first program to run but I continually get a bad alloc error: Code: Microsoft C++ exception: std::bad_alloc at memory location 0x00a1d4f0.. The break point is: Code: inline osg::Node* readNodeFile(const std::string filename) { return readNodeFile(filename,Registry::instance()-getOptions()); } And the following is my code: Code: #include osgDB/ReadFile #include osgViewer/Viewer int main( int argc, char** argv ) { osg::ref_ptrosg::Node root = osgDB::readNodeFile(c:\\osg\\data\\cessna.osg); osgViewer::Viewer viewer; viewer.setSceneData( root.get() ); return viewer.run(); } Any hints would be fantastic. Thank you! Cheers, Seth -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50843#50843 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] How to make the RotateCylinderDragger object rotate around a specified point in the space rather than its own center?
Hi, I am trying to use the osgManipulator::RotateCylinderDragger in the OSG example code for my project. However, I need to have it rotate around a predefined point in the space rather than its own center. Does anybody know how to do that? ... Thank you! Cheers, Zhou -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50765#50765 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [forum] Problem when nesting osgFX::Outline effects
Hi, Thanks for your reply. I have two use cases: 1) In my application, I am using outline fx to render red outlines around selected objects. I am also using outline fx to render dark edges around some basic geometries (like CAD application, SolidWorks) for a better look. For example: - Sphere = outline - Cylinder = outline + 2 circles (bottom and top). - Capsule = outline + 2 circles (bottom and top). 2) In the same application, I am also using outline fx when I mouse hover a node. The problem occurs when one of the hovered node's ancestors or descendants is also outlined (selected or in Edges Rendered mode). Could you, please, explain me your idea a bit further, Maybe you could use nodemasks to ensure the child is not drawn with the FX when the parent is active?? Thank you! Regards, celandre -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50696#50696 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Streaming world and integer limits
Hi Where did you found anything about node positions being stored as integers in OSG? Nodes are positioned with osg::Transform derived classes which use floating point (single or double precision, depending on build configuration) matrices\vectors\quaternions for transformations. Cheers. 30.10.2012, 12:17, Dmitry K. zzfi...@hotbox.ru: I'm saying about position of a node. If I model earth (for example) then the camera (for example) or another node will move from southern pole (0, 0) to equator (0, MAX_INT) and then it will move again to southern pole though it increments its position (not decrements), due to integer overflow (MAX_INT + inc_pos = inc_pos). Again, if I have a node with position (200, 200) and a child node with position (MAX_INT, MAX_INT) the result position of the child's node will be MAX_INT + 200, MAX_INT + 200. That means integer overflow again. These two cases are not clear for me. Sorry, if I've expressed myself not so clearly. Thanks for your answers. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50875#50875 ___ 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] [osgPlugins] DDS Texture vanish with LINEAR_MIPMAP_LINEAR
Hi, I have a terrain model with 1024x1024 DXT1 textures. Using a min filter with LINEAR_MIPMAP_LINEAR the textures are gone, changing only this filter to LINEAR everything is back again. The textures contain 1 main image and 10 mipmaps... Any ideas? Thanks Cheers, Tim. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50877#50877 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] HELP~OSG forAndroid crashed~~~
Hello, On Mon, Oct 29, 2012 at 2:39 AM, wang xinyu houh...@163.com wrote: Hello,Jan i am sorry that didnot say it clear : Android NDK: Building application 'local' for ABI 'armeabi' Android NDK: Using target toolchain 'arm-linux-androideabi-4.4.3' for 'armeabi' ABI OK, that should be all right. i have compiled for ABI 'armeabi'. i followed the cookbook and commented LOCAL_ARM_NEON := true in PlatformSpecifics\Android\Android.mk.modules.inand commented armeabi-v7aalso in .mk file both in cmake build folder or osgAndroidExampleGLES1/jni/ Application.mk So,did i disable the Neon instructions clean? Actually, if you are compiling only for armeabi, you didn't have to disable Neon because armeabi doesn't support those instructions anyway. Only armeabi-v7a can use them. i used cygwin to build the whole work,and i used CMAKE commond as shows follow and NDK version is r7: cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF -DDYNAMIC_OPENSCENEGRAPH=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DOSG_GL_MATRICES_AVAILABLE=ON -DOSG_GL_VERTEX_FUNCS_AVAILABLE=ON -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=ON -DOSG_GL_FIXED_FUNCTION_AVAILABLE=ON -DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF -DOSG_GL1_AVAILABLE=OFF -DOSG_GL2_AVAILABLE=OFF -DOSG_GL3_AVAILABLE=OFF -DOSG_GLES1_AVAILABLE=ON -DOSG_GLES2_AVAILABLE=OFF -DJ=4 -DANDROID_NDK=$NDK -DANDROID_STL=gnustl_static -DCMAKE_INSTALL_PREFIX=/cygdrive/c/cygwin/usr/local/osgNOneon Looks good to me. Now,the statuation is that the apk can run normally,NOT crashed at once.Then , it will crash anytime.The apk is unstatble for use. Well, that can be a different issue. If the app starts and loads a model, then you have resolved the ABI/Neon issues. For me it started up and crashed the moment I touched the screen if the Neon was enabled on the Tegra 2 tablet I have here (Acer Iconia 500). Once Neon was off and everything recompiled, it works fine and stable. I would suggest updating your NDK too, the latest is r8b. They often fix really showstopper bugs, so if you are getting crashes with an unmodified OSG example, that could help you. i was disturbed by this bug for a month , thank you very much! You are welcome. Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Streaming world and integer limits
OK, thanks, looks like I need to read more about OpenSceneGraph before asking such questions. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50881#50881 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] DDS Texture vanish with LINEAR_MIPMAP_LINEAR
Hi it seems like osg dds plugin cant (correctly) read your mipmaps from dds file. You can use file without mipmaps or try to dive in and find exact reason for this behaviour. Cheers. 30.10.2012, 14:19, Tim Rambau tim.ram...@dlr.de: Hi, I have a terrain model with 1024x1024 DXT1 textures. Using a min filter with LINEAR_MIPMAP_LINEAR the textures are gone, changing only this filter to LINEAR everything is back again. The textures contain 1 main image and 10 mipmaps... Any ideas? Thanks Cheers, Tim. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50877#50877 ___ 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] OpenSceneGraph for Beginners tutorial help requested
Hey, I've encountered the same problem some time ago. The problem was the macro in the CMakeLists.txt. On my system it hast to be _INCLUDE_DIRS and _LIBRARIES. Try this osg-cmake project setup: cmake_minimum_required(VERSION 2.8) project(MyProject) set(target MyProject) find_package(OpenSceneGraph REQUIRED osgAnimation osgDB osgGA osgText osgUtil osgViewer osgShadow osgParticle ) set(sources src/main.cpp ) include_directories( ${OPENSCENEGRAPH_INCLUDE_DIRS} ) add_executable(${target} ${sources}) target_link_libraries(${target} ${OSG_LIBRARIES} ${OSGANIMATION_LIBRARIES} ${OSGDB_LIBRARIES} ${OSGGA_LIBRARIES} ${OSGTEXT_LIBRARIES} ${OSGUTIL_LIBRARIES} ${OSGVIEWER_LIBRARIES} ${OPENTHREADS_LIBRARIES} ${OSGSHADOW_LIBRARIES} ${OSGPARTICLE_LIBRARIES} ) Also if you built osg from source and ran the install target, make sure your OSG_DIR env variable point to your install directory specified in the cmake-gui (e.g. c:/lib/osg/install), otherwise cmake could include the wrong header files. Hope this helps. Von: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] im Auftrag von Seth Hays [hays@gmail.com] Gesendet: Montag, 29. Oktober 2012 02:47 An: osg-users@lists.openscenegraph.org Betreff: [osg-users] OpenSceneGraph for Beginners tutorial help requested Hi, I've been working with the OSG Beginners book. I am trying to get the first program to run but I continually get a bad alloc error: Code: Microsoft C++ exception: std::bad_alloc at memory location 0x00a1d4f0.. The break point is: Code: inline osg::Node* readNodeFile(const std::string filename) { return readNodeFile(filename,Registry::instance()-getOptions()); } And the following is my code: Code: #include osgDB/ReadFile #include osgViewer/Viewer int main( int argc, char** argv ) { osg::ref_ptrosg::Node root = osgDB::readNodeFile(c:\\osg\\data\\cessna.osg); osgViewer::Viewer viewer; viewer.setSceneData( root.get() ); return viewer.run(); } Any hints would be fantastic. Thank you! Cheers, Seth -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50843#50843 ___ 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] Compilation error using ffmpeg
Hi all !!! I m trying to compile OSG 3.0.0 in ubuntu 64bits I m trying using ffmpeg with many versions but the error persist : In file included from /usr/local/include/libavutil/avutil.h:327:0, from /usr/local/include/libavutil/samplefmt.h:22, from /usr/local/include/libavcodec/avcodec.h:30, from /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp:12, from /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegClocks.hpp:10, from /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp:9, from /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:1: /usr/local/include/libavutil/common.h: In function ‘int32_t av_clipl_int32_c(int64_t)’: /usr/local/include/libavutil/common.h:170:47: error: ‘UINT64_C’ was not declared in this scope In file included from /dados/arq/OSG/OpenSceneGraph-3.0.0/include/osg/FrameStamp:22:0, from /dados/arq/OSG/OpenSceneGraph-3.0.0/include/osg/BufferObject:20, from /dados/arq/OSG/OpenSceneGraph-3.0.0/include/osg/Image:17, from /dados/arq/OSG/OpenSceneGraph-3.0.0/include/osg/AudioStream:17, from /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.hpp:12, from /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:1: /usr/include/c++/4.7/ctime: At global scope: /usr/include/c++/4.7/ctime:62:11: error: ‘::clock_t’ has not been declared /usr/include/c++/4.7/ctime:63:11: error: ‘::time_t’ has not been declared /usr/include/c++/4.7/ctime:66:11: error: ‘::clock’ has not been declared /usr/include/c++/4.7/ctime:67:11: error: ‘::difftime’ has not been declared /usr/include/c++/4.7/ctime:68:11: error: ‘::mktime’ has not been declared /usr/include/c++/4.7/ctime:69:11: error: ‘::time’ has not been declared /usr/include/c++/4.7/ctime:70:11: error: ‘::asctime’ has not been declared /usr/include/c++/4.7/ctime:71:11: error: ‘::ctime’ has not been declared /usr/include/c++/4.7/ctime:72:11: error: ‘::gmtime’ has not been declared /usr/include/c++/4.7/ctime:73:11: error: ‘::localtime’ has not been declared /usr/include/c++/4.7/ctime:74:11: error: ‘::strftime’ has not been declared /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp: In function ‘int osgFFmpeg::decode_audio(AVCodecContext*, int16_t*, int*, const uint8_t*, int)’: /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:28:12: warning: ‘int avcodec_decode_audio3(AVCodecContext*, int16_t*, int*, AVPacket*)’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4188) [-Wdeprecated-declarations] /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:28:72: warning: ‘int avcodec_decode_audio3(AVCodecContext*, int16_t*, int*, AVPacket*)’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4188) [-Wdeprecated-declarations] /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp: In member function ‘void osgFFmpeg::FFmpegDecoderAudio::open(AVStream*)’: /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:92:13: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4102) [-Wdeprecated-declarations] /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:92:44: warning: ‘int avcodec_open(AVCodecContext*, AVCodec*)’ is deprecated (declared at /usr/local/include/libavcodec/avcodec.h:4102) [-Wdeprecated-declarations] /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp: In member function ‘size_t osgFFmpeg::FFmpegDecoderAudio::decodeFrame(void*, size_t)’: /dados/arq/OSG/OpenSceneGraph-3.0.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:341:48: error: ‘INT64_C’ was not declared in this scope make[2]: *** [src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoderAudio.o] Error 1 make[1]: *** [src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/all] Error 2 make: *** [all] Error 2 Any idea of what can I do ? THank you! -- ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] screen capture with Qt
Hi Gianni, I'm afraid I personally don't have the time available to chase up the problem in your code. Perhaps others will be able. Robert. On 29 October 2012 17:11, Gianni Ambrosio ga...@vi-grade.com wrote: Thank you Robert for the fast reply. In the meanwhile I'm attaching the code. Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50868#50868 Attachments: http://forum.openscenegraph.org//files/scenecaptureqt_189.cpp ___ 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] Attach light to camera
Hi David, On 30 October 2012 08:17, Daniel Schmid daniel.sch...@swiss-simtec.ch wrote: I struggle to add a light to my viewer. I have the sky light illuminating the scene (light 0). Now I want to add a spotlight to illuminate the area right in front of my camera for night scenarios. I tried to attach the light to the scene and position it in a cull visitor in front of the viewer… but is there no way to attach the light directly to the camera node so that it is moved along with the camera? Anybody can give me some example code? osg::View has settings for the light position - either a sky light in world coords, or a headlight in eye coords. Have a look a include/osg/View. osgViewer::Viewer inherits from osg::View (via osgViewer::View) so you'll get all these methods. The other alternative is to use an osg::LightSource placed in the scene graph as set the ReferenceFrame to ABSOLUTE_RF. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] DDS Texture vanish with LINEAR_MIPMAP_LINEAR
Hi Tim, Try running your app on a system with a difference graphics card/driver, there is a change the issue is a driver bug. Robert. On 30 October 2012 09:18, Tim Rambau tim.ram...@dlr.de wrote: Hi, I have a terrain model with 1024x1024 DXT1 textures. Using a min filter with LINEAR_MIPMAP_LINEAR the textures are gone, changing only this filter to LINEAR everything is back again. The textures contain 1 main image and 10 mipmaps... Any ideas? Thanks Cheers, Tim. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50877#50877 ___ 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] Just more 3D primitives
On 10/30/2012 5:05 AM, Christian Buchner wrote: Hi, for rendering a sphere (or any other round shapes) it might even be better to use a shader, instead of trying to tesselate the shape into a complex geometry consisting of a lot of triangles or quads. One issue with this approach, as well as the ShapeDrawable approach, is that most existing code that operates on Drawables is designed to work with osg::Geometry. If you export your scene to some format other than OSG-native (3ds, obj, flt, etc), such shader-based geometry will likely be ignored by the exporter. Just something to keep in mind. -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] DDS Texture vanish withLINEAR_MIPMAP_LINEAR
I've seen that kind of problems on AMD/ATI boards. Luc De : Robert Osfield robert.osfi...@gmail.com A : osg-users@lists.openscenegraph.org Date: 30/10/2012 15:27 Objet : Re: [osg-users] [osgPlugins] DDS Texture vanish with LINEAR_MIPMAP_LINEAR Envoyé par : osg-users-boun...@lists.openscenegraph.org Hi Tim, Try running your app on a system with a difference graphics card/driver, there is a change the issue is a driver bug. Robert. On 30 October 2012 09:18, Tim Rambau tim.ram...@dlr.de wrote: Hi, I have a terrain model with 1024x1024 DXT1 textures. Using a min filter with LINEAR_MIPMAP_LINEAR the textures are gone, changing only this filter to LINEAR everything is back again. The textures contain 1 main image and 10 mipmaps... Any ideas? Thanks Cheers, Tim. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50877#50877 ___ 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 mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Streaming world and integer limits
If you're modeling on the earth, you should be using double precision for your camera position... -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Dmitry K. Sent: Tuesday, October 30, 2012 2:16 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Streaming world and integer limits I'm saying about position of a node. If I model earth (for example) then the camera (for example) or another node will move from southern pole (0, 0) to equator (0, MAX_INT) and then it will move again to southern pole though it increments its position (not decrements), due to integer overflow (MAX_INT + inc_pos = inc_pos). Again, if I have a node with position (200, 200) and a child node with position (MAX_INT, MAX_INT) the result position of the child's node will be MAX_INT + 200, MAX_INT + 200. That means integer overflow again. These two cases are not clear for me. Sorry, if I've expressed myself not so clearly. Thanks for your answers. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50875#50875 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph for Beginners tutorial help requested
Another thing to check is make sure you're not mixing debug version of OSG with a release version of your app and vice versa. They must be the same. I've had readNodeFile() fail as below when I accidently linked my release built app with debug OSG... -Shayne -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Seth Hays Sent: Sunday, October 28, 2012 7:48 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] OpenSceneGraph for Beginners tutorial help requested Hi, I've been working with the OSG Beginners book. I am trying to get the first program to run but I continually get a bad alloc error: Code: Microsoft C++ exception: std::bad_alloc at memory location 0x00a1d4f0.. The break point is: Code: inline osg::Node* readNodeFile(const std::string filename) { return readNodeFile(filename,Registry::instance()-getOptions()); } And the following is my code: Code: #include osgDB/ReadFile #include osgViewer/Viewer int main( int argc, char** argv ) { osg::ref_ptrosg::Node root = osgDB::readNodeFile(c:\\osg\\data\\cessna.osg); osgViewer::Viewer viewer; viewer.setSceneData( root.get() ); return viewer.run(); } Any hints would be fantastic. Thank you! Cheers, Seth -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50843#50843 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or g ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] screen capture with Qt
Hello Gianni, I just tried your code and it works fine on my machine I don't know how to help you. Martino 2012/10/30 Robert Osfield robert.osfi...@gmail.com Hi Gianni, I'm afraid I personally don't have the time available to chase up the problem in your code. Perhaps others will be able. Robert. On 29 October 2012 17:11, Gianni Ambrosio ga...@vi-grade.com wrote: Thank you Robert for the fast reply. In the meanwhile I'm attaching the code. Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50868#50868 Attachments: http://forum.openscenegraph.org//files/scenecaptureqt_189.cpp ___ 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 mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How convert osg::Image to OpenCV IplImage
Hi Koduri, for the project I'm working on I needed something similar. Using the C++ API of OpenCV I found the following code to be working: Code: osgImg-readPixels( 0, 0, width, height, GL_BGR, GL_UNSIGNED_BYTE ); cv::Mat cvImg(osgImg-t(), osgImg-s(), CV_8UC3); cvImg.data = (uchar*)osgImg-data(); // Flipping because of different origins cv::flip(cvImg, cvImg, 0); Cheers, Dakota -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50895#50895 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] screen capture with Qt
Hi Rocco, thank you for trying the code! Anyway that's really strange. In a Qt application I can get correct images just with WindowCaptureCallback::READ_PIXELS mode. While I get a black image s with the others (WindowCaptureCallback::SINGLE_PBO and WindowCaptureCallback::DOUBLE_PBO). On the other hand in a NON-Qt application all modes work fine. Sorry for asking you again but can you confirm you get correct images with SINGLE_PBO and DOUBLE_PBO modes? Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50896#50896 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] screen capture with Qt
Yes, I tested SINGLE_PBO, DOUBLE_PBO, TRIPLE_PBO and READ_PIXELS with SingleThreaded, CullDrawThread etc. I simply had to change the mode at line 666, right? I have osg 3.0.1 and Qt 4.7.0 on Slackware64 13.1 with latest fglrx proprietary drivers 2012/10/30 Gianni Ambrosio ga...@vi-grade.com Hi Rocco, thank you for trying the code! Anyway that's really strange. In a Qt application I can get correct images just with WindowCaptureCallback::READ_PIXELS mode. While I get a black image s with the others (WindowCaptureCallback::SINGLE_PBO and WindowCaptureCallback::DOUBLE_PBO). On the other hand in a NON-Qt application all modes work fine. Sorry for asking you again but can you confirm you get correct images with SINGLE_PBO and DOUBLE_PBO modes? Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50896#50896 ___ 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] Getting Mipmap level from FBO
Hello, I'm trying to implement an advanced HDR lighting algorithm where I need the average luminance of the last frame(s). Currently I've encountered two major problems: 1. Is there a possibility to get only the last mipmap-level from texture/image bound to a FBO? I can get the whole image via readImageFromCurrentTexture in a postDrawCallback, but this unfortunately copies the complete texture. Looking at the code, I see that all mipmap levels are copied, and my question is if it would be feasible to either create a special function to copy only a specific mipmap-level or add an additional parameter to the function to specifiy the mipmap level? 2. I have trouble getting correct values from floating point buffers. It works if get the values as GL_UNSIGNED_BYTE (the values are indeed scaled to 0 -255) but this, of course, won't be precise enough as the buffer holds the logarithmic luminance. Below you find a snippet of my PostDrawCallback, maybe I'm doint something fundamentally wrong. I'm running on OSG 3.0.1. virtual void operator () (osg::RenderInfo render_info) const { //state-apply(render_info.getCurrentCamera()-getStateSet()); //state-applyTextureAttribute(0,mTexture); //mTexture-apply(*state); osg::ref_ptrosg::Image image=new osg::Image(); mTexture-getImage()-readImageFromCurrentTexture(render_info.getContextID(),true, GL_UNSIGNED_BYTE); //works , doesn't work with GL_FLOAT double data = *image-getMipmapData(0); std::cout luminance data std::endl; //osgDB::writeImageFile(*image,snap.bmp); } cheers Sebastian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg::Sequence boundingsphere
Finally, I have done some investigation regarding this subject: returning the active child bounding sphere when the getBound() method of an osg::Sequence is called can increase considerably the renderingTraversal execution time (2x for my complex scene). This is probably due to the invalidation of bounds (dirtyBound) and all the necessary bounds recalculation ... Most of the time, I think each child of an osg::Sequence probably have the same bounding sphere size: thus recomputing the bounds during each traversal is unnecessary (the current mechanism is then appropriate in this context). But for an osg::Sequence like mine (where children sizes vary a lot), there should be a mode indicating which strategy the getBound() method shall use (active child or all of them). Marc-Andre On Thu, Oct 18, 2012 at 8:05 PM, Ulrich Hertlein u.hertl...@sandbox.dewrote: Hi Marc-Andre, On 19/10/12 2:01, Marc-André Labrie wrote: But I still do not understand why non-visible geodes should take part to the boundingsphere calculation. In my case, in my osg::Sequence, frame1 is way much smaller than frame15 ... I'm not saying that they should (quite the opposite), osg::Sequence *should* only use the currently active child (like osg::Switch is doing). Maybe you can submit a patch for that? Cheers, /ulrich ___ 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] Getting Mipmap level from FBO
Hi Sebastian 2012/10/30 Sebastian Messerschmidt sebastian.messerschm...@gmx.de Hello, I'm trying to implement an advanced HDR lighting algorithm where I need the average luminance of the last frame(s). Currently I've encountered two major problems: 1. Is there a possibility to get only the last mipmap-level from texture/image bound to a FBO? I can get the whole image via readImageFromCurrentTexture in a postDrawCallback, but this unfortunately copies the complete texture. Looking at the code, I see that all mipmap levels are copied, and my question is if it would be feasible to either create a special function to copy only a specific mipmap-level or add an additional parameter to the function to specifiy the mipmap level? I don't see any code in OSG to just read specific mipmap level, but with readImageFromCurrentTexture code as model, this will not be difficult to do appropriate function. 2. I have trouble getting correct values from floating point buffers. It works if get the values as GL_UNSIGNED_BYTE (the values are indeed scaled to 0 -255) but this, of course, won't be precise enough as the buffer holds the logarithmic luminance. check this : - be sure to bind correct texture in Texture 0 : state-applyTextureAttribute(0, myTextureToRead); - be sure to active correct Texture Unit : state-setActiveTextureUnit(0); - be sure current texture have FLOAT internal Type : osg::Image::computeFormatDataType(myTextureToRead-getInternalFormat()) == GL_FLOAT And when you did double data = *image-getMipmapData(0); you read the buttom left pixel of the complet image, average luminance is in the last mipmap level double averageLuminance = *reinterprete_castdouble*( image-getMipmapData(image-getNumMipmapLevels() - 1) ); HTH David Below you find a snippet of my PostDrawCallback, maybe I'm doint something fundamentally wrong. I'm running on OSG 3.0.1. virtual void operator () (osg::RenderInfo render_info) const { //state-apply(render_info.**getCurrentCamera()-**getStateSet()); //state-**applyTextureAttribute(0,**mTexture); //mTexture-apply(*state); osg::ref_ptrosg::Image image=new osg::Image(); mTexture-getImage()-**readImageFromCurrentTexture(** render_info.getContextID(),**true, GL_UNSIGNED_BYTE); //works , doesn't work with GL_FLOAT double data = *image-getMipmapData(0); std::cout luminance data std::endl; //osgDB::writeImageFile(***image,snap.bmp); } cheers Sebastian __**_ osg-users mailing list osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org http://lists.openscenegraph.**org/listinfo.cgi/osg-users-** openscenegraph.orghttp://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] [vpb] Quesions about LOD in VPB
robertosfield wrote: Hi David, I can't recall all the options off the top of my head so with the help of osgdem --help and grep I get: $ osgdem --help | grep LOD --LOD Create a LOD'd database. --PagedLODCreate a PagedLOD'd database. --subtile LOD X Y -l numOfLevels Specify the number of PagedLOD levels to generate. So the last one is the one you want, so just add a -l 5 or something similar to your osgdem or vpbmaster command line. Robert. On 5 September 2012 23:44, David Glenn wrote: Greetings All! I'm just getting the time to do some real study on VPB and I had some questions about LOD and controlling it! First of all, I'm going to reverence a tool that I know “Terra Vista” for an example. If you don't know about this tool, I understand and try to explain in more detail. One of the tricks you can do in Terra Vista is that you can limit the amount of LOD's you can use in a given area over others. This allows you to build terrain that has higher level of detail in some areas (where it matters ) and allows other areas to max out at a lower level of detail. This in the end would make the terrain take up less space than of all of the terrain was at a high level of detail. I managed to get a group of satellite data at 1 meter resolution and it works fine, but it's taking up over 50 gigs of Hard disk space. I like to cut it back a bit so I can at lease maybe get it on a double layer DVD, if not , a blue ray disk. I figure that if I can cut back on the resolution in areas that I don’t need to be at 1 meter resolution, I can cut the size in whole of the terrain to something more manageable. Dglenn David Glenn --- D Glenn 3D Computer Graphics amp; Media Systems. www.dglenn.com -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49791#49791 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum Well, I have made some headway on Paged LOD's and made some terrains files, but I also found something interesting and I was wondering is someone can explain this to me! When I make a terrain with -l set to 20, I get a bunch of files titled with the name, level of detail number, the X location in the grid and a Y location on the grid fallowed with _subtile! I figured that I would find at least 19 sets of files listed from L0 up to L19 or L20 but what I get is 12 sets listed from L0 to L11. Can anyone explain this to me? I'm in the middle of writing a paper on this and after reviewing code and files, I thought I knew what was going on, but now I'm confused!! :? David Glenn --- D Glenn 3D Computer Graphics amp; Media Systems. www.dglenn.com -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50901#50901 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org