Re: [osg-users] What callback for setting the viewMatrix of the camera every frame?
Hi, I used a class derived from osgGA:StandardManipulator and in the handle() i caught the FRAME event type. Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44590#44590 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Discussion: metadata readerwriters output
What will the users do, who current utilize the userData in the node for their own specialized purposes? Is this going to break our models? -Original Message- From: Sukender [mailto:suky0...@free.fr] Sent: Tuesday, February 01, 2011 4:11 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Discussion: metadata readerwriters output Hi Robert, Hi Peter, Robert, and all Thanks... but this is my first post... I've been happily watching the discussion so I can't take any credit, apart for great patience ;-) Ahah! This was an insidious way to get your attention! You fell in the trap! :-D Thank you for your ideas. I think the metadata container put in userData is the simplest way. And I fully agree there should be some minimal base classes to support it in core OSG. This has been my preferred option for a while. This topic been discussed before over the years, and I think a member of the community proposed a solution and may have even come up with a partial solution so it would be worth looking through the archives. Thanks. I'll do. Having the ability to read/write the data using the new serializers is the obvious thing to do. Meta data could even just be used to store a unique ID for those who want to use such approaches. So... Who's for that solution? If so, any idea about implementation details, or requirements? Ooo I think I'll duck for cover w.r.t implementations, I have plenty of other issues to tackle with getting the OSG ready for 3.0 to not worry about other stuff. Hmmm... Would you agree if I gradually propose submissions in that way? I mean I'll stick to the idea of metadata container, but I won't do everything in a row, so will you accept to integrate such sumbissions? Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg-users Digest, Vol 26, Issue 64
What I did was make my own manipulator derived from MatrixManipulator, then add it to the switch manipulator in the view. Then set it to be the one I want. Then in the handle for the events (my event of interest is each FRAME) I set the matrix by grabbing computePosition from the original MatrixManipulator and modify it to do what I want (e.g., step close each FRAME or rotate each FRAME by .1 deg), to make a series of images for further analysis. I switch out the manipulators when the user clicks the go button, etc. switch it back when he cancels or it finishes. Hope this helps, Bob -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of osg-users-requ...@lists.openscenegraph.org Sent: Friday, August 28, 2009 10:09 AM To: osg-users@lists.openscenegraph.org Subject: osg-users Digest, Vol 26, Issue 64 Send osg-users mailing list submissions to osg-users@lists.openscenegraph.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org or, via email, send a message with subject or body 'help' to osg-users-requ...@lists.openscenegraph.org You can reach the person managing the list at osg-users-ow...@lists.openscenegraph.org When replying, please edit your Subject line so it is more specific than Re: Contents of osg-users digest... ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] problem with empty osg::Program
Hi, i'm using an osg::Program containing some very simple shaders and i need to turn these shaders on off (back to fixed function pipeline). I read in the archives where the suggested approach to do this is to use an empty osg::Program. So, i have a callback that switches the program when the use case changes and it's all ok. the problem is that when i shut down the app or the scenegraph / view, i get an exception way down in the PerContextShader code, many levels of vectors and iterators. The iterator is ffeeffee in visual studio debug meaning it's already been deleted and is being deleted a second time. I'm out of my element down in osg's internals. If i only switch shaders once, no problem, but if i switch shaders back and forth, the empty shader causes exceptions. any ideas? is there a call i'm missing? i tried releaseGLComponents and it didn't make any difference. i can put up code extracts if you'd like. ... Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16396#16396 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPPU] X-ray Design use of OsgPPU
Hi, I'm trying to come up with a design using OSG to build what i'm calling an X-ray viewer. Basically i have relatively simple geometry, a shell or skin of a vehicle and then the interior. I want to view the interior as penetrated by the X-rays, which is based on a thickness calculation and a distance and aspect angle, all hopefully done in shaders. I envision the shaders setting the fragment alpha and/or color when rendering the shell, then after to render the interior and combine with the shell texture to create the final view, showing through the interior in desired parts. Finally, i desire to get a histogram of the colors of the interior to see how the shell performed on the x-rays with the interior. Do you see this as an appropriate application / use of osgppu? i'm running osg 2.8.1. will ppu work with that. i've got osgppu 0.4 i think. also, i'm thinking i need to create the ppu nodes programmatically instead of reading ppu files, so i need examples of that type. i'm just starting to look through them. Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16090#16090 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] X-ray Design use of OsgPPU
Hi, for the thickness it's actually a fixed data for the geometry (not really thickness). It's only thickness in the analogue of the x-ray model. It's geometry dependent data, and for starting out adding this data item and/or having only the one value will do. I'm just looking for the best design using osg. So with that, maybe osgVolume is not necessary. I have userdata and/or node callbacks to get this data for each geometry (e.g., Uniform callback for the vertex shader all using the same var name). I found your slicing idea in osgppu interesting. So, given this thickness as data and not requiring geometry calculation, how would you see going at it? Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16106#16106 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPPU] X-ray Design use of OsgPPU
Hi, yes view dependent ok. imagine a vehicle, each geode is a panel and the panel has a thickness. i plan to set a distance for the x-ray and a viewing angle (about z, assume constant elevation (about x or y), render a frame and see what interior geometry fraction shows through by counting the pixels as the ratio of num of colored pixels. for the next frame, the viewing angle and/or distance will change. Note that the distance only serves to effect the power (vs thickness) of the x-ray so that as the viewing pos is closer more penetration can occur. i would be interested in how to set this up as a multi-render ppu arrangement. My geometry is in a file, but there are several other nodes i create programmatically to make all this work. My problem is i'm very new with textures and shading and it's difficult to debug, compared to the usual development approach. right now i don't know the best way to set up the shader / texture / pixel objects. I'm ok with the osg nodes and have the transforms and callbacks ok. even the uniforms per geode are ok. i'm looking at depthpeeling and several other examples from osg to find the way to go with the shader pixel analysis parts. ... Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16111#16111 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] complete copy of my scenegraph
Hi All, as I'm trying to set up my scenegraph for rendering in two ways, I'm thinking I want 2 complete copies: one to set callbacks and statesets on for the shader-version and another to have that user can throw without any of this stuff. Then I can user the viewer::setSceneData to swap them. Can I do this simply by using CopyOp::DEEP_COPY_ALL? Thanks, Bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] order of update callbacks
Hi All, is there a defined order for update callbacks? I see examples of interest to me about Uniform updatecallbacks for shaders (osgparametric), and I have Group node updatecallbacks, and I'm trying to understand the ordering of them in case I have to worry about dependencies between them. Thanks, Bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] multiple camera design question
Hi All, I have a design question about using multiple cameras (one with shader, pre-render to texture, etc. and one for the user vis., for example). Is it better to build separate node graphs for each camera, or to use mask/flags and switch settings to control the rendering, with a single node graph? My node graphs are very simple. Thanks, Bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] setSceneData vs camera-addChild
Hi All, I have a single viewer/view based architecture with multiple cameras/slaves, and I don't understand the relation between viewer-setSceneData and camera-addChild. Can I not use addChild to render different graphs to the view? Should I be removing the graph from the scene, in which case what do the slave cameras render? Thanks, Bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] setSceneData vs camera-addChild
Hi, thanks a lot. you guys rock! osg would be nothing without your support. ... Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15517#15517 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] shader newbie question
Hi All, I'm starting to develop shader, texture, uniform, etc. code for our app and I have what's probably a very simple question. I understand these shader-related objects live in the Stateset, and in most examples I see the stateset being set on osg::Geometry within osg:Geodes. If I have an externally loaded model with lots of Geometry and Geode objects, and they all will use the same shader and data, can I put the stateset containing the stuff in the root Group node, or should I replicate it myself to all the individual nodes (e.g., using update callbacks). I would think that if I have a stateset on the Group that acts as the root node, then all the child objects will get their shader stuff ok, right? Even if there's only one stateset object created, do I still have to set it for the geometry nodes, or will they inherit from the parent path? Thanks, bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osg dll versions
Hi, what's the preferred way to tell which version an osg55-osg.dll is build from, say 2.8.0 vs 2.8.1. Is there no versioning resource in the dll (e.g., Windows resource)? Is there an easy way to tell which version osg55-osg.dll is? Thanks, Bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg dll versions
Hi, but what if i have a team of developers and they're not working on osg components, and i ask them to get these new binaries (i build them, they don't). Then later, there's no better way to tell what versions they have than looking at the date/time and/or file sizes (they're not sure if they did it or not)? can't we have better version control than that? i realize i'm on a particular platform (win32). is there no in-file versioning possible? can there be an osg version function to return a string or a version object stating the version (2.8.0 vs 2.8.1) so we can unequivocally know what version someone is running and display it in Help, About, or some other startup info? Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15196#15196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osg dll versions
Hi, very helpful group is osg. Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15200#15200 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frame rate faster than monitor vsync?
We're doing computations with the 3D engine, getting images, color histograms, etc. at different model parameter settings, 1 change for each frame, so the faster we can render the better. Can one change vsync dynamically, at any time, just by changing vsync setting in the traits? bob -Original Message- From: Paul Speed [mailto:psp...@progeeks.com] Sent: Saturday, July 11, 2009 9:01 PM To: OpenSceneGraph Users Subject: Re: [osg-users] frame rate faster than monitor vsync? I have to be pedantic here... the eye can most _certainly_ detect movement beyond 60 hz. But there is no point in displaying faster than that if your display can't render faster than 60 hz. There are good reasons to do so, though. For example, to test rendering speed to get good benchmarking for seeing how much CPU your rendering code is wasting. Alternately, there are certain situations where one may be driving sensing equipment that wants higher refresh. Of course, then the display is expecting that refresh or whatever is receiving the output... so we still come back to driving your display at what your display expects. Or benchmarking. -Paul Philip Taylor wrote: Wyatt, Out of very idle curiosity, why would you render at 2KHz when the eye can't really detect movement beyond 60Hz? Would it just be for rendering individual frames for a movie? PhilT -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org]on Behalf Of Wyatt Earp Sent: 11 July 2009 19:08 To: OpenSceneGraph Users Subject: Re: [osg-users] frame rate faster than monitor vsync? I have renderered in excess of 2 KHz on ocassion. Wyatt On 7/11/09, Ulrich Hertlein u.hertl...@sandbox.de wrote: Hi Bob, On 10/7/09 9:05 PM, Bob Youmans wrote: Hi, does anyone know if it's possible to run faster than the 60Hz vsync or 100Hz osg limit, if computational performance is the ultimate goal even at the expense of tearing. Can I get 600 fps by turning off vsync (or something else, it didn't work on my box)? Is the graphics card driver/model involved? How can you tell which ones will work without actually buying it? If you turn off vsync then OSG will render as fast as possible, without any artificial limitation. There's no 100 Hz OSG limit that I'm aware of except maybe in the DB pager. Sure you can get 600 fps if you're willing to accept tearing (or render offscreen), even my GeForce 8600M GT laptop gives me over 1000 fps for moderately complex models. And yes, the graphics card is obviously involved (the faster the better) and so is the driver. If you're not seeing more than vsync fps then the reason is most likely due to setup, e.g. a driver settings forcing vsync on or __GL_SYNC_TO_VBLANK being set on Linux. Cheers, /ulrich ___ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] frame rate faster than monitor vsync?
Hi all, here's how I'm turning off vsync and it's not having any effect. Any ideas. This setup is based on one of the examples, C++ / Windows / Vista. I have dual monitors. Would that make any difference? Thanks, Bob // Local Variable to hold window size data RECT rect; // Create the viewer for this window m_pViewer = new CTOSOM_OSGViewer(this); // Add a Stats Handler to the viewer m_pViewer-addEventHandler(new osgViewer::StatsHandler); m_pViewer-addEventHandler(new TOSOM_OSGkeyboardEventHandler); // Get the current window size ::GetWindowRect(m_hWnd, rect); // Init the GraphicsContext Traits osg::ref_ptrosg::GraphicsContext::Traits traits = new osg::GraphicsContext::Traits; // Init the Windata Variable that holds the handle for the Window to display OSG in. osg::ref_ptrosg::Referenced windata = new osgViewer::GraphicsWindowWin32::WindowData(m_hWnd); // Setup the traits parameters traits-x = 0; traits-y = 0; traits-width = rect.right - rect.left; traits-height = rect.bottom - rect.top; traits-windowDecoration = false; traits-doubleBuffer = true; traits-sharedContext = 0; traits-setInheritedWindowPixelFormat = true; traits-inheritedWindowData = windata; traits-vsync = false; // Create the Graphics Context osg::GraphicsContext* gc = osg::GraphicsContext::createGraphicsContext(traits.get()); // Init a new Camera (Master for this View) osg::ref_ptrosg::Camera camera = new osg::Camera; // RLY set CullingMode camera-setCullingMode(osg::CullSettings::NO_CULLING); // Assign Graphics Context to the Camera camera-setGraphicsContext(gc); // Set the viewport for the Camera camera-setViewport(new osg::Viewport(traits-x, traits-y, traits-width, traits-height)); // RLY - set ortho projection camera-setProjectionMatrixAsOrtho(-5000, 5000, -5000, 5000, -5000, 5000); // Add the Camera to the Viewer m_pViewer-addSlave(camera.get()); // Add the Camera Manipulator to the Viewer m_pViewer-setCameraManipulator(m_pswitchManipulator.get()); // Set the Scene Data m_pViewer-setSceneData(m_pRoot.get()); // Realize the Viewer m_pViewer-realize(); } -Original Message- From: Ulrich Hertlein [mailto:u.hertl...@sandbox.de] Sent: Saturday, July 11, 2009 8:26 AM To: OpenSceneGraph Users Subject: Re: [osg-users] frame rate faster than monitor vsync? Hi Bob, On 10/7/09 9:05 PM, Bob Youmans wrote: Hi, does anyone know if it’s possible to run faster than the 60Hz vsync or 100Hz osg limit, if computational performance is the ultimate goal even at the expense of “tearing.” Can I get 600 fps by turning off vsync (or something else, it didn’t work on my box)? Is the graphics card driver/model involved? How can you tell which ones will work without actually buying it? If you turn off vsync then OSG will render as fast as possible, without any artificial limitation. There's no 100 Hz OSG limit that I'm aware of except maybe in the DB pager. Sure you can get 600 fps if you're willing to accept tearing (or render offscreen), even my GeForce 8600M GT laptop gives me over 1000 fps for moderately complex models. And yes, the graphics card is obviously involved (the faster the better) and so is the driver. If you're not seeing more than vsync fps then the reason is most likely due to setup, e.g. a driver settings forcing vsync on or __GL_SYNC_TO_VBLANK being set on Linux. Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] vsync false doesn't change frame rate
Hi all, I'm trying to get frame rates above 60Hz, and when I set the traits-vsync = false it has no effect. I'm getting the default camera created by the View in the Viewer and re-setting its traits. Is that not the right approach? Thanks, Bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] frame rate faster than monitor vsync?
Hi, does anyone know if it's possible to run faster than the 60Hz vsync or 100Hz osg limit, if computational performance is the ultimate goal even at the expense of tearing. Can I get 600 fps by turning off vsync (or something else, it didn't work on my box)? Is the graphics card driver/model involved? How can you tell which ones will work without actually buying it? Thanks, Bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to set per vertext attributes using osg
Thanks for the help, What I'm going to need is per geometry (e.g., osgGeometry::BIND_OVERALL), the shader attribute values will be the same for each Geode (e.g., model part). I just can't find any examples of the best way to do the binding and update the values each frame. I can probably figure something out, but I'm looking for the trail already blazed. Thanks, Bob -Original Message- From: Thrall, Bryan [mailto:bryan.thr...@flightsafety.com] Sent: Wednesday, July 08, 2009 4:05 PM To: OpenSceneGraph Users Subject: Re: [osg-users] how to set per vertext attributes using osg Bob Youmans wrote on Wednesday, July 08, 2009 3:51 PM: Hi all, I'm trying to figure out the best method to pass per vertex attributes to shaders using osg and I can't seem to find many examples of attribute use. My guess is there's a reason for that and I should probably code up a uniform array of some kind instead. I need to pass thickness as an attribute and that varies with the geometry / osg::Geode. I've studied the osg::Drawable and its attribute types, and the osg::Program and its addBindAttribLocation, but I can't find any examples of the callback or other mechanism to actually get the data set into the attributes from the scenegraph. I must be missing something, and I'm really new at this shader stuff. Can anybody point me in the right direction? Should I not try to use shader attributes, but instead use a uniform array and look up my data in there? If I do use shader attributes, where's an example? Using a normal array is unlikely to allow a big enough array for all your vertices :) See osg::Geometry::setVertexAttribArray(), setVertexAttribBinding(), etc. It doesn't look like there are any examples for using vertex attributes, though. -- Bryan Thrall FlightSafety International bryan.thr...@flightsafety.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to set per vertext attributes using osg
Hi J-S, thanks for your helpful insights. I'm brand new to this shader stuff (osg::Programs, etc.), but I'm doing ok on the scenegraphs, nodes and callbacks. I've also got a lot more to learn about multiple cameras, render-to-texture, etc. I think my data items are going to be per Geode (e.g., thickness of a part), but I thought I still needed shader attributes instead of uniforms, because uniforms are per frame. Unless you're thinking I'd make an array of them where the indexing is the Geodes? Bob -Original Message- From: Jean-Sébastien Guay [mailto:jean-sebastien.g...@cm-labs.com] Sent: Wednesday, July 08, 2009 9:14 PM To: OpenSceneGraph Users Subject: Re: [osg-users] how to set per vertext attributes using osg Hi Bob, Hi all, Im trying to figure out the best method to pass per vertex attributes to shaders using osg and I cant seem to find many examples of attribute use. My guess is theres a reason for that and I should probably code up a uniform array of some kind instead. There's no reason other than no example has been made yet. Mike Weiblen's osgtoy-data repository has a compactdisc.osg file that shows that attributes work. It's a single .osg file that contains the model and the shaders to show a compact disc with the color diffraction effect (different colors visible depending on the viewing angle). There's also a compactdisc-texcoord.osg file that does the same thing using one of the texcoord arrays. That's always an option, btw, you can just co-opt one of the unused arrays from the fixed pipeline (like texcoord for texture unit 1 if your model uses a single texture on unit 0). Of course having a data file that has attributes won't show you how to use them in your program, and how to update them when you need to, but at least it proves that they're usable. I need to pass thickness as an attribute and that varies with the geometry / osg::Geode. Does it vary based on the geode, or on the geometry's vertices? The sentence above is very ambiguous. If you need just one value per geode, you can perfectly well use a single uniform. Attributes are for when things vary per vertex. Ive studied the osg::Drawable and its attribute types, and the osg::Program and its addBindAttribLocation, but I cant find any examples of the callback or other mechanism to actually get the data set into the attributes from the scenegraph. Well, that's because it's kind of up to you. Once you've set your attribute array in the geometry object, and called addBindAttribLocation to tell the program that a given attribute location potentially has data in it, you can fill in the data however you like. If your attributes don't change you can set them once at startup. If they vary per frame then you'll want to either put an update callback somewhere or break up your frame loop and then do your calculations there. (I personally prefer update callbacks, that way a given node can do all the work it has to do without needing to modify any other parts of the program, but that's just a preference) Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.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 set per vertext attributes using osg
Thanks. Ill definitely check it out. From: Ümit Uzun [mailto:umituzu...@gmail.com] Sent: Thursday, July 09, 2009 5:14 AM To: OpenSceneGraph Users Subject: Re: [osg-users] how to set per vertext attributes using osg Hi Bob; I had created sample Bump Mapping Effect with OSG and used TangentSpaceGenerator and Attributes and Uniforms as you need. Hope this helps. Download : http://www.fileden.com/files/2007/9/10/1423182/BumpMapping.rar Regards. 2009/7/9 Wang Rui wangra...@gmail.com Hi, I remember there is some code using TangentSpaceGenerator and setVertexAttribArray(), but I can't find them in current OpenSceneGraph version: ... osg::ref_ptrosgUtil::TangentSpaceGenerator tsg = new osgUtil::TangentSpaceGenerator; tsg-generate(geo, 0); geo-setVertexAttribArray(6, tsg-getTangentArray()); geo-setVertexAttribBinding(6, osg::Geometry::BIND_PER_VERTEX); ... Wang Rui ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ümit Uzun ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] how to set per vertext attributes using osg
Hi all, I'm trying to figure out the best method to pass per vertex attributes to shaders using osg and I can't seem to find many examples of attribute use. My guess is there's a reason for that and I should probably code up a uniform array of some kind instead. I need to pass thickness as an attribute and that varies with the geometry / osg::Geode. I've studied the osg::Drawable and its attribute types, and the osg::Program and its addBindAttribLocation, but I can't find any examples of the callback or other mechanism to actually get the data set into the attributes from the scenegraph. I must be missing something, and I'm really new at this shader stuff. Can anybody point me in the right direction? Should I not try to use shader attributes, but instead use a uniform array and look up my data in there? If I do use shader attributes, where's an example? Thanks for the help, Bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] screen capture or render to texture
Hi, i'm going to be rendering to an image that will then be further analyzed by other routines (e.g., color histogram, etc.) automatically, for each frame, where each frame has it position set by a callback or matrixmanipulator. I see the screencapture example, and my question is that the best way to get the image, or should i have a camera or other objects render to a texture and get the result that way? osgscreencapture looks pretty complex. which approach is best or are they equivalent? thanks for the expert advice, gurus. Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14419#14419 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] multiple render targets / cameras
Hi, thanks for the great advice. if i'm going to have 2 render targets, one a memory image (ultimately custom shader) and one the GUI view window, should i still use Viewer, or CompositeViewer? It would be nice to be able to turn off the visible one for more performance. They will have exactly the same transform matrix, but be different resolutions. So, i need to switch between user / program control of the transformation matrix, and also switch between rendering the memory / visible images (or both). Is this doable? Does it make sense? Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14052#14052 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] multiple render targets / cameras
Hi, thanks to the gurus for all the excellent guidance you provide to us lesser mortals.. I can likely mush my way through this but I wanted to ask the opinions of the osg gurus on my design approach before getting mired down in a less desirable approach. We have a geometry graph that we want to render to two separate places: (1) a bitmap image for additional automated analysis or use downstream in a shader (that will also render to a similarly sized memory image), and (2) the window context that can show the progress on the display, but not necessarily replicate exactly the underlying hi-resolution image in memory, for performance reasons. They'll probably have different resolutions, say 1024 x 1024 for the bitmap and whatever window size the user sets for the display. I'm thinking two separate cameras, and I've seen in the examples (osg distortion?) where the bitmap is setup, and I've also seen in other posts several discussions about multiple camera for multiple views. Then, I need to have these cameras under program control, say, iterating a rotation angle in 1 deg increments, and iterating the distance over some range and increment (or the corresponding camera position), drawing a frame of each (and ultimately processing the resulting image with downstream algorithms and code). Real time frame rates are probably not a reasonable expectation for this analyzer. I want the view version to give low-res feedback about the progress and correctness of the underlying hi-res memory image processing. My questions are currently: 1.What's the best way to connect the two cameras so they're the same position orientation, only rendering to different targets (e.g., update the matrix of one with the other using an update traversal, put both under a transform node in a tree, etc.)? 2. What's the best way to programmatically (vs TrackBallManipulator default) control the camera, and/or switch between these methods? Is my design sound, or should I pursue some other approach? If the separate window context with different resolution is a problematic design, I can let go of that, but I think we're really pursuing the memory image processing approach, ultimately needing a shader program and then finally combining two memory bitmaps, respecting the transparency of one, analogous to some kind of specially programmed x-ray view, then extract the transparent parts and average the color of it. Thanks, Bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] multiple render targets / cameras
Hi, about the view and slave cameras, i got it, thanks. one is the lo-res view for the GUI and the other is the hi-res (prerender) view for the memory bitmap. does it matter for the master/slave status for prerender vs the displayed camera. Also, how does one turn these on/off? is that easy to control? ... Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13725#13725 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] multiple render targets / cameras
Hi, regarding matrixmanipulators, almost all the example have TrackBallManipulator as the view's manipulator, separater from the cameras. So, if i have an update callback on a camera to set its (and its slave) position and orientation, how does that interact with a trackballmanipulator. can i remove it from the view and add it back? can i easily toggle on/off the trackballmanipulator, so i can control programmatic vs user control of these master/slave cameras? that would be really nice. Thank you! Cheers, Bob -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13726#13726 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OsgReadFile informations
Maybe it got optimized away? I'm no guru, just a thought. Thanks, bob -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Michael Hasler Sent: Wednesday, April 08, 2009 9:10 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] OsgReadFile informations Hi, Im working on an osg application which need to show some information about osgObject from the Node like name in an TreeView. I start browsing the loaded model with the Debuger to find the Information i need. First i load via ReaderWriterDXF and dxf-file into ReadResult Object. If i watch that result-object in the debuger i can easy find under - _ptr-MatrixTransform-Transform-Geode-_childrean the first object and its name. I write that result into an osgNode File, in which i can find my names as well. (view in editor, osg file attached) If i load that model with readNodeFile(). an browse the ref_ptr(osg::Node) node object i cannot find nothing just one osg::Object no MatrixTransformation but the rendered result is the same !! im working on that all day *cry* pleazz help me somebody how can i acces those information, where is the MatrixTransformation Object gone. Thank you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=9917#9917 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] start/stop viewer
Hello osg-list, I'd like to find the best way to adapt osg::viewer to control its rendering: in one case I want the usual case where viewer-run is doing its thing at 60 fps. But, then, I have other GUI windows (MFC-based) and I want to stop the viewer, and then render a single frame, all using the same geometry. What's the best approach for such a design? Can I (using the examples for MFC) call viewer-stopThreads and then manually render a single frame, and then call run, startThreads, etc. subsequently, and repeat this as often as I like? Thanks, Bob ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] start/stop viewer
Thanks for the very helpful guidance you provide. In the MFC example, I think the .run() method is already replaced by this: //viewer-run(); while(!viewer-done()) { osg-PreFrameUpdate(); viewer-frame(); osg-PostFrameUpdate(); } I understand your suggestion about the details in the frame() call. Here's more detail about my intended use: For example, I want the user to be able to spin the model and look at it, but then click a start button and then (ignoring the user inputs) systematically traverse an axis between some values, and/or viewing angles, and then when finished, let the user look at it again (with the rendering details changed (color transparency, other textures, etc.). I was thinking I could stop the normal viewer threading that responds to user input and then drive it myself from another function.When finished I would restart the viewer to respond to user input. There's probably a better way. Would I be better off using update traversals, animation stuff, or some other osg design I haven't learned yet? How about osgPPU? What do you think of it? Thanks, bob From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: Monday, April 06, 2009 2:37 PM To: OpenSceneGraph Users Subject: Re: [osg-users] start/stop viewer Hi Bob, The viewer only renders a frame when you call viewer.frame(). If you are calling the convenience function viewer.run() then just replace this run call with the constuent parts of Viewer::run() i.e. while(!viewer.done()) { viewer.advance(); viewer.eventTraversal(); viewer.updateTraversal(); viewer.renderingTraversals(); } Robert. On Mon, Apr 6, 2009 at 6:56 PM, Bob Youmans byoum...@knology.net wrote: Hello osg-list, I'd like to find the best way to adapt osg::viewer to control its rendering: in one case I want the usual case where viewer-run is doing its thing at 60 fps. But, then, I have other GUI windows (MFC-based) and I want to stop the viewer, and then render a single frame, all using the same geometry. What's the best approach for such a design? Can I (using the examples for MFC) call viewer-stopThreads and then manually render a single frame, and then call run, startThreads, etc. subsequently, and repeat this as often as I like? Thanks, Bob ___ 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] design osg xray style viewer
Hello, We are investigating the design of an app to produce images of geometry objects where some objects are inside others, and we want a custom / flexible algorithm to control the render color of the hidden objects, using an X-ray analogy, where shielding / other data properties of some geometry nodes (i.e., the shell) would be used to control the display of other nodes (e.g., the core). We'd like to hear your opinions on the best methods to approach this using osg. Custom CullVisitor, Custom DrawCallback, GLSL / shader programming, etc.? Would separate geodes be preferable to light sources for the rays? Are there existing similar applications? Thanks in advance, Bob Youmans ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] design osg xray style viewer
Thanks. I guess I don't know yet. just getting started with it. bob From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Paul Martz Sent: Tuesday, March 31, 2009 1:05 PM To: 'OpenSceneGraph Users' Subject: Re: [osg-users] design osg xray style viewer Have you taken a look at osgVolume, or perhaps the depth peeling example? I don't know whether you want true volume visualization, or just simple transparency would suffice, so I'm directing you to both. Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com http://www.skew-matrix.com/ +1 303 859 9466 _ From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Bob Youmans Sent: Tuesday, March 31, 2009 11:17 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] design osg xray style viewer Hello, We are investigating the design of an app to produce images of geometry objects where some objects are inside others, and we want a custom / flexible algorithm to control the render color of the hidden objects, using an X-ray analogy, where shielding / other data properties of some geometry nodes (i.e., the shell) would be used to control the display of other nodes (e.g., the core). We'd like to hear your opinions on the best methods to approach this using osg. Custom CullVisitor, Custom DrawCallback, GLSL / shader programming, etc.? Would separate geodes be preferable to light sources for the rays? Are there existing similar applications? Thanks in advance, Bob Youmans ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org