[osg-users] Geodes VS Shaders

2009-05-11 Thread Maxime BOUCHER
Hi, It's me again. In order to implement a nice Projective Texture Mapping, I want to project on all visible primitives, and only it. Maybe I'm wrong, and if I am, please tell me, but I projective-texture-map using osg::TexGen that I only can apply on Groups or Geodes (well, anything

Re: [osg-users] Geodes VS Shaders

2009-05-11 Thread Maxime BOUCHER
scene, a single one attached to a single TexGenNode is all that you require, so it really isn't an issue of Geodes vs Shaders, projective texturing in the OSG is completely orthogonal, you can use it with or without shaders. Robert. On Mon, May 11, 2009 at 3:27 PM, Maxime BOUCHER wrote

Re: [osg-users] Geodes VS Shaders

2009-05-12 Thread Maxime BOUCHER
Thus, the question remains... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=11876#11876 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] Geodes VS Shaders

2009-05-12 Thread Maxime BOUCHER
Well, thanks anyway and I apologize if I bothered you. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=11883#11883 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] render depth buffer to image for one time

2009-05-15 Thread Maxime BOUCHER
Hi! jojo wrote: As I understand, the command camera-attach(osg::Camera::COLOR_BUFFER, depth.get(),0,0); tells osg, that I want the color buffer of the camera to be stored in the image depth. This works, but when I change it to camera-attach(osg::Camera::DEPTH_BUFFER, depth.get(),0,0); I

Re: [osg-users] render depth buffer to image for one time

2009-05-15 Thread Maxime BOUCHER
Thanks. I tried but it does'nt change the results. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=12208#12208 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] render depth buffer to image for one time

2009-05-15 Thread Maxime BOUCHER
jojo wrote: GL_LUMINANCE is for gray scale images. For example if you want to save the depth buffer. Ok, thus, I should use GL_RGBA. jojo wrote: Besides you should post a little bit more code. I don't know how much experience your have with open scene graph. Maybe you didn't call the

Re: [osg-users] render depth buffer to image for one time

2009-05-15 Thread Maxime BOUCHER
I forgot: thanks for everything! -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=12272#12272 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] render depth buffer to image for one time

2009-05-18 Thread Maxime BOUCHER
Alright, for whom it may concerns, it's all in the GraphicsContext especially in the pixel buffer. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=12367#12367 ___ osg-users mailing list

Re: [osg-users] OSG_OpenCV Help

2009-05-18 Thread Maxime BOUCHER
Hi, What I did: I created a class in which I setted frames from the video as textures (using setImage), and refreshed these textures using a callback. It works fine, but is maybe unadapted to your problem. About setImage: I used GL_RGB8 where you tried 3, and GL_BGR as the following argument (I

Re: [osg-users] render depth buffer to image for one time

2009-05-18 Thread Maxime BOUCHER
Hi, Please excuse all my spam... I tried the almost same code than mister Jojo. I tried 2 instances: -One using a created camera diffrent from the viewer's one. -The other using the viewer's camera. In the first case, I can grab the color image, but the camera isn't oriented at all as I tell it

Re: [osg-users] OSG_OpenCV Help

2009-05-18 Thread Maxime BOUCHER
Well, these are things I ignore. I just can suggest you to grab each frame, using a timer to retrieve at the good time and skip some if the process isn't fast enough, and to dirty your image so that you call setImage only once (because it's heavy and unnecessary). -- Read this

Re: [osg-users] Accessing Texture Indices

2009-05-27 Thread Maxime BOUCHER
omaralvi wrote: Hello guys, I am new to osg. I have loaded an obj file using osgDB but I don't know how to access vertex and texture indices. I can get the vertex array from the geometry using pGeo.get()-getVertexArray()  method but pGeo.get()-getVertexIndices() returns null.  I cant

[osg-users] Attack the PrimitiveSet

2009-05-27 Thread Maxime BOUCHER
Hi, I'm currently attacking the primitives of my scene and I would like to remove some of them from my one of my PrimitiveSets. A very ugly and heavy solution would be to copy the existing one but the indices I want to remove . As I say, it's very ugly and as I want to remove a lot of

Re: [osg-users] Attack the PrimitiveSet

2009-05-27 Thread Maxime BOUCHER
Thanks for replying! Paul Melis wrote: What kind of PrimitiveSet do you want to erase elements from? E.g. all DrawElementsXXX classes derive from std::vector, so you should be able to use the methods from vector on those. OK, it's interesting. I mainly work on DrawArrayLength. What can

Re: [osg-users] Attack the PrimitiveSet

2009-05-27 Thread Maxime BOUCHER
Paul Melis wrote: class OSG_EXPORT DrawArrayLengths : public PrimitiveSet, public VectorGLsizei { public: [...] where VectorGLsizei is (basically) std::vectorGLsizei. So you can just do osg::DrawArrayLengths *arr = new osg::DrawArrayLengths(); arr-push_back(5);

[osg-users] Constrain primitiveset type using osgconv

2009-05-28 Thread Maxime BOUCHER
Hi, I wonder: While using osgconv (for example on a .dae to .osg) is it possible to restrain the type of the PrimitiveSet ? Thank you! Cheers, Maxime -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13085#13085

Re: [osg-users] Attack the PrimitiveSet

2009-05-28 Thread Maxime BOUCHER
You're right, it 's not that hard. Actually, indices are stored in a VertexIndices IntArray. Whereas they are directly stored in the PrimitiveSet for a DrawElement. If someone knows why there are these several types for PrimitiveSets, and especially this difference between DrawArrayLengths and

[osg-users] [N00b] Number of Primitives in a PrimitiveSet

2009-06-02 Thread Maxime BOUCHER
Hello everybody, I have 2 questions for you today ;). 1) The BIG one: What is the max number of primitives I can put in a single PrimitiveSet in order to get an efficient rendering? 2)Really less important: I created a geode to which I added a geometry. To this geometry I added: -A

Re: [osg-users] get the x-axis angle of a rotation

2009-06-03 Thread Maxime BOUCHER
Hi, Your X-rotation is pure in the quaternion. In the matrix all rotations in each plane will be mixed and, except in the case where Y-rotation and Z-rotation are equal to 0, you will get a very perturbated information. But if you really want to get a matrix, you can declare one and then call

Re: [osg-users] get the x-axis angle of a rotation

2009-06-03 Thread Maxime BOUCHER
You really should work with the quaternion. I tried once to avoid it, it was a very bad idea. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13423#13423 ___ osg-users mailing list

Re: [osg-users] Texture coords

2009-06-09 Thread Maxime BOUCHER
Shaitan wrote: Hi all, Sorry for not providing much information about the interest of changing text coords. Im working on animating avatar impostors for which im using a billboard with a texture (sprite) of an avatar. With OSG its easy to implement a special kind of billboard for managing

[osg-users] PolytopeIntersector

2009-06-17 Thread Maxime BOUCHER
Hi, I have a lot of questions for you! But, there is one really more critical than the others. Let me just introduce the problem :). (I am sorry if I bother, but I searched on the net, in the doc and examples and didn't find answers. I apologize if this is because I badly searched.) I want

[osg-users] GLSL and OSG

2009-06-26 Thread Maxime BOUCHER
Hi, I am new in GLSL, and all OpenGL GLSL examples I saw needed a heavy preparation, whereas in OSG it's really nice. Thanks a lot and congratulations! As always I have a few questions. 1) OSG considers vectors as lines, OpenGL as columns. Thus every matrix/vector mutltiplication have to

Re: [osg-users] GLSL and OSG

2009-06-26 Thread Maxime BOUCHER
Alright, thanks. Max -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14596#14596 ___ osg-users mailing list osg-users@lists.openscenegraph.org

[osg-users] Camera Manipulator

2009-06-30 Thread Maxime BOUCHER
Hi, Really quick question. In a shader I get back a gl_FragCoord. I use it to try getting back in world space. I did it several ways and I really have the impression that piece of code: Code: ref_ptr osgGA::MatrixManipulator cammanipulator = new osgGA::TrackballManipulator();

Re: [osg-users] Camera Manipulator

2009-07-01 Thread Maxime BOUCHER
Hola, Let me ask it another way. I'm in a fragment shader. I have the vec4 gl_FragCoord. I do: Code: vec3 windowcoord = vec3(gl_FragCoord.xy, 1.0); vec3 clipcoord = viewportMatrixInverse * windowcoord; vec4 eyecoord = gl_ProjectionMatrixInverse * vec4(clipcoord, 1.0); eyecoord = eyecoord /

Re: [osg-users] Texture problems with OSG

2009-07-21 Thread Maxime BOUCHER
eatpepsi wrote: Hi, I have two problems with texturing in osg. 1)The first problem is to create a procedural 2D texture.The setImage function doesnt work for me. I created a 2D texture array image[64][64][4]; image-setImage(64,64,1,4,GL_RGBA,GL_UNSIGNED_BYTE,(unsigned

[osg-users] Z-fighting

2009-07-22 Thread Maxime BOUCHER
Hi computer graphics masters, I experience my first Z fighting, so I don't really know how to handle it. I firstly searched for posts and advises on both osgforum and google. My problem: I'm working on projective texture mapping through a shader. I do an offscreen rendering to get an image

Re: [osg-users] Texture problems with OSG

2009-07-22 Thread Maxime BOUCHER
Hi, eatpepsi wrote: 2)Considering second question I want to find texture coordinate of a particular point on the model.Using picking I can find the 3d position of an object,Similarly can I get the assigned texture coordinates at an arbitrary point using osg??This is similar to

Re: [osg-users] Computer Vision and osg

2009-07-22 Thread Maxime BOUCHER
Hi, JoeK wrote: Hello, I am using osg with Python for some computer vision related tasks. I was wondering if anyone else is doing the same. What would be really nice would be to integrate osg with an existing computer vision library like opencv. Joe I don't think there

[osg-users] Reload shader sampler2D for each drawable

2009-07-30 Thread Maxime BOUCHER
Hi, I'm looking for reloading the texture I send to a shader I put on the top of the scene graph. As every geode/drawable (it depends on the model) as a different texture, I'd like to reload the good one for each. I tried to do so using the geodes' drawables' update callbacks in the

Re: [osg-users] Reload shader sampler2D for each drawable

2009-07-31 Thread Maxime BOUCHER
Hi, Thanks for the reply. bthrall wrote: The shader has a sampler2D uniform that needs to be set to the texture unit you want to use; as long as you attach a different Texture2D to each geode/drawable on that texture unit, the shader will see that geode/drawable's texture. Well, the

Re: [osg-users] Reload shader sampler2D for each drawable

2009-08-03 Thread Maxime BOUCHER
Oooh... right! Thank you! Cheers, Maxime -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15724#15724 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] OSG and shaders

2009-08-03 Thread Maxime BOUCHER
Simon Hammett wrote: http://www.typhoonlabs.com/ Download chapters 1 through 5 and ShaderDesigner. Very very handy. There's also the orange book: (though I've not read it myself) http://www.amazon.com/OpenGL-Shading-Language-Randi-Rost/dp/0321637631 That's exactly what I've

Re: [osg-users] Subgraph tint/color/blend

2009-08-03 Thread Maxime BOUCHER
Hi, The quickest way is through shaders I think. Cheers, Maxime -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=15741#15741 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] OSG and shaders

2009-08-05 Thread Maxime BOUCHER
Hi, @btrall: Where do you find this ShaderGen? I found it neither in the classlist nor the osg examples. @carnibirdy: Rewritting the lights effects and texture mapping in the shader is quite easy. You can find implementation examples here (http://www.typhoonlabs.com/), in the OpenGL Shading

Re: [osg-users] OSG and shaders

2009-08-05 Thread Maxime BOUCHER
Well, I'm doing an internship too. At the beginning I didn't know osg at all, neither shaders. There are still an extraordinary amount of things I ignore about OSG (my advice: when you try to do or understand something, take a look at how it's done in OpenGL). Shaders aren't as hard to use as

Re: [osg-users] OSG and shaders

2009-08-06 Thread Maxime BOUCHER
Hi, carnibirdy wrote: For now, I'm still blocked with OSG. I want to map the same texture to the 6 faces of a cube. I made a Geometry called cube and 6 DrawElementsUInt called face1/2/.../6. I don't know how to setTexCoords to each QUADS. I thought about making 6 Geometry so I can use

[osg-users] Z-buffer transparency / Alpha

2009-08-06 Thread Maxime BOUCHER
Hi, I know Z-buffer isn't very in fond of transparency, and actually, when I capture it on a model having transparent faces it stores strange things (a kind of luminance image of some textures on parts corresponding to these transparents faces). Thus, I tried to deactivate it, but I didn't

Re: [osg-users] Z-buffer transparency / Alpha

2009-08-07 Thread Maxime BOUCHER
Hi Ulrich, Ulrich Hertlein wrote: Hi Maxime, I'm extremely irritated by what you write and maybe I'm not the only one. I am very sorry, please apologize. Maybe could you tell me why so that I won't do it again. Ulrich Hertlein wrote: Why do you suspect that the Z-buffer is influenced

Re: [osg-users] Z-buffer transparency / Alpha

2009-08-10 Thread Maxime BOUCHER
Hi, Ulrich Hertlein wrote: Hi Maxime, On 7/08/09 12:02 PM, Maxime BOUCHER wrote: Ulrich Hertlein wrote: Hi Maxime, I'm extremely irritated by what you write and maybe I'm not the only one. I am very sorry, please apologize. Maybe could you tell me why so that I

Re: [osg-users] offscreen rendering

2009-08-10 Thread Maxime BOUCHER
wrote: Hi, Can someone show me how to do offscreen rendering? What I have so far is a shader that render the texture on the screen after processing. I would like to render it offscreen and save it as a texture map. Any reference will also be appreciated Thank you! Cheers, Rabbi

Re: [osg-users] viewer.frame() rendering not complete

2009-08-11 Thread Maxime BOUCHER
wrote: Hi, I have a code that creates a temporary viewer and uses it to render one frame and copy from the color buffer to an image. When I call viewer.frame() the rendered image is only half done. Is there anyone to tell the viewer to complete a frame, save it and close itself?

Re: [osg-users] viewer.frame() rendering not complete

2009-08-12 Thread Maxime BOUCHER
Hi, This problem is far over my little knowledges, I'm sorry I can't help you. Good luck. Cheers, Maxime -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=16126#16126 ___ osg-users mailing list

Re: [osg-users] Z-buffer transparency / Alpha

2009-08-12 Thread Maxime BOUCHER
Hi, I discovered something I find really strange. I exported my scene from .ive to .osg. I opened it with a text editor and I replaced all GL_BLEND ON statements by GL_BLEND OFF. When I load my project with this .osg here's what the camera see (placed at the projective camera place): [Image:

Re: [osg-users] Z-buffer transparency / Alpha

2009-08-12 Thread Maxime BOUCHER
Hello there again, Thanks J.P for answering, but no, there is no protected stateattribute. Max wrote: Hi, I discovered something I find really strange. I exported my scene from .ive to .osg. I opened it with a text editor and I replaced all GL_BLEND ON statements by GL_BLEND OFF.

Re: [osg-users] OSG and shaders

2009-08-12 Thread Maxime BOUCHER
carnibirdy wrote: Hello everybody! Afeter some research on the net, I gathered some clues, day after day and I managed to make the shader i had to... just in part. I have no more problem with shaders! My only concern is now Openscenegraph. I don't understand AT ALL who has the

Re: [osg-users] Z-buffer transparency / Alpha

2009-08-12 Thread Maxime BOUCHER
J.P. Delport wrote: Hi, Maxime BOUCHER wrote: Hello there again, Thanks J.P for answering, but no, there is no protected stateattribute. I made another test. I converted the .ive to .osg and I made no change to the file. I executed the same code on both and for the .osg I

Re: [osg-users] Z-buffer transparency / Alpha

2009-08-12 Thread Maxime BOUCHER
Alright, I found the problem. During the conversion, textures are lost, then when the shader reads a texture it finds nothing. - Do you know how can I test it? I mean, if the texture slot (the specified unit) is empty, I would like to fill the fragment with the object color. Too bad my

Re: [osg-users] Z-buffer transparency / Alpha

2009-09-01 Thread Maxime BOUCHER
hybr wrote: Hi, If u didn't solved that yet - try 2 things: 1st: when doing prerender - on root stateset set GL_DEPTH_TEST to ON|OVERRIDE and DEPTH attrib to LESS and turn it ON|OVERRIDE(seems like depth write turned off for transparent objects by default, which is right thing in