[osg-users] How does each object set its own light parameters?

2008-08-28 Thread guilianzhang
Hi, I build a scene using osg which is composed of many objects and many lights, I want to traverse each object to find the nearest light away from it and associate the light with GL_LIGHT0, so each object has its own GL_LIGHT0 parameters. The problem is that the light is added to the scene

[osg-users] Disable Shader

2008-08-28 Thread Christian.Hoffmann
Hi! I have a short question about Shaders: How can I disable a Shader? osg::StateSet* ss = m_pNode-getOrCreateStateSet(); ss-setAttributeAndModes(m_program.get(), osg::StateAttribute::OFF); Does not work, even if I set it for the first time. Where is the trick? Thanks in advance, Christian

Re: [osg-users] How does each object set its own light parameters?

2008-08-28 Thread Robert Osfield
Hi Gulianzhang (BTW, do you have a shorted name we could use?) Management of lights is complicated by the fact the lights are positional state i.e. they rely on specific values of the modelview matrix to position them in the right place so you can't them apply arbitrary times with arbitrary

Re: [osg-users] PageLOD Terrain Database

2008-08-28 Thread J.P. Delport
Hi, also see the code for osgSim OverlayNode. jp Pablo Perez wrote: Hi Robert and osg-users, I have added a TexGenNode but i´m a newbie in OSG and i dont know why it cant works. This is the code that i have added.When I execute the osgviewer with this code, it only shows the terrain model

Re: [osg-users] Disable Shader

2008-08-28 Thread Robert Osfield
Hi Christian, Unfortunately you can disable GLSL programs (shaders), as OpenGL itself doesn't support glEnable/glDisable of GLSL programs. If you wish to toggle between the fixed function pipeline and using a GLSL program then you have to remove the Program i.e.

Re: [osg-users] Disable Shader

2008-08-28 Thread Art Tevs
You can also just add an empty program to the StateSet. Something like this: ss-setAttributeAndModes(new osg::Program()); This will bind a program object which will call glUseProgram(0) on the next apply, which is in fact the same as disable a shader program. Cheers, art --- Robert Osfield

Re: [osg-users] About the DICOM loader

2008-08-28 Thread Iván Macía
Dear Hesicong, Robert, I have some experience using ITK. ITK relies now on GDCM library to read DICOM files. http://www.creatis.insa-lyon.fr/Public/Gdcm/ GDCM focuses on the part of the DICOM protocol related to the image format and representation whereas DCMTK covers most of the standard which

Re: [osg-users] About the DICOM loader

2008-08-28 Thread Iván Macía
Sorry, forgot to send some relevant links http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html http://www.itk.org/Doxygen/html/classitk_1_1ImageFileReader.html http://www.itk.org/Doxygen/html/classitk_1_1ImageSeriesReader.html

Re: [osg-users] About the DICOM loader

2008-08-28 Thread sicong he
Hi, Ivan, That's a good suggestion. It's good to see that OSG integerate with ITK. I'm now doing some research to integerate VTK and OSG. Hope integration ITK with OSG will make things easier. Of course, it's no use to only use a DICOM loader in OSG but the other part. I hope OSG will go farther

Re: [osg-users] About the DICOM loader

2008-08-28 Thread Robert Osfield
Hi Ivan, Many thanks for info about GDCM. Just downloaded and built it - no problems. Nice to see CMake in action in both ITK and GDCM. Do you have any ideas when GDCM 2.0 might be out? Another question for the ITK community would be their own plans for moving for to later versions of GDCM.

Re: [osg-users] Creating Contours?

2008-08-28 Thread Robert Osfield
Hi Sam, The easiest way to create a contour is to use TexGen/TexGenNode and 1d texturing, the osgtexture1D example provides code that does this. Robert. On Thu, Aug 28, 2008 at 12:43 PM, Sam [EMAIL PROTECTED] wrote: Hello, I am looking for a way to render a model as a contour only. Like this

Re: [osg-users] SKYBOX ?

2008-08-28 Thread Jean-Sébastien Guay
Hello Nao, I tried the following code by Jean-Sébastien, and it worked great. Thank you! Great to know it was of some use. - The texture on the skybox gets magnified quite largely. If I use 512x512 image as texture, my entire screen gets occupied by probably 200x150 portion of it. As a

[osg-users] Building static osg and dynamic plugins dlls

2008-08-28 Thread Schmidt, Richard
Hi, I wonder if it's possible to build osg statically and the plugin dlls dynamically?! Looking at the code currently it does not seem to be possible. The main reason seems to be the static variables (like the registry). Instead of referencing it by the plugin, the pointer of the registry should

Re: [osg-users] Disable Shader

2008-08-28 Thread Tomlinson, Gordon
Another way to you could do this is you want to keep the program around to reuse later Is to remove the shaders from the program m_rvShadeProgram-removeShader(m_mainVertexShader) To re-enable do m_rvShadeProgram-AddShader(m_mainVertexShader) This works nice for our usage, note you will need

Re: [osg-users] Building static osg and dynamic plugins dlls

2008-08-28 Thread Robert Osfield
Hi Richard, On Thu, Aug 28, 2008 at 1:11 PM, Schmidt, Richard [EMAIL PROTECTED] wrote: I wonder if it's possible to build osg statically and the plugin dlls dynamically?! Looking at the code currently it does not seem to be possible. The main reason seems to be the static variables (like the

Re: [osg-users] Creating Contours?

2008-08-28 Thread Sam
Hello, I must admit that without a comment osgtexture1 is not very clear to me. I see how it creates colored stripes onto the texture but cannot spot any contour related information. TextGen creates coords but how does that help me? Thanks Sam

[osg-users] adaptation of chunkLOD to OSG

2008-08-28 Thread [EMAIL PROTECTED]
has anyone the code of adaptation of chunkLOD to OSG by Vladimir Vukicevic? the websites from him are all down. it is about http://tulrich.com/geekstuff/chunklod.html kind regards ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] adaptation of chunkLOD to OSG

2008-08-28 Thread Norman Vine
hannes_b writes: has anyone the code of adaptation of chunkLOD to OSG by Vladimir Vukicevic? the websites from him are all down. it is about http://tulrich.com/geekstuff/chunklod.html Maybe http://web.archive.org/web/20070428001632/http://www.vlad1.com/~vladimir/pro jects/osg/ HTH

[osg-users] Bug with hdr data rescaling in a texture 2D

2008-08-28 Thread josselin . petit
Hi all, I think there is a bug when we rescale an hdr image in a 16 bits texture : I can see strange colors where values are greater than 1.0, but when we rescale the hdr image with an other software, the image is fine. Is it a known bug ? Thanks in advance, Josselin.

Re: [osg-users] adaptation of chunkLOD to OSG

2008-08-28 Thread Robert Osfield
Hi Hannes, The OSG has native database paging rather nullifies the need for a ChunkLOD implementation. Vladimir's previous work on ChunkLOD/OSG implementation was done before VirtualPlanetBuilder/osgTerrain/osgDB::DatabasePager really got off the ground. Robert. On Thu, Aug 28, 2008 at 2:58

Re: [osg-users] adaptation of chunkLOD to OSG

2008-08-28 Thread [EMAIL PROTECTED]
Norman Vine wrote: hannes_b writes: has anyone the code of adaptation of chunkLOD to OSG by Vladimir Vukicevic? the websites from him are all down. it is about http://tulrich.com/geekstuff/chunklod.html Maybe http://web.archive.org/web/20070428001632/http://www.vlad1.com/~vladimir/pro

Re: [osg-users] Bug with hdr data rescaling in a texture 2D

2008-08-28 Thread Robert Osfield
On Thu, Aug 28, 2008 at 3:29 PM, [EMAIL PROTECTED] wrote: Hi all, I think there is a bug when we rescale an hdr image in a 16 bits texture : I can see strange colors where values are greater than 1.0, but when we rescale the hdr image with an other software, the image is fine. Is it a

Re: [osg-users] OSG method for pushing/ popping entire openGL state machine?

2008-08-28 Thread Andy Skinner
Robert, I've got a drawImplementation() method that gets the projection and modelview matrices and does something with them, pushes both matrices and sets up pixel coordinates (glOrtho in projection, glLoadIdentity in modelview), calls osg::Geometry::drawImplementation(), and then does the pops

Re: [osg-users] OSG method for pushing/ popping entire openGLstate machine?

2008-08-28 Thread Paul Martz
Could you give guidance about the sorts of things I'd have to do if there are vertex arrays still around? Are you doing glPushClientAttrib/glPopClientAttrib? -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] About the DICOM loader

2008-08-28 Thread Ivan Macia
Hi Robert, There are two major versions of GDCM, 1.x (current version 1.3.1 or so) and 2.x (currently 2.0.8). They are not compatible. GDCM 2.x seems to be much faster parsing and also covers some parts of the protocol outside the scope of the image representation. Both seem to be currently

Re: [osg-users] OSG method for pushing/ popping entire openGLstate machine?

2008-08-28 Thread Andy Skinner
I'm not, but I'm pushing and popping the matrices. I didn't think I was changing anything else. andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Martz Sent: Thursday, August 28, 2008 11:11 AM To: 'OpenSceneGraph Users' Subject: Re: [osg-users]

Re: [osg-users] About the DICOM loader

2008-08-28 Thread Robert Osfield
Thanks for extra links and info Ivan. I've download 2.0.8 and compile and check it out. On Thu, Aug 28, 2008 at 4:27 PM, Ivan Macia [EMAIL PROTECTED] wrote: Hi Robert, There are two major versions of GDCM, 1.x (current version 1.3.1 or so) and 2.x (currently 2.0.8). They are not compatible.

Re: [osg-users] How does each object set its own light

2008-08-28 Thread Terry Welsh
Hi Gulianzhang, We had a long thread discussing a similar problem a while ago. As a result I have been using shaders to apply different lights to different parts of a scene, and it is working quite well: http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg05683.html - Terry

[osg-users] terrain generation question...

2008-08-28 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Hello, Using osgdem, I would like to create a simple terrain tile that always displays the highest level of detail for both elevation and texture (no paging, or LOD changes going on) no matter at what distance I view the terrain. Does any know the flag to do this in the osgdem command? Right

Re: [osg-users] Fwd: Strange stateset / shader problem

2008-08-28 Thread Louis Bouchard
Ahh, that's the answer I was looking for. I couldn't test it right away because I was not at work. But I just did and it works perfectly. thanks for your help all of you. On Thu, Aug 28, 2008 at 7:45 AM, Vican, Justin E. [EMAIL PROTECTED] wrote: Hi Louis, When you pass the osg::Program* to

Re: [osg-users] terrain generation question...

2008-08-28 Thread Robert Osfield
Hi Shayne, The main point about VirtualPlanetBuilder/osgdem is generation of paged databases, which are fully LOD'd, it's not at all designed for build small single tiles of terrain. You could build a single chunk of terrain if you upped the tile-image-size and tile-terrain-size from their

Re: [osg-users] terrain generation question...

2008-08-28 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Robert, Thanks for the info. My terrain and image segment is quite simple so it shouldn't crash if I up the tile sizes. I'll try your suggestions... Thanks again, -Shayne -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Osfield Sent: Thursday,

Re: [osg-users] SKYBOX ?

2008-08-28 Thread Naomaru Itoi
Dear Jean-Sebastien, Your advice worked perfectly. Thank you very much! Date: Thu, 28 Aug 2008 08:07:59 -0400 From: Jean-S?bastien Guay [EMAIL PROTECTED] Subject: Re: [osg-users] SKYBOX ? To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Message-ID: [EMAIL PROTECTED] Content-Type:

[osg-users] suggestions for performance using shadowed scenes

2008-08-28 Thread Joseanibal Colon Ramos
Hi all, I've given a trick subject. I don't have any suggestions, but I am looking for some. I have a HUGE terrain which uses paged LOD. I've been trying to implement shadows on my scene using this terrain, but the performance is terrible. Using ShadowTexture technique drops my frame-rate from

[osg-users] Bug or misleading code in Texture2D

2008-08-28 Thread Pecoraro, Alexander N
It seems a little misleading or a bug that Texture2D::getNumImages() always returns 1 even if the _image member variable is NULL. Shouldn't it return 0 if the _image member is NULL? I know it seems odd to have a Texture2D with a NULL _image, but I took a look at the ive reader and it appears

[osg-users] How to hide a RTT camera's clear color [SOLVED]

2008-08-28 Thread Eduardo Alberto Hernández Muñoz
Hi list, just in case another soul has a similar issue; setting the render implementation to anything but the frame buffer ( and obviously a separate window ) works fine. The slowness with FBOs was caused because I was filling up my modest 64MB videocard's memory. My bad. So if the same happens

Re: [osg-users] suggestions for performance using shadowed scenes

2008-08-28 Thread Jean-Sébastien Guay
Hello Jose, I have a HUGE terrain which uses paged LOD. ... Using ShadowTexture technique drops my frame-rate from 60+ to low 30's to high teens. ... Finally, using ShadowMap puts OSG on its knees at ~6 fps. You neglected to tell us what kind of hardware you're using, and what version

[osg-users] About Image~~

2008-08-28 Thread GuiYe
  Hello~~ I want to ask a question about how to write(osgDB::writeImageFile()) a capture_screen_image that I hope it's size bigger than the window size into the disk.For example,my window size is 1280*1024,but the size of image is 2560*1024.I use scaleImage(),but it doesn't work.

Re: [osg-users] Intersection

2008-08-28 Thread Jean-Sébastien Guay
Hello weihe, i just want to know hoe did you do this:I think I may be able to help a bit regarding the higher-level setup and bookkeeping changes needed to speed things up on that regard,can you explain it in detail,thanks very much! I was referring to *future* benchmarking, profiling and