Re: [osg-users] Projective Multi-Texturing

2012-10-24 Thread Christoph Heindl
On Tue, Oct 23, 2012 at 8:40 PM, Jason Daly wrote: > How can TexGen and a shader help here? Would it allow me to calculate the > UV coordinates for a given photo (camera position etc.) and the mesh? > > > > The more I think about it, the more I think you'll want to use a shader > for this. The b

[osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Daniel Schmid
Hi all I want to pass a custom vertex attribute (lets say a material code) to my vertex shader. For the moment I use BIND_PER_VERTEX: Code: int l_SMC = 1027; // some material code for (unsigned int i=0; iasGeometry(); if (l_Geom) { osg::Array* l_VertexArray = l_Geom->getVertexArray()

[osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Daniel Schmid
Hi all I want to pass a custom vertex attribute (lets say a material code) to my vertex shader. For the moment I use BIND_PER_VERTEX: [code] int l_SMC = 1027; // some material code for (unsigned int i=0; iasGeometry(); if (l_Geom) { osg::Array* l_VertexArray = l_Geom->getVertexArray();

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Sergey Polischuk
Hi wouldnt it be better to use uniform in this case? Cheers. 24.10.2012, 13:28, "Daniel Schmid" :Hi all I want to pass a custom vertex attribute (lets say a material code) to my vertex shader. For the moment I use BIND_PER_VERTEX: [code]int l_SMC = 1027; // some material code for (unsigned int i=0;

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Daniel Schmid
When I would use uniforms, I cannot set different values for different geometries. Uniforms are global for a particular stateset. So I HAVE to use vertex attributes, since in my shader I want to treat some particular surface in a special way, but without the need of separate stateset. -

[osg-users] Custom CullingVisitor

2012-10-24 Thread Aurelien Albert
Hi, In my application, I use a custom CullVisitor, this way : osgUtil::CullVisitor::prototype() = new MyCustomCullVisitor(); But this affects all viewers in my application. Is there anyway to explicitly set a custom CullVisitor on a specific osgViewer::Viewer ? I would like to use twos differ

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Tassilo Glander
Hi Daniel, you are right, with BIND_OVERALL and just one element in the array, OSG should apply the single attribute to all vertices of the geometry. You can check this behavior in Geometry.cpp searching for BIND_OVERALL. Also there is the createTexturedQuadGeometry() function which does setup

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Sergey Polischuk
Hi > As you say, setting Uniforms requires a state change, while with an attribute > the rendering is done at the GPU completely. it is kind of same both ways... here you need glUniform* call, there you need to bind vertex attrib and call glVertexAttribPointer* and rendering is done at the GPU

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Aurelien Albert
Hi, I think OpenGL specs doesn't allow to share a vertex attribute values between multiple vertices. Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50753#50753 ___ osg-users mailing list o

Re: [osg-users] [build] [Tutorial] Building osgAndroidExampleGLES1/2 on Ubuntu 11.10

2012-10-24 Thread Bernd Kampl
Hi samfan, I tried it again with the updated SDKs and NDKs, using SDK r20 and NDK r8b. What I think is that it's a change in the NDK that brings on this error. I got it to build (and work without linker errors) by modifying the file jni/osgNativeLib.cpp by changing 3 lines: line 78: const char

[osg-users] [Android osgViewer] OpenGL ES context lost (how do i preserve it?)

2012-10-24 Thread Bernd Kampl
Hi dev community, I'm working on an Android App based on the example AndroidExampleGLES1/2. In my case it's GLES1, but this problem persists in both GLES versions. The Problem occurs after the following steps (and it's easily reproducible): 1. run the android osgviewer app 2. load a model 3. put

[osg-users] Uniform arrays not working for me using Visual Studio 2010

2012-10-24 Thread David Sellin
Hi, I ported my program from mingw and Code Blocks to Visual Studio 2010 Express and found that I couldn't get uniform arrays to work. Has anyone experienced this? I'm new to Visual Studio so I might have missed something. I made a small test program that works on my old system but not on my ne

Re: [osg-users] Projective Multi-Texturing

2012-10-24 Thread Jason Daly
On 10/24/2012 03:03 AM, Christoph Heindl wrote: Thanks for the hints. From browsing the documentation it seems though that this would also texture non-visible triangles (i.e backfacing triangles)? This however would lead to messy texturing, since I have photos from around the mesh. Shouldn

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Jason Daly
On 10/24/2012 05:28 AM, Daniel Schmid wrote: Since the material code is unique within geometries, so actually I would need to transfer it only once per Geometry. If I change to BIND_OVERALL, the data is no longer transferred, or at least my shader cannot detect it anymore. I thought i should

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Tassilo Glander
Hi, sorry, I was wrong. It really seems the same in terms of state changes. A use case for a BIND_OVERALL attribute is probably that you have different types of geometry with and without individual attributes (for example color) in your scene that you want to render using the same shader. Tha

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Tim Moore
On Wed, Oct 24, 2012 at 12:37 PM, Sergey Polischuk wrote: > Hi > >> As you say, setting Uniforms requires a state change, while with an >> attribute the rendering is done at the GPU completely. > > it is kind of same both ways... here you need glUniform* call, there you need > to bind vertex att

[osg-users] custom CompositeDragger and AntiSquish

2012-10-24 Thread Michael Schanne
Hi, I am trying to add a 2D box to my scene (consisting of lines 1 pixel wide) that a user can resize by dragging the sides or corners, or rotate by dragging a handle. I'm attempting to use the osgManipulator Dragger classes for this purpose. I created a subclass of CompositeDragger and added

Re: [osg-users] [Android osgViewer] OpenGL ES context lost (how do i preserve it?)

2012-10-24 Thread Jorge Izquierdo Ciges
If you did exactly as it was the original example then it's the normal behaviour... because the viewer is reinitialized every time (it's stated in the docs), if not... I'm not a seer that knows what have you done in the code. 2012/10/24 Bernd Kampl > m working on an Android App based on the exam

Re: [osg-users] Compute near far and multiple cameras

2012-10-24 Thread Sebastian Messerschmidt
Hello Andy, First of all, thank you for responding, I wasn't even sure the mail got through ;-) Hey Sebastian, I've been looking at this off-and-on for a while now, though I have no clean solution. From my investigation it looks like the osg::CullVisitor tweaks the _computed_znear and _com

Re: [osg-users] custom vertex attribut, using BIND_OVERALL

2012-10-24 Thread Jason Daly
On 10/24/2012 11:35 AM, Jason Daly wrote: On 10/24/2012 05:28 AM, Daniel Schmid wrote: Since the material code is unique within geometries, so actually I would need to transfer it only once per Geometry. If I change to BIND_OVERALL, the data is no longer transferred, or at least my shader ca

[osg-users] Orbit manipulator right and middle mouse movement speed

2012-10-24 Thread Janna Terde
Hi, I've noticed that osgGA::OrbitManipulator code for right and middle mouse movement has hard-coded values such as: Code: // doc in parent bool OrbitManipulator::performMovementMiddleMouseButton( const double eventTimeDelta, const double dx, const double dy ) { // pan model float scale = -0

Re: [osg-users] Orbit manipulator right and middle mouse movement speed

2012-10-24 Thread Jean-Sébastien Guay
Hello Janna, Is there particular reason scale is hard-coded and no parameter is exposed to be able to modify movement scale for middle and right mouse button? Or is there some other way to do it? There was a large refactoring of camera manipulators about 2 years ago. OrbitManipulator is one