Re: [osg-users] osg::Geometry and GL_PRIMITVE_RESTART

2011-08-04 Thread Aurelien Albert
Hi, I'm facing the same problem : I try to use Code: glPrimitiveRestartIndex(0x); glEnableClientState(GL_PRIMITIVE_RESTART); In my OSG 3.0 project. Is there any way to use these functions without a big hack of osg ? Thank you! Cheers, Aurelien -- Read this

Re: [osg-users] How to use different shader for different cameras ?

2011-09-05 Thread Aurelien Albert
Thanks for your answers ! But the special rendering-mode shader is not the same for all the objects, so how can I : - tell to object A : your special shader for special rendering mode is this one - tell to object B : your special shader for special rendering mode is this one - tell to

Re: [osg-users] Bug in Qt thread integration

2012-09-27 Thread Aurelien Albert
Hi, I'm surprised that QThread::currentThread() can return something else than a QThread instance. But if this is really the case, the following should solve the issue : Code: QThread* pQThread = dynamic_cast QThread* (QThread::currentThread()); if (pQThread != NULL) { QtThreadPrivateData*

[osg-users] Tesselator and output primitives

2012-10-10 Thread Aurelien Albert
Hi, I use tesselator to generate a geometry from a LINE_LOOP primitive. The tesselator output give me a TRIANGLES_FAN primitive which seems to be correct. Now I would like to get the tesselator output as TRIANGLES primitive. Is there anyway to control the primitive type built by the

Re: [osg-users] Tesselator and output primitives

2012-10-11 Thread Aurelien Albert
Thanks, the IndexMeshVisitor does exactly what I need. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=50563#50563 ___ osg-users mailing list osg-users@lists.openscenegraph.org

[osg-users] How to copy an FBO used as RTT target ?

2012-10-22 Thread Aurelien Albert
Hi, I have a scene graph with multiple cameras as follow : Camera 1 : - clear mask : color and depth - use FBO_Camera_1_Color as color buffer attachment - use FBO_Camera_1_Depth as depth buffer attachment Camera 2 : - clear mask : none - use FBO_Camera_2_Color as color buffer attachment -

[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

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

Re: [osg-users] Custom CullingVisitor

2012-10-27 Thread Aurelien Albert
Hi, Thank you! I use custom cull visitor to store extra global-to-scene data and define some extra methods. These data are then read and write during culling by some specific nodes, to render parametric objects and/or select which StateSet to apply. Aurelien -- Read this

Re: [osg-users] manually calling drawImplementation

2012-11-21 Thread Aurelien Albert
Hi, Is there a reason why you can't just use a osg::Camera that is drawn after the main scene? I'm facing the same problem : in my OSG graph, I render data from physical simulations using a RTT camera and I need to postprocess the rendered texture before display it. The problem is to

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

2012-11-23 Thread Aurelien Albert
Hi, Does anyone have a solution for this issue ? Thank you! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51227#51227 ___ osg-users mailing list

Re: [osg-users] Transfer instance coordinates

2012-11-30 Thread Aurelien Albert
Hi, I use a TextureRectangle to store instances transformations matrix : - TextureRectangle because it's easier to read a specific coordinate - texure format is set on RGBA_32F to get full 32 bit floating point precision - RGBA = there are 4 values (R, G, B, A) per pixel So, a full transform

[osg-users] Inherit depth buffer attachment for a child camera ?

2012-12-06 Thread Aurelien Albert
Hi, In my scene graph, I use a main camera with FBO severals attached : - a FBO for COLOR0 - a FBO for COLOR1 - a FBO for DEPTH I would like to use a child camera (not slave) with : - another FBO attached to COLOR0 - the same FBO a main camera for DEPTH buffer Is there anyway to inherit the

Re: [osg-users] Sharing culling results among multiple cameras

2012-12-06 Thread Aurelien Albert
Hi, I'm intersted by this topic, because in my application, sometimes I need to render the same scene multiple times. For example, I render the scene a first time to generate a regular OpenGL image. Then I render with different shaders/textures to generate an image with computation results

Re: [osg-users] Sharing culling results among multiple cameras

2012-12-07 Thread Aurelien Albert
Hi, Thanks a lot for this idea ! I'll try to do something based on it. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51457#51457 ___ osg-users mailing list osg-users@lists.openscenegraph.org

[osg-users] Questions about mip maps

2012-12-14 Thread Aurelien Albert
Hi, I have a set of pre-computed procedurals textures, and my texture generation system can produce high-quality downsampled textures. So I would like to use them as mipmaps for my textures : - is it possible to allocate and load mipmaps from CPU, just like we load an osg::Image into an

Re: [osg-users] Questions about mip maps

2012-12-15 Thread Aurelien Albert
Thanks a lot for this very precise answer ! Just one more question, you said : each successive level should be an integer quotient of the previous level's size and two So, for n-th level, the size should be : (size of n-1 level) / (2*k) with arbitrary k ? Is it possible to have multiple

[osg-users] Create a custom RenderStage

2013-01-02 Thread Aurelien Albert
Hi, I use differents custom RenderStages : as pre-renderstage for pre-processing and as post-renderstage for post processing. These processing are executed using FBO render targets. Currently I'm doing that with slaves cameras, but : - the RenderStage class is derived from the RenderBin class

Re: [osg-users] Create a custom RenderStage

2013-01-02 Thread Aurelien Albert
Hi Wang, Thanks for your quick answer ! I'm already doing pre and post-processing of various king : tone-mapping, DOF, motion blur... using multiple cameras, slave or childs. Now I'm trying to create custom renderstages, without multiple cameras, but using a RenderBin prototype. This could be

Re: [osg-users] Create a custom RenderStage

2013-01-02 Thread Aurelien Albert
Thanks for these informations, I'll try to do something with that. I was thinking about a more simple approach : - register a RenderBin prototype which is a class deriver from RenderStage - use this renderbin for some nodes I've already created custom RenderBin prototypes (it's pretty easy,

Re: [osg-users] Create a custom RenderStage

2013-01-02 Thread Aurelien Albert
Hi Paul, Thanks a lot, these are very intersting informations ! Actually, I need to use custom RenderStages and not only RenderBins because I want to render to different FBO's (for pre and post process purposes) - Editing manually the RenderGraph sounds a little bit complicated to me -

Re: [osg-users] Animating articulated osg models

2013-01-02 Thread Aurelien Albert
Hi, In general, am I correct in expecting setUpdateCallback to behave this way? = yes In the situation you describe, the osg model is shared against multiple parent, event if there is a specific matrix transform : Common parent | |- Matrix_1 - Osg_Model | |- Matrix_2 - Osg_Model | |-

Re: [osg-users] OSG COLLADA build problem, Windows, vs2008

2013-01-06 Thread Aurelien Albert
Hi, I've sent a fix for that : http://forum.openscenegraph.org/viewtopic.php?t=11204 The fix is not yet merged into trunk. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=51798#51798 ___ osg-users

[osg-users] How to convert an array to BIND_PER_VERTEX

2013-01-09 Thread Aurelien Albert
Hi, I'm writing an application which execute some algorithms on model's geometries. To make simplier code, I would like to convert all nodes in a model file to a specific structure, for example : - use only TRIANGLES primitive - use only PER_VERTEX bindings - etc... I know this could lead to

[osg-users] useVertexAttributeAliasing and vertex color

2013-02-05 Thread Aurelien Albert
Hi, I'm trying to use the useVertexAttributeAliasing. Nearly all my shaders are ported and now works, but I have a problem with the vertex color : in case of useVertexAttributeAliasing, vertex colors are binded as an attribute using : Code: setVertexAttribPointer(_colorAlias._location,

Re: [osg-users] useVertexAttributeAliasing and vertex color

2013-02-05 Thread Aurelien Albert
Hum, I don't really get it... When I build a model from code (create an osg::Geometry, fill a vertex array, a normal array, a color array) I get [0.0 - 1.0] values in my shader When I load a model from a file (.3ds or .osgb) I get [0.0 - 255.0] values in my shader Have someone experienced

Re: [osg-users] useVertexAttributeAliasing and vertex color

2013-02-06 Thread Aurelien Albert
Hi, I've sent a patch for this : http://forum.openscenegraph.org/viewtopic.php?p=52418#52418 About my second message, forgot it, it was an error in my shader code -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52419#52419

Re: [osg-users] An OSG Resource Compiler ?

2013-02-06 Thread Aurelien Albert
Hi, I use OSG in a Qt application, and I do this : osg::ref_ptrosg::Object osgDB::readObject(:/some-label/object.osgt.qtresource); The .qtresource extension is mapped to a pseudo-loader written using Qt classes to load :/some-label/object.osgt file from Qt resources and decode it using the

Re: [osg-users] Cheaper way to implement rendering-to-texture and post-processing pipeline?

2013-02-14 Thread Aurelien Albert
Hi, Thanks for sharing this, I've never think to this way, and it's very interseting. Not really for performance reason, but also for simplicity reasons. I'll try to dig that further to see if it can be usefull to implement what is discussed here :

Re: [osg-users] Cheaper way to implement rendering-to-texture and post-processing pipeline?

2013-02-14 Thread Aurelien Albert
Hi all, I'm not sure the CPU cost is really the issue here, but it would be usefull to have that kind of methods : executeCamera(osg::Camera*, osg::State*) executeCameraAsync(osg::Camera*, osg::State*) = execute all needed code to render the sub graph of the camera, with async wait. = inputs

Re: [osg-users] Cheaper way to implement rendering-to-texture and post-processing pipeline?

2013-02-15 Thread Aurelien Albert
Hi, the concept of post-processing is inherently non-spatial, so it really doesn't belong in a scene graph at all = this is why I think we should be able to execute a render pass on an arbitrary camera : the subgraph of this camera may not have a spatial organization, but a process-logic

Re: [osg-users] OpenCL post processing example: anyone care to share?

2013-02-20 Thread Aurelien Albert
Hi, I used to do post processing with Cuda. But I've switched to full GLSL : - no compatibility problem - no performance overhead due to interoperability To compute histogram, you can use the method described in this link : http://http.developer.nvidia.com/GPUGems3/gpugems3_ch41.html I use

Re: [osg-users] Problem with 2 RTT cameras

2013-02-20 Thread Aurelien Albert
Hi, Not sure about that, but you traverse the both camera with the same cull visitor instance... I think render target is assigned within the cull visitor, so you maybe should use 2 cull visitor different instances. Cheers, Aurelien -- Read this topic online here:

Re: [osg-users] initializing the depth buffer with another camera's buffer before rendering

2013-02-22 Thread Aurelien Albert
Hi, I haven't yet figured out how to get from an osg.:Camera or an osg::RenderInfo to an actual fbo pointer. *sigh* Such a method should be usefull, but I didn't find a way to do it neither. In my application, I do something really close, but I affect explicity the texture to use for

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

2013-02-24 Thread Aurelien Albert
Hi, I've posted a submission which should solve this issue : http://forum.openscenegraph.org/viewtopic.php?p=52849#52849 The problem was in the ArrayDispatcher.cpp file : some kind of array types (like ArrayInt you use here) where not registered with associated dispatchers. It solves my

Re: [osg-users] How to pass ModelMatrix to vertex using osg::Uniform

2013-02-25 Thread Aurelien Albert
Hi, The original code is : Code: vPosition = ViewMatrix * ModelMatrix * vec4(Vertex * ModelScale, 1.0); So I think you can use this : Code: vPosition = osg_ModelViewMatrix * vec4(Vertex * ModelScale, 1.0); because osg_ModelViewMatrix is equivalent to ViewMatrix * ModelMatrix.

Re: [osg-users] How to pass ModelMatrix to vertex using osg::Uniform

2013-02-25 Thread Aurelien Albert
I forgot this : You declare an input attribute : Code: attribute vec3 Vertex; But have you set and bind any vertex attribute called Vertex ? I think you should remove this line and use : Code: vPosition = osg_ModelViewMatrix * vec4([b]gl_Vertex.xyz[/b] * ModelScale, 1.0);

Re: [osg-users] Dynamic PagedLOD node creation

2013-03-02 Thread Aurelien Albert
Hi, You should have a look to osgEarth source code : they use PagedLOD with pseudo-loaders to dynamically build new nodes, this is maybe a good way to go for you. Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52931#52931

Re: [osg-users] PolytopeIntersector distance and Transform

2013-03-07 Thread Aurelien Albert
Hi, I'm also interested if you have a solution to easily pick points lines ! Thank you! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52972#52972 ___ osg-users mailing list

[osg-users] How to render without a depth buffer ?

2013-03-07 Thread Aurelien Albert
Hi, As a preprocessing, I need to render a lot of quads to a texure. I already have something working with a render to FBO, but since I don't use depth test and I disabled depth write, I'm looking for a way to save some GPU memory by avoid the use of a depth buffer. I tried this :

Re: [osg-users] How to render without a depth buffer ?

2013-03-07 Thread Aurelien Albert
Hi Pjotr, This works, thanks a lot ! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52976#52976 ___ osg-users mailing list osg-users@lists.openscenegraph.org

Re: [osg-users] the original QT events seems conflicted with osg's event handle.

2013-03-11 Thread Aurelien Albert
Hi, I think this is a Qt issue : drag'n'drop need a little more work than jsut implementing a dropEvent method. First, you need to set setAcceptDrops(true) on your widget, then take a look at : http://doc.qt.digia.com/stable/dnd.html You should implement it before with a regular QWidget,

Re: [osg-users] Problem loading RGBA bmp.

2013-03-12 Thread Aurelien Albert
Hi, Alpha channel is not supported by all image file format. For example PNG support it, JPEG doesn't. I'm not sure the BMP format support alpha channel (or maybe no all variant of BMP format) Cheers, Aurelien -- Read this topic online here:

Re: [osg-users] Updating parameter-based procedural geometry

2013-03-20 Thread Aurelien Albert
Hi, I think the most standard way to do this is to use an UpdateCallback on your osg::Node. This ensure your update code to be executed in the main application thread : UpdateCallbacks are executed during the update traversal, and this is the best way to avoid threading issues. Cheers,

Re: [osg-users] Updating parameter-based procedural geometry

2013-03-21 Thread Aurelien Albert
Hi, Yes, this is what I have in mind, and I think this is also the safer way to do geometry modifications in OSG. Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=53184#53184 ___

Re: [osg-users] KML with texture fails to save as IVE

2013-03-25 Thread Aurelien Albert
Hi, When I try to save the node I get this error on the console: image C:\Workspace\OpenSceneGraph\build\bin\models\untitled\texture.jpg' 256 128 Error writing IVE image: StateSet::write(): Unknown StateAttribute: VirtualProgram This is normal, osgEarth insert custom VirtualProgram

Re: [osg-users] Deprecating vertex indices in osg::Geometry

2013-06-04 Thread Aurelien Albert
robertosfield wrote: The PreserveDataType and AttribDivisor are entirely new and are intended to support new extensions being added to the OSG - but their implementation will have to wait till the GeometryNew refactor is further down the road. This is great ! robertosfield wrote:

Re: [osg-users] Vec{2,3,4}{b,s,i,f,d,ub,us,ui} harmonisation

2013-06-12 Thread Aurelien Albert
Hi, I think this is a really interesting idea. Have a look here : http://glm.g-truc.net/ This library already implements a lot of glsl-like syntax. Before rewriting everything (that's not complex, but a lot of work) maybe we could make osg and glm work together ? Maybe adding to glm headers

Re: [osg-users] Vec{2,3,4}{b,s,i,f,d,ub,us,ui} harmonisation

2013-06-12 Thread Aurelien Albert
Forgotten link from previous message : http://devmaster.net/forums/topic/10009-swizzle-operator-in-c/ = interesting ideas on how to implement developper friendly but asm efficient swizzle in C++ -- Read this topic online here:

Re: [osg-users] Vec{2,3,4}{b,s,i,f,d,ub,us,ui} harmonisation

2013-06-13 Thread Aurelien Albert
Hi, Those implementations are truly ugly. Yes, the C++ code is realy ugly. But the C++ interface (which is what developpers realy use) is ok, and the generated asm is great. Maybe there are some interesting ideas to take from that. Thank you! Cheers, Aurelien -- Read

[osg-users] Per-view RenderBin

2013-06-25 Thread Aurelien Albert
Hi, I'm facing a problem : I use custom RenderBins for custom rendering, but it would be *very* convenient to be able to identity which view use this RenderBin instance. I've tought about this modification on RenderBin::createRenderBin : Code: RenderBin* RenderBin::createRenderBin(const

Re: [osg-users] Per-view RenderBin

2013-06-25 Thread Aurelien Albert
Hi Robert, You're right, the RenderInfo is probably enough for my needs. Thank you! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=54896#54896 ___ osg-users mailing list

Re: [osg-users] External texture/fbo

2013-07-01 Thread Aurelien Albert
Hi, I've done this for interoperability between OSG and client library, for exampe for a texture : I've created a WrapperTexture class which inherits from osg::StateAttribute directly. - It expose it's StateAttribute type (getType() method) as TEXTURE - It contain a member which is an

Re: [osg-users] Instancing with VertexAttribDivisor

2013-07-01 Thread Aurelien Albert
Hi, Unfortunally, support for ATTRIB_DIVISOR is removed from official osg source since today... You can still use it by crating a drawcallback (or subclassing a drawable) and call glVertexAttriDivisor were needed. Just be carefull to reset to previous values brfore exiting the

Re: [osg-users] External texture/fbo

2013-07-01 Thread Aurelien Albert
Hi, This tip works well, but you have to be aware of ressource creation/deletion either by OSG and Qt5, specially be carefull of the current OpenGL context. I recommend you to write the wrapper for a simple texture, make it works, then make in works in all situation (a single graph / single

[osg-users] Node with a dynamic bounding box

2013-07-03 Thread Aurelien Albert
Hi, Due to the use of displacement mapping, I have a node with dynamic bounding box. I mean the bounding box change every frame (but very fast to compute). For now I've done the following : - reimplement osg::Node::computeBound - on each update traversal, call dirtyBound() Is there any better

Re: [osg-users] OpenSceneGraph-3.2.0 stable release tagged!

2013-07-25 Thread Aurelien Albert
Hi Robert, Thanks a lot for all your work ! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55446#55446 ___ osg-users mailing list osg-users@lists.openscenegraph.org

[osg-users] Bug in trunk with Intersector epsilon

2013-08-01 Thread Aurelien Albert
Hi, I think there is a bug in the trunk : the epsilon used for osgUtil::Intersector class is not initialized. Thank you! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55692#55692

[osg-users] Intersection visitor and osg::Viewport

2013-08-08 Thread Aurelien Albert
Hi, I'm experiencing some problems to get correct intersections in following situation : I have a group in my scene graph which have a Viewport StateAttribute to modify its rendering frame on screen. All is works well for render, but intersector seems lost wih nodes below my group. Is there

Re: [osg-users] Intersection visitor and osg::Viewport

2013-08-08 Thread Aurelien Albert
Hi, I've tried the following and it seems to solve my problem : Code: void IntersectionVisitor::apply(osg::Group group) { if (!enter(group)) return; osg::Viewport* pViewport = NULL; if (group.getStateSet() != NULL) { pViewport =

Re: [osg-users] Performance of Uniform-Buffer-Objects and question to the software design of osg::BufferObject

2013-08-29 Thread Aurelien Albert
Hi, UBO are not designed for random access from shader, but for block access. For hardware instancing, you should get best performances using vertex attribute divisor. Cheers, Aurelien -- Read this topic online here:

Re: [osg-users] Performance of Uniform-Buffer-Objects and question to the software design of osg::BufferObject

2013-08-30 Thread Aurelien Albert
Hi, If you change data often, you can declare the vertex attribute array usage as STREAM_DRAW. And to pass 4x4 matrices, you can do this : - declare 4 vertex attributes array in OSG - fill them with the 4 colums of your matrices - bind them to attributes units 4, 5, 6, 7 (for example) - in

Re: [osg-users] LineSegmentIntersector numerical imprecisions

2013-09-02 Thread Aurelien Albert
Hi Robert, This is perhaps un-related, but in a previous project, I've experienced intersections numerical precision problems with big scenes, and I've switched to the double precision line segment intersector taken fomr osgEarth source code. Maybe swiching from float precision to double

Re: [osg-users] OSG errors when running on a virtual machine

2013-09-05 Thread Aurelien Albert
Hi, I've got some bad experience with virtual machines. The 3D hardware acceleration in a virtual machine is generally not that good. In fact, hardware acceleration is usualy not available at all on a Virtual Machine. Because this is a virtual machine. Just like a remote session on windows

[osg-users] Possible bug in osg::State::applyShaderCompositionUniform

2013-09-23 Thread Aurelien Albert
Hi Robert, A few month ago, you solved one of my issues : http://forum.openscenegraph.org/viewtopic.php?t=11769postdays=0postorder=ascstart=14 Today I've discovered some problems with this approach (I use it for materials, as you suggested in your post) : the shader composition uniforms seems

Re: [osg-users] Possible bug in osg::State::applyShaderCompositionUniform

2013-09-23 Thread Aurelien Albert
Hi rmilh, If there is some interest I could send all the stuff to the submissions at the end of this week Thanks for the sharing offer, I'm interested ! I think I've made some progress in the analysis of my problem, could you just test the following inside your experimental shader

Re: [osg-users] Possible bug in osg::State::applyShaderCompositionUniform

2013-09-24 Thread Aurelien Albert
Hi, Thanks for testing ! I've already seen the problem of the growing list... But I don't know how to avoid this, because if I left the call to currentShaderCompositionUniformList.clear(), some uniforms are not properly applied. For example : - Node A : Shader Program + Shader Composition

Re: [osg-users] Possible bug in osg::State::applyShaderCompositionUniform

2013-09-24 Thread Aurelien Albert
Hi, Have a look here to see why I use this (on Robert's advice) : http://forum.openscenegraph.org/viewtopic.php?t=11769 I know this is more like a workaround, but it is really usefull to be able to write StateAttributes classes which manage and apply their own uniforms. To solve my problem

Re: [osg-users] Possible bug in osg::State::applyShaderCompositionUniform

2013-09-24 Thread Aurelien Albert
Hi, If you do change the list to stack so you can push/pop uniforms you will end up redoing standard uniform handling but this time with a parallel uniform list. Yes, and I think this is what I need : - a standard uniform list, which contains uniforms setted from regular osg::Uniform

Re: [osg-users] Possible bug in osg::State::applyShaderCompositionUniform

2013-09-24 Thread Aurelien Albert
For example, push uniforms with ambient, diffuse, specular and shininess values from osg::Material, for OpenGL 3.3 It could also be used for application-specific StateAttribute classes, for example an ObjectData StateAttribute which push several uniforms on the state. -- Read

[osg-users] Proposal for uniforms applied from within a StateAttribute

2013-09-24 Thread Aurelien Albert
Hi, As discuted multiple times with Robert and others, sometimes it's really usefull to have a StateAttribute which also provide its own uniforms. For example, I use it in a modified osg::Material class to apply maerial values as uniform or to handle specific ObjectData StateAttribute classes

Re: [osg-users] Proposal for uniforms applied from within a StateAttribute

2013-09-24 Thread Aurelien Albert
Hi Robert, No problem, script support in OSG will be great ! I'll try to make an optimized implementation and submit it. Thank you! Cheers, Aurelien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56472#56472

Re: [osg-users] Picking implementation

2013-09-27 Thread Aurelien Albert
Hi, I've got the same picking problem with several mesh (which use vertex displacement or tesselation). To solve that, I always render my scene in a FBO, with 2 color attachements : - first draw buffer is a regular color texture - second draw buffer is a texture with only 1 channel, in int

Re: [osg-users] Picking implementation

2013-09-29 Thread Aurelien Albert
Hi, but I can't really afford the per-frame cost On modern GPU, the per-frame cost is near zero with reasonable scenes. (not a full 3d scene of 1+ objects like in video games). The heavy cost is paid when you actually download some data from GPU to read back, but you can do that only

Re: [osg-users] mixing OpenGL with OSG - textures

2013-10-08 Thread Aurelien Albert
Hi, At first, I was playing with Texture::TextureObject, but I found difficult to make OSG to delegate the control on ressource allocation / release (which are managed by my customer's library) so I've switched to a subclass. Cheers, Aurelien -- Read this topic online here:

Re: [osg-users] mixing OpenGL with OSG - textures

2013-10-10 Thread Aurelien Albert
Hi, Here it is : Code: #include RenderBox/GLBoxWrappers/GLBoxOsgTexture.h #include GLBox/Texture/Texture.h // MyTexture::MyTexture() : osg::StateAttribute () , p_CustomerTexture (NULL) { } // MyTexture::MyTexture(CustomerTexture* pCustomerTexture) :

Re: [osg-users] IncrementalCompileOperation OnDemandMode

2013-10-10 Thread Aurelien Albert
Hi, I used to do something like that... from my memories, all that I can say is I used the osgUtil::GLObjectsVisitor to do a on-demand-compile-traversal right after loading an object. Cheers, Aurelien -- Read this topic online here:

Re: [osg-users] IncrementalCompileOperation OnDemandMode

2013-10-11 Thread Aurelien Albert
Hi, Sorry, I wasn't able to retrieve this old piec of code... The state can be obtained from the viewer's graphics context, and the RenderInfo can be created using the state and the viewer. Before running the visitor, you should make sure that the viewer's OpenGL context is current

Re: [osg-users] Preferred method for per-context uniforms

2013-10-24 Thread Aurelien Albert
Hi, If you have just a single uniform value per context then I'd simply place the Uniform on the each if the viiewer's osg::Camera's StateSet, such that each Camera assigned to each Context gets it's own state inherited down including the Uniform. Some nodes have a cull callback.

Re: [osg-users] Preferred method for per-context uniforms

2013-10-24 Thread Aurelien Albert
Hi, At cull traversal, I do the following (this is pseudo-code!) : Code: cullTraversal(pCullVisitor) { // Get per-view-data perViewData = getOrCreatePerViewData(pCullVisitor); // Compute dynamic uniforms perViewData.pDynamicUniform_1-set(value);

Re: [osg-users] Preferred method for per-context uniforms

2013-10-24 Thread Aurelien Albert
Hi, And then index that by the GC ID if it's available through the cv-getCurrentCamera(). That's a bit different for my solution : - in my idea, you get per-view uniforms : even if multiple views runs with the same graphics context, you still have different uniforms - in your idea, you

Re: [osg-users] Preferred method for per-context uniforms

2013-10-24 Thread Aurelien Albert
Hi Robert, The CullVisitor::getRenderInfo() method could be used to access to the osg::State object and hence ContextID that is relevant to the current cull traversal. Will this works with shared contexts ? Thank you! Cheers, Aurelien -- Read this topic online here:

Re: [osg-users] [osgDEM] calculate height above ellipsoid in vertex shader

2013-12-06 Thread Aurelien Albert
Hi, I'm facing the same problem, and I can't pre-compute vertex attributes on CPU because my vertex are moved by the shader him-self (displacement mapping). I've tried to use double matrices, but these leads to a lot of compatibility problem. Since the precision problem is in the temporary

Re: [osg-users] Pop Buffers with OpenSceneGraph

2014-04-22 Thread Aurelien Albert
Hi, 5. Because the technique depends on the usage of a vertex shader I would add two static methods one returns a basic osg::Program with phong shading and another one only returns the shader code with the necessary uniforms and a vertex quantization function that should be used in the

Re: [osg-users] New primitive restart mode leaking into other nodes

2014-04-23 Thread Aurelien Albert
Hi, About the leaking problem : it is because the GL_PRIMITIVE_RESTART mode has no defaut value in OSG. So if you set anywhere in your scene graph, its value (ON or OFF) will not go back to a default OFF value (which is not set anywhere) It's probably possible to add this default OFF value in

Re: [osg-users] New primitive restart mode leaking into other nodes

2014-04-24 Thread Aurelien Albert
Hi, But I am a little confused, why you judge the good old primitive restart functionality Because triangle strips are no longer faster than triangles. Using triangles with an optimized idexing (see post-transform cache optimization) is very performant. I also use GPU computing CUDA /

Re: [osg-users] New primitive restart mode leaking into other nodes

2014-04-24 Thread Aurelien Albert
Instead of calling many singleDraws or a multiDraw with all its offsets you have to remember I think you're talking about draw-instanced feature here, which is completely different, but very efficient. Cheers, Aurelien -- Read this topic online here:

Re: [osg-users] New primitive restart mode leaking into other nodes

2014-04-25 Thread Aurelien Albert
Hi, drawing 10 lines, needs 10*4=40 indices using LINES_ADJACENCY but only 12 indices using GL_LINESTRIP_ADJACENCY. So when you need adjacency, the PrimitiveRestart mode may still have some advantages. I didn't think about adjacency. In this case, it may still make sense to use primitive

Re: [osg-users] Promoting Drawable from being subclassed from osg::Object to osg::Node

2014-06-03 Thread Aurelien Albert
Hi, Pjotr wrote: Also whats the point of a Drawable::Update/Event/CullCallback now, should't they be deprecated now that a Drawable is a Node and can use the Node's callbacks? I think Pjotr is right there. Maybe there's a way to solve this using C++ type erasure : create an

[osg-users] OSG static linking for commercial application

2011-09-14 Thread Aurelien Albert
Hi, This is a question about legal statement, not technical. I'm working on a commercial project based on OSG. I made a dynamic library 3dstuff.dll with all my 3D stuff, this DLL uses OSG. Can I use static linking of OSG with my 3dstuff.dll to distribute only this DLL with my executable file

Re: [osg-users] OSG static linking for commercial application

2011-09-15 Thread Aurelien Albert
Thanks for all these clarifications ! About the plugins : where can I find specific plugin license ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42786#42786 ___ osg-users mailing list

[osg-users] Questions about render order

2011-09-17 Thread Aurelien Albert
Hi, I want to understand the render order of the different objects in an OSG scene. For example, with this scene : [Image: http://img4.hostingpics.net/thumbs/mini_829034graph.png ] Is it true or false ? 1. Root is rendered before all other 2. A is rendered before A1 2. B is

[osg-users] hide objects from manipulators

2011-09-22 Thread Aurelien Albert
Hi, I'm working on an OSG based application, with user interaction (TranslateAxisDragger, RotateAxisDragger...) My scene is rendered as follow : - Depth and color buffer clear - Objects are rendered - Depth buffer clear - Manipulators are rendered So manipulators are always drawn in front of

Re: [osg-users] hide objects from manipulators

2011-09-23 Thread Aurelien Albert
Hi, I already use 2 subgraphs, like his : Root | | Manipulators | | Objects But how can I tell to the TranslateAxisManipulator to visit only the Manipulators subgraph ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42960#42960

Re: [osg-users] hide objects from manipulators

2011-09-23 Thread Aurelien Albert
Thanks for your help ! To be more specific, when my dragger is hidden by another geometry, the camera manipulator get the event. Any idea about this ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=42963#42963

[osg-users] Draw a line from world to screen

2011-09-25 Thread Aurelien Albert
Hi, I've made an Segment object which draw a segement from a point (x, y, z) to another (x, y, z) and working well. Now, I want to draw a Connector line from a point in space (x, y, z) to a point on screen (x, y). How can I transform my (x, y) screen point to find a equivalent (x, y, z) world

Re: [osg-users] Draw a line from world to screen

2011-09-27 Thread Aurelien Albert
Thansk for pointing me to these topics. So, I found the solution : (be carefull, these function use WORLD coordinates, not local coordinates) worldToScreen : Code: osg::Vec2d worldToScreen(const osg::Vec3d worldPosition, const osg::Camera* pCamera) { osg::Vec2d screenPosition; if

[osg-users] [osgPPU] Very basic example ?

2011-10-01 Thread Aurelien Albert
Hi, After 2 days playing with osgPPU exmaples, I stil did not succeed to do a very basic PPU unit... Is there any very basic example for osgPPU ? Something like : * create PPU * add PPU unit which use a shader for a very basic operation (like switch red and green color components) * attach

Re: [osg-users] [osgPPU] Very basic example ?

2011-10-03 Thread Aurelien Albert
Currently, I have this code. I try to do a simple operation : invert Red and Green color components, but I get only a black screen. Could anyone help me ? Thanks. Code: // Configure Camera p_osgCamera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);

Re: [osg-users] [osgPPU] Very basic example ?

2011-10-03 Thread Aurelien Albert
Ok, I found the solution... An error in my shader code :-* -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43164#43164 ___ osg-users mailing list osg-users@lists.openscenegraph.org

  1   2   >