[osg-users] reflect vector ?
Hi, Do any functions exist to compute reflected matrix or reflected vector against a plane ? Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=24214#24214 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] reflect vector ?
Hi Julien, Thanks for your answer, but I am looking for precompute function in osg, not in glsl. Someting like osg::Vec3 R = osgUtil::reflect(osg::Vec3(...), N), same for matrix. Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=24216#24216 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] reflect vector ?
Hi, Sure, and I knew the math before you helped me, but I was just wondering if something was already existing in osg. Computing reflection (and refraction) vectors/matrces are pretty usefull now. I was wondering if osg had a reflect function into utils libs or elsewhere, but now I guess it does not. Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=24220#24220 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] dynamic cube map
Hi thank you Nick I found your discussion about osgprerenderCubeMap I did a search on dynamic cube map but I didn't find anything. Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23906#23906 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] dynamic cube map
Hi Nick, ok I did have a look at the osgPrerenderCubeMap code and at you thread about mixing a static 2D texture and a dynamic cube map into a shader. btw your version with Code: { osg::Uniform* u = new osg::Uniform(osg::Uniform::SAMPLER_CUBE,cubeMapUnit); u-set(unit); node-getOrCreateStateSet()-addUniform( u ); } works well for me I tried this sample with my own camera (Y up) and that works well too. I want to use this sample in a more general case (dynamic reflection on water for example) . I tried to use the bottom plane as the reflector but the reflection is now awfull... Did you work on it ? Can you confirm ? Thank you Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23915#23915 Attachments: http://forum.openscenegraph.org//files/sans_titre_192.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] dynamic cube map
Hi Nick, Well the changes are minors. I just wanted to change de reflector from the sphere to the bottom plane (or box). here is my reflector function, I changed the sphere to a box geode, ie the bottom plane/box. Code: osg::NodePathcreateReflector() { osg::PositionAttitudeTransform* pat = new osg::PositionAttitudeTransform; pat-setPosition(osg::Vec3(0.0f,0.0f,0.0f)); pat-setAttitude(osg::Quat(osg::inDegrees(0.0f),osg::Vec3(0.0f,0.0f,1.0f))); osg::Geode* geode_1 = new osg::Geode; osg::ShapeDrawable* shape = new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f, 0.0f, -2.0f), 10, 10.f, 0.1)); shape-setColor(osg::Vec4(0.5f, 0.5f, 0.7f, 1.0f)); geode_1-addDrawable(shape); //osg::Geode* node = new osg::Geode; //const float radius = 0.8f; //osg::ref_ptrosg::TessellationHints hints = new osg::TessellationHints; //hints-setDetailRatio(2.0f); //osg::ShapeDrawable* shape = new osg::ShapeDrawable(new osg::Sphere(osg::Vec3(0.0f, 0.0f, 0.0f), radius * 1.5f), hints.get()); //shape-setColor(osg::Vec4(0.8f, 0.8f, 0.8f, 1.0f)); //node-addDrawable(shape); pat-addChild(geode_1); osg::NodePath nodeList; nodeList.push_back(pat); nodeList.push_back(geode_1); return nodeList; } And I have commented the code corresponding to the same bottom plane in the _create_scene() function. Code: //shape = new osg::ShapeDrawable(new osg::Box(osg::Vec3(0.0f, 0.0f, -2.0f), 10, 10.f, 0.1), hints.get()); //shape-setColor(osg::Vec4(0.5f, 0.5f, 0.7f, 1.0f)); //geode_1-addDrawable(shape.get()); Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23919#23919 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] dynamic cube map
mmm I dont think it will work. I would like to make reflection into object that are not always plane. Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23932#23932 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] dynamic cube map
Hi, I am trying to make a dynamic cube with osg. The idea is to render into a cube map the +X, -X, +Y, -Y, +Z and -Z view from the camera view point at each frame. Then the cube map is textured on a reflector surface (a plane) within a shader. I would like to see other objects (sphere, cube) reflecting in my plane as it was a mirror. I managed to make the cube map and to texture it on my plane but the reflection is not correct, and I need some ideas to correct my app. Ok, so I build a cubemap texture with osg, then I create 6 camera nodes. theses cameras are looking at +X, -X, +Y, -Y, +Z and -Z directions and are attached with a callback to the main camera position. I use this command to attach the cube map texture for each camera : Code: camera-attach(osg::Camera::COLOR_BUFFER, m_textureEnvMap, 0, i); Then I use this fragment shader to map the cube map on the plane : Code: // world space eye vector vec3 E = normalize(posWorld.xyz - cameraPosWorld); // plane world vector (hadcoding!) vec3 N = vec3(0,1,0); vec3 coord = reflect(E, N); vec3 reflectColor = textureCube(cubeMap, vec3(coord.x, coord.y, coord.z)).rgb; posWorld is the current fragment world position (posWorld = modelMatWorld * gl_Vertex); cameraPosWorld is the camera world position (passed with uniform). I would like to have some advice and ideas about my program. Did anyone already try to make dynamic cube ? What did I miss ? Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23848#23848 Attachments: http://forum.openscenegraph.org//files/sans_titre_2_182.jpg http://forum.openscenegraph.org//files/sans_titre_243.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] osgPPU cube map sample
Hi again art It seems that you maybe have a bug in the cube sample when I launch the app, the yellow color (cube nb 5) is never displayed on the central sphere. can you confirm ? Another question I did have a look at your code and I do not understant what is the cube texture unit for ? Does it contains the 6 face cube dynamic textures, but why did you code it if you do not use it ? Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23797#23797 Attachments: http://forum.openscenegraph.org//files/sans_titre_158.jpg ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] osgPPU cube map sample
Hi, Thank you for the explanation Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23712#23712 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] bad screen identifier
Hi, When I launch my osg app this morning, I've got this error while creating the graphic context : Win32WindowingSystem::getScreenInformation() - The screen identifier on the Win32 platform must always use display number 0. Value received was 15 Error: [screen #0] GraphicsWindowWin32::setPixelFormat() - No matching pixel format found base on traits specified I really do not understand because yesterday it worked perfectly ... Code: osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface(); assert(wsi); unsigned int width, height; wsi-getScreenResolution(osg::GraphicsContext::ScreenIdentifier(0), width, height); osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; traits-x = 0; traits-y = 0; traits-width = width; traits-height = height; traits-windowDecoration = false; traits-doubleBuffer = true; traits-sharedContext = 0; osg::ref_ptrosg::GraphicsContext gc = osg::GraphicsContext::createGraphicsContext(traits.get()); assert(gc.valid()); I tried to reboot my computer, but it always the same. Do you have any ideas ? Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23717#23717 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] osgPPU cube map sample
Hi, I would like to know what is the aim of the cube map sample. When I launch this sample, I've got some satellite objects that are moving arround a bigger sphere, this sphere seems to be mapped with an envmap made of 6 colors (red, green etc...). But the envmap is not dynamic (ie the sattelite objects do not reflect in the bigger sphere). Is it normal behavior ? Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23685#23685 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] osgPPU cube map sample
Hi, Well I had a look in the code shader, you set gl_fragColor with a color depending on the face index osgppu_CubeMapFace. The corresponding update code is in void UnitInOut::init() method. That's why the bigger sphere holds colors. But the samplerCube input is unused in this sample, why ? Is this texture holds the reflection of the satellite objects ? Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23686#23686 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] dependancies with Visual2005 SP2
Hi jean-sebastien thank you for your answer My mistake, I use visual 2005 sorry. It seems that no SP2 exists, you are right again. I saw version 2.0.50727 SP2 in the visual2005 about box. But I guess it is the .Net Framework version ... sorry again ! Anyway, that does not explain my problem. If I take the binaries for VC8 SP1 in debug mode (openscenegraph-all-2.8.2-win32-x86-vc80sp1-Debug.zip), I still have the (0xc0150002) error message. All my dll (osg and 3rd party (zlib) dependancies) are copied into the same directory as my exe, into the debug directory. As you said, I tried Dependancy walker on my app , here is the log result : Error: The Side-by-Side configuration information for ...\sources\visualapp\debug\OSG55-OSGD.DLL contains errors. Cette application n'a pas pu dmarrer car la configuration de l'application est incorrecte. Rinstaller l'application pourrait rsoudre ce problme (14001). Error: The Side-by-Side configuration information for ...\sources\visualapp\debug\OT11-OPENTHREADSD.DLL contains errors. Cette application n'a pas pu dmarrer car la configuration de l'application est incorrecte. Rinstaller l'application pourrait rsoudre ce problme (14001). Error: The Side-by-Side configuration information for ...\sources\visualapp\debug\OSG55-OSGDBD.DLL contains errors. Cette application n'a pas pu dmarrer car la configuration de l'application est incorrecte. Rinstaller l'application pourrait rsoudre ce problme (14001). Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module. I really do not understand ... Are these dll do not correspond with my version of visual ? But if I compile all osg (like I said before) that works with the new binaries... Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=23052#23052 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] dependancies with Visual2005 SP2
Hi, I am running on Visual 2008 SP2 with osg 2.8.2 I have just downloaded osg binaries for visual 2005 SP1 and I have this message when I launch my app in debug mode : The application failed to initialized properly (0xc0150002). Click on OK to terminate the application. Well I guess that does not work because I use Visual2005 SP2 et not SP1. After few research on this forum, I have read that my solution is to compile all osg library (and plugins) myself, so I did, and that works. My question is now about the dependancies. When I want to load a mesh (.ive file) I need zlib1d.dll, so I have donwloaded this library from VC2005 SP1 dependancies. But I have the could find plugin to read objects from file ...ive message. The plugin was compiled and is present in osgPlugins-2.8.2/osgdb_ived.dll directory. I am pretty sure this error comes from an incompatibility with zlib1d.dll because the osg binary dependancies are also available on VC2005 SP1, and not on VC2005 SP2. What do you think ? and If I am right, how to get the VC2005 SP2 dependancies ? Does any one had already this problem ? Thank you Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22989#22989 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] dependancies with Visual2005 SP2
Hi, well I have my solution, I changed the link compile option for the project plugin ive. I changed the zlib1d.lib dependancy to zlib1.lib. I now use the release version of zlib and that works. Do you think it is the only solution ? Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=22990#22990 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] no results with osgPPU
Hi Arts and have a happy new year Ok so I have decided to make a simple stand alone application to test what you said : create a new camera as a child of the main camera, the child camera will be the FBO camera for the PPU processor here is a part of my code : Code: void buildPPUScene(osg::Group* root, osg::Camera* camera) { setupFBOCamera(camera); // create PPU osgPPU::Processor* postProcessor = new osgPPU::Processor(); root-addChild(postProcessor); // initialize the post process postProcessor-setCamera(camera); postProcessor-setName(Processor); postProcessor-dirtyUnitSubgraph(); // osgPPU::UnitBypass* bypass = new osgPPU::UnitBypass(); bypass-setName(HDRBypass); postProcessor-addChild(bypass); // just a resample example osgPPU::UnitInResampleOut* resample = new osgPPU::UnitInResampleOut(); resample-setName(Resample); resample-setInputTextureIndexForViewportReference(-1); // need this here to get viewport from camera resample-setFactorX(0.1); resample-setFactorY(0.1); bypass-addChild(resample); // osgPPU::UnitOut* ppuout = new osgPPU::UnitOut(); ppuout-setName(PipelineResult); ppuout-setInputTextureIndexForViewportReference(-1); // need this here to get viewport from camera resample-addChild(ppuout); } int _tmain(int argc, _TCHAR* argv[]) { osgViewer::Viewer viewer; osg::Group* root = new osg::Group; // get main camera osg::Camera* camera = viewer.getCamera(); // read node osg::Node* node = osgDB::readNodeFile(cow.osg); // create child camera osg::Camera* ppuCamera = new osg::Camera; // add new camera as main camera child camera-addChild(ppuCamera); // init viewports initCameraViewport(camera, 400, 400); initCameraViewport(ppuCamera, 400, 400); // build PPU resample scene buildPPUScene(root, ppuCamera); // add readed node as new camera child ppuCamera-addChild(node); viewer.setSceneData(root); viewer.realize(); return viewer.run(); } The setupFBOCamera function is the same as your setupCamera function present in your osgppu_viewer example : it creates renderTexture, attaches it to the camera in parameter and sets the camera to render into a FBO. If I do not create the ppuCamera, it works well, I have my resample cow (in this case the cow node is a child of the root). But with the new ppuCamera, I have a black screen, as if no nodes are rendered; that is strange because the cow node is a child of the new ppu camera, and it should be rendered... no ? So what do I make wrong ? Thank you! Cheers, Sebastien -- 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] [osgPPU] no results with osgPPU
Hi Art, I will try to add a camera node as a child of the main camera. I will also try to disable the main camera callback Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21492#21492 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] ReflectionMapGenerator
Hi, What is the use of ReflectionMapGenerator class ? I didn't find any example. How can we use it ? What is this class for ? Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21493#21493 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] no results with osgPPU
Hi Art, thx for your answer Sure you can know what the host application is doing, and unfortunately neither am I ... But I am trying to understant what is modified by the application, that's why I need some help... I have check in debug mode the run time passes throught the Unit::traverse methode. So I guess osgPPU is not disable. I did what you suggest, and I have a black screen, like there was no root. I have one question about your graph, did you mean that the main camera node has 2 children : the osgPPU processor and the custom FBO camera with your graph ? I have set the FBO camera with RELATIVE_RF transform and I didnt set the view and projection matrices. I guess the view matrix will be update by its parent and osgPPU will set the projection matrix with a 2 projection. Am I right ? Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21223#21223 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] no results with osgPPU
Hi Art, With the graph you propose, I have the back screen, I have checked and the scene graph is correct, I didn't forget to attach any nodes, so I do not understand. By modifying directly the main camera,I did it too, and I have the scene with no osgPPU (no resambled scene) like I explained on my 1st post. I have checked too in the debut mode, and the camera has still the FRAME_BUFFER_OBJECT mode on each frame. So I do not understand either. I see in debug mode that the main camera holds pre and post render callback, do you think these functions may interfer with osgPPU ? Well I really appreciate your help but I begin to think it is impossible to guess what the host application is doing without the code or any documentations. Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21230#21230 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] no results with osgPPU
Hi, In my application, I just add this code on the init part : Code: osg::ref_ptrosg::Texture2D texture = new osg::Texture2D; texture-setTextureSize(width, height); texture-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR); texture-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR); texture-setInternalFormat(GL_RGBA); m_camera-setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); m_camera-setRenderTargetImplementation(osg::Camera::PIXEL_BUFFER_RTT); m_camera-attach(osg::Camera::COLOR_BUFFER, texture); osg::ref_ptrosgPPU::Processor postProcessor = new osgPPU::Processor(); postProcessor-setCamera(m_camera); postProcessor-setName(Processor); postProcessor-dirtyUnitSubgraph(); m_root-addChild(postProcessor.get()); osgPPU::UnitBypass* bypass = new osgPPU::UnitBypass(); bypass-setName(Bypass); postProcessor-addChild(bypass); osgPPU::UnitInResampleOut* resample = new osgPPU::UnitInResampleOut(); resample-setName(Resample); resample-setInputTextureIndexForViewportReference(-1); resample-setFactorX(0.1); resample-setFactorY(0.1); bypass-addChild(resample); osgPPU::UnitOut* ppuout = new osgPPU::UnitOut(); ppuout-setName(PipelineResult); ppuout-setInputTextureIndexForViewportReference(-1); resample-addChild(ppuout); the camera is the only one camera that I have, it is the view's camera. the root is the scene data I just want to do a post render to texture into resampled texture, but I just see the scene as there was no ppu (my image is not resampled) Do I miss something ? Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21150#21150 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] no results with osgPPU
Hi, I tried with FRAME_BUFFER_OBJECT but I have the same result (ie no results ^^) But I think I have to explain my program context. In fact, I am developping a plugin for a closed application (I do not have the source of this application); within this plugin I have an access to the root scene graph, and I can get the camera with the static graphic context (getAllRegisteredGraphicsContexts) If I add my code to my own application, it works well. But if I add this code inside the closed application plugin, I do not have any results, as if osgPPU was disabled. Do you have any ideas of this behavior ? Maybe the closed application is resetting the camera each frame ? maybe a camera render callback disable osgPPU ? I really do not know, I do not have much experience with osgPPU and I need some ideas ... Thank you Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21159#21159 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] multiple pixel shaders for one program ?
Hi, I would like to know if it is possible to do that : Code: osg::Program* program = new osg::Program; osg::Shader* shader = new osg::Shader(osg::Shader::FRAGMENT); shader-loadShaderSourceFromFile(main.frag); program-addShader(shader); osg::Shader* shader1 = new osg::Shader(osg::Shader::FRAGMENT); shader1-loadShaderSourceFromFile(common.frag); program-addShader(shader1); Is it possible to add multiple pixel shaders for one program ? So I can put all my common function into a shader into multiple shader program. Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20576#20576 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] multiple pixel shaders for one program ?
Hi robert thx for your answer Ok I tried what you said, but I still have a pb. I made a shader common.frag with a basic fog function Code: uniform vec3 fogColor; uniform float fogDensity; vec3 fog(in vec3 color) { const float LOG2 = 1.442695; float z = gl_FragCoord.z / gl_FragCoord.w; float fogFactor = exp2(-fogDensity * fogDensity * z * z * LOG2); fogFactor = clamp(fogFactor, 0.0, 1.0); return mix(fogColor, color, fogFactor); } And I did a main.frag with the main function Code: void main(void) { vec3 color = vec3(1,1,1); color = fog(color); gl_FragColor = vec4(color, 1); } then I load thoses shaders into one program as fragment shader Code: osg::Program* program = new osg::Program; osg::Shader* shader = new osg::Shader(osg::Shader::FRAGMENT); shader-loadShaderSourceFromFile(common.frag); program-addShader(shader); osg::Shader* shader1 = new osg::Shader(osg::Shader::FRAGMENT); shader1-loadShaderSourceFromFile(main.frag); program-addShader(shader1) But when OSG compile my shader, it fails because fog is not known in the main function. Any ideas ? If I find the solution I will post... thanks a lot Sebastien[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20578#20578 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] multiple pixel shaders for one program ?
you right ! Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=20585#20585 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] memory leak in osg 2.8.2 ?
Hi Chris, thx for your answer and your trick ! :) but it is the same for me... struct TheEnd { ~TheEnd() { _CrtDumpMemoryLeaks(); } }; TheEnd theEnd; int _tmain(int argc, _TCHAR* argv[]) { osg::ref_ptr osg::Group gr; return 0; } Detected memory leaks! Dumping objects - {792} normal block at 0x00B17320, 128 bytes long. Data: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 {791} normal block at 0x00B172D8, 12 bytes long. Data: r r D8 72 B1 00 D8 72 B1 00 CD CD CD CD stange ? Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18379#18379 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] memory leak in osg 2.8.2 ?
Hi Bryan, ok thx for your answer (even if I do not understand the 1st part of your message?) I did some research on the forum before posting, but maybe it wasn't enought. Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18319#18319 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] memory leak in osg 2.8.2 ?
Hi, I take an osg example (I tried with the osgTeapot example project), then I add the command Code: viewer.run(); _CrtDumpMemoryLeaks(); return 0; at the end of the main function. (it dumps all the memory blocks in the debug heap when a memory leak has occurred) I launch it in debug mode, then I stop the application (ESC key) and I have many memory leaks in my output debug window. Detected memory leaks! Dumping objects - {21998} normal block at 0x01D633D0, 4 bytes long. Data: P 50 3E D4 01 {21997} normal block at 0x01D48750, 20 bytes long. Data: hs ( hs 68 73 D2 01 28 DE D2 01 68 73 D2 01 08 FA E3 05 {21996} normal block at 0x01D48568, 184 bytes long. Data: q] B8 71 5D 01 00 00 00 00 01 00 00 00 00 00 00 00 {21995} normal block at 0x01D34998, 4 bytes long. Data: h68 03 D3 01 .. Where do they come from ? I tried other example and it is the same. I use VisualC++ 2008, osg 2.8.2, on windows Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=18121#18121 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] change ocean height
Hi, haha ok thx for your answer and bug fix JS, I will try Well I did apologize because it seems that I am the only one to use the osgOcean height features and I do not use to have people working for me ! :p I tried to correct myself but you were too fast ^^ well thanks anyway Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17788#17788 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] change ocean height
Hi JS ok I have updated osgOcean from the trunk and tried the new setOceanSurfaceHeight function. It is working well. Except that I have no node reflections in the water ? Did you try it ? In my 1st pic you can see the ocean and a cow at altitude 0, the reflection is great. [Image: http://img43.imageshack.us/img43/8820/water1h.jpg ] But when I add a (0,0,100) transform node for the cow and I use setOceanSurfaceHeight(100), I have no more reflections and a strange artifact at the horizon, see pic2 [Image: http://img25.imageshack.us/img25/9372/water2r.jpg ] Do you confirm this ? (really sorry to bother you ^^) Thank you! Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17763#17763 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] change ocean height
Hi all, Thanks for your rapidity !! So I have updated and tested with my scene, when the cow is at 150 and the ocean at 100, it works well (the reflection is hard to see but it is here !) [Image: http://img246.imageshack.us/img246/9285/sanstitre1yg.jpg ] But ... really sorry again... there is a problem when the cow touches the ocean, both of them are at height 100... do you confirm this ? [Image: http://img297.imageshack.us/img297/836/sanstitre2hs.jpg ] Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17768#17768 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] change ocean height
Hi Jean-Sébastien, ok thanks a lot for yours answers, I will work on it et keep in touch Thank you again Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17745#17745 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] change ocean height
Hi Jean Sebastien I am sorry to bother you but did you work or are you still plannning to work on the aspect we talked in this thread ? Thank you Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17710#17710 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] resize osgPPU
Hi, no you are right, nothing is wrong, but I was just thinking the new viewport will automatically set the new camera aspect ratio I did it and that works good now here is my code Code: osg::ref_ptrosg::Viewport vp = new osg::Viewport(0, 0, width, height); double fovy; double aspect; double znear; double zfar; camera-getProjectionMatrixAsPerspective(fovy, aspect, znear, zfar); for(unsigned int i = 0; i m_ppuUnitList.size(); i++) { m_ppuUnitList[i]-setViewport(vp.get()); // m_ppuUnitList[i]-dirty(); } camera-setProjectionMatrixAsPerspective(fovy, width / (double)height, znear, zfar); Thank you! Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17617#17617 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] resize osgPPU
Hi, simple question, is there a way to resize the osgPPU viewport in real time ? Thanks Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17574#17574 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBO OpenGL Error with new nVidia Driver
Hi Robert Well, if I have asked something to this forum, this is because I have already investigated and I have found no solutions by myself. I just wanted to know if someone else has accountered this problem and if a solution has been found - I think a forum is for sharing problems and solutions - but if I am the only one to have this opengl memory overflow problem, so I must be the only one to use nvidia card and pre rendering pass with osg :|. By the way, the application is very simple because it is the osgPrerender example, and, as I said, the opengl memory overflow happens when a pre rendering pass is done into a fbo. I have a pretty good nvidia graphic card with the last driver (190.38, august 2009). I cannot try other hardware and if a solution is to downgrade drivers, I won't do that... Well, if one day I find a solution I will share Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17362#17362 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBO OpenGL Error with new nVidia Driver
Hi JP, mm there is no reason, it is the version I have dowloaded when I started to work with OSG. I will try to get 2.8.8 and get back. Thank you! Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17367#17367 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBO OpenGL Error with new nVidia Driver
Hi, Like Kim also said, I think the error is more likely in the driver than in OSG. Upgrading to OSG 2.8.2 won't hurt though :) I don't use Windows, but I've seen some utility to help you get rid of NVidia driver cruft on you machine before you install a new driver. I think experimenting with other driver versions is your best option Yes I think it is due to GeForce 8 series drivers, but I would prefer not to to downgrade my drivers. Well I guess I have no solutions thanks anyway Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17373#17373 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBO OpenGL Error with new nVidia Driver
Hi, I am making a little up to this thread because I have the same problem as Kim. I use OSG 2.8, under windows XP and my graphic card is NVIDIA GeForce 8800 GTX. [Image: http://img147.imageshack.us/img147/3131/errorxk.jpg ] It appears each time I do a pre render renderig pass. It is very annoying because this error prevents me to debug my shaders with glslDevil. Thank you! Cheers, Sebastien[/img] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17339#17339 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] multi render pass with different materials
Hi, Here is my problem, I use 2 passes to render a frame. On the 1st pass, I render the whole scenegraph into a texture with a material A on a node N. On the 2nd pass, I render the whole scene graph again and I use the texture from the 1st pass into a shader to render same node N with a material B. As you can see, the node N must have a material A on the 1st pass and another material B on the 2nd pass; and I do not know how to do this. All the rendering to texture and multiple pass rendering is done, but I do not know how to use a material A for my node N for the 1st pass, then to use a material B for the same node N on the 2nd pass. One first and ulgy solution may be to duplicate the scenegraph, and to assign a material A on my node N on the 1st copy of the scenegraph and to assign a material B on my node N on the 2nd copy of the scenegraph. But it is really ugly... Another better solution is - I think - to use a switch node. this switch node may be have 2 children, the 1st child may hold the material A and the 2nd child may hold the material B. These 2 children may have my node N as a child. But I don't know how to activate the 1st swith's child on the 1st pass and the 2nd switch's child for the 2nd pass. Does anyone of you have any ideas ? I think I may have to use render callback then to activate the correct switch's child for the correct pass, but I do not know OSG well and I don't know which callbacl to use and how to get the render pass number. Thank you Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17140#17140 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] osgOcean : Integration into existing Database / Application
Hi all I would like to update this post to know if there is a way to integrate osgOcean material (and shader) to an existing surface like it was mentioned ? Thanks Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16996#16996 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [3rdparty] change ocean height
Hi, I would like to know if there is a way to change the ocean surface height. All the objects of my scene are located at a 100 altitude on the Z axis while the ocean is a 0. Thank you Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16997#16997 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] change ocean height
Hi JS bad luck for me ! ^^ anyway thanks for your answer and have nice holidays :) sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17004#17004 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] osgOcean : Integration into existing Database / Application
Hi, I was talking about rivers and lakes, and I had my answer. Thanks Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17005#17005 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] getParentalNodePaths() or getWorldMatrices() assert on deallocation in debug mode
Hi Robert Ok I understood and I have already read some posts on the bad use of release / debug libraries I have checked and I do use debug osg librairies in debug mode and release osg lib in release mode. I think I am going to compile osg and check again... Thanks for your usefull help Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16946#16946 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] getParentalNodePaths() or getWorldMatrices() assert on deallocation in debug mode
Hi again, I still have this problem... when I use this code, Code: { osg::MatrixList matrixList = geode-getWorldMatrices(); } A memory assert fails with visual 2009 in debug mode. It is like a bad pointer has been passed in Do I use this function on a bad way ? Does anyone have any ideas ? Thanks a lot Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16898#16898 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] getParentalNodePaths() or getWorldMatrices() assert on deallocation in debug mode
Hi The geode pointer is valid And I have the same problem with visual 2008... the assert fails while deallocating the matrix list (on the last bracket) the assert is this one : windows has triggered a breakpoint in visualApp.exe this may due to a corruption of the heap and the assert comment : If this ASSERT fails, a bad pointer has been passed in. It may be totally bogus, or it may have been allocated from another heap. The pointer MUST come from the 'local' heap. any ideas ? thx -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16903#16903 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] getParentalNodePaths() or getWorldMatrices() assert on deallocation in debug mode
Hi Ulrich no it is just a pointer inside a visitor. here is a part of my code void CPrintSceneGraphVisitor::apply(osg::Node node) { osg::Geode* geode = dynamic_castosg::Geode*( node); if(geode) { osg::MatrixList matrixList = geode-getWorldMatrices(); const osg::Geode::DrawableList list = geode-getDrawableList(); m_stream drawable count : list.size() std::endl; ... } } Thank for your answer Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16907#16907 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] getParentalNodePaths() or getWorldMatrices() assert on deallocation in debug mode
Hi robert, thanks for your answer But are you sure you are talking about an assert while deallocating memory of an osg matrix list (my case) ?? I found this on osg-user http://lists.openscenegraph.org/htdig.cgi/osg-users-openscenegraph.org/2009-May/027347.html, it talks about performance while iterating in debug mode. Have you got any links ? Thanks Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16909#16909 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] get texture from ive file
Thanks a lot ! I did some research on google but I didn't find this post ! sorry for the message Cheers, Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14807#14807 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] get texture from scene a frame n-1, n-2, n-3 ...
yes, I am actually working on storing the texture. But I think I have some implementation problem for the moment. I was just wondering if a scenegraph approch was possible. thx for your answer sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14692#14692 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] get texture from scene a frame n-1, n-2, n-3 ...
Exactly what I did ! (before reading your message !) and that works great At start, I didn't think about the switch node and I made a add/remove camera's node mechanism, but I had lots of seg fault problem. the switch node is perfect thank you so much all for your reactivity! sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14701#14701 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [3rdparty] cannot run examples on osgNV
ok that works I have just copied my 2.2 version of cg.dll and cgGL.dll into my debug/release directories I think I have another version of theses dll on my computer, I have to check my path environment variable thx to you -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14381#14381 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [3rdparty] cannot run examples on osgNV
Hi, I've just downloaded osnNV 0.6.2, compiled it, and tried to run osgNVCg1 example. When I execute the sample, a dialog box says that message : the cgGetParametersBufferOffset function cannot be find in cg.dll Do I have a bad version of CG on my computer ?? My CG.dll version seems to be 2.2.0.6, I have downloaded it from NVIDIA site when installing their last SDK. Or may the osgNV samples are too old and doesn't work with the last CG version ?? Does anyone of you have experiment this problem ? What is the solution ? Thanks Cheers -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14321#14321 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] change the current state set in real time for a multipass renderer
understood! Thank you! Sebastien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13762#13762 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] change the current state set in real time for a multipass renderer
Hi all, Is there a way to change the current state set in real time ? I am actually working on a multi pass render scene which contains one geode. on the 1st pass, I would like to have a specific state set for my geode, and on the 2nd pass, I would like to set another state set for my geode. How can I do that ? Thank you! Cheers, seb -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13583#13583 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org