Re: [osg-users] Visual Studio 2015 3rd_party

2015-10-21 Thread David Callu
Hi Bjorn

Have you consider to use cmake's module named ExternalProject

You could Download/Update/Patch/Configure/Build/Install{/add custom step}
in few lines of cmake code

I recently use it to build lots of dependencies and immediately think to
use it for OSG

HTH
David


2015-10-21 12:11 GMT+02:00 Sebastian Messerschmidt <
sebastian.messerschm...@gmx.de>:

> Hey Björn,
>
> Thats fantastic news. I'll test them as soon as I can :-)
>
> Cheers
> Sebastian
>
> Chris Hanson wrote:
>>
>>> We're working towards getting our own in-house build system up to modern
>>> compilers shortly.
>>>
>>
>> Hi Chris,
>>
>> On a related note. I have tried to automate the building of the 3rd party
>> dependencies via a toplevel CMake script which builds the desired
>> dependencies from source. And then via the install feature collects the
>> relevant headers, libraries and DLLs into one directory.
>>
>> The project can be found here:
>> https://github.com/bjornblissing/osg-3rdparty-cmake
>>
>> Best regards
>> Björn
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=65396#65396
>>
>>
>>
>>
>>
>> ___
>> 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] pfDCS replacement

2015-08-28 Thread David Callu
Hi Tony

Have you take a look to osg/src/osgPlugins/pfb/* source code ?
this plugin load pfb fie in osg, so I think many answers of your question
will be there.

HTH
David

2015-08-28 5:34 GMT+02:00 Tony Vasile ming...@gmail.com:

 Okay today I am wondering which class replaces pfDCS in OSG? A Google
 search shows there use to be  a class osg::DCS but this has been removed.
 To get the same functionality do I use PositionAttitudeTransform?

 Tony V

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=64926#64926





 ___
 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


Re: [osg-users] #pragma(tic) shader composition support now checked into svn/trunk

2015-02-16 Thread David Callu
Hi Sebastian,

As Robert say in its previous mail, he want to depreciate/remove old shader
composition. This is the bad thing.

Cheers
David

2015-02-16 19:03 GMT+01:00 Sebastian Messerschmidt 
sebastian.messerschm...@gmx.de:

  Hi David,
 I don't see where you see problems. The old ShaderComposition is still
 there, and basically nothing has changed, as the new feature is orthogonal
 to the old one.
 I'm using some adapted version of the ShaderComposition framework, and it
 still works with the current trunk, so could you please provide some
 example what is failing?

 Cheers
 Sebastian

   Hi Robert, Hi all


 I also implement a shader composition framework for a client, based on osg
 shader composition, so remove it will be a big loss.
 My implementation handle OpenGL version, some pragma (optimize and
 debug), generate a main function for vertex and fragment shader based on
 what is found in shaderComponent list. So change from previous shader
 composition to new one will not be  straight forward.



  some thought about new shader composition

 1)
 OpenGL Shading Language specification
 3.3 Preprocessor :
 #pragma allows implementation dependent compiler control

 so pragma requires and import_defines should be use by shader
 compiler, replace them by osg_requires and osg_import_defines could
 be prevent futur pragma collisions. Thought ?

  but pragma is an elegant way to insert information directly in shader
 code. well spot !!!




 2)
  Define a main function with all possibility and use define to choose the
 ones to enable and the ones to not will make
  a really complex shader, imagine, you optionally use
  - instancing
 - bump/deplacement mapping
 - vertex blending
 - material/texture/multi-texture
  - lighting/shadow
  - fog
  - physic
  - one/multi fragment output
  You will be quickly crazy. The one that work with SpeedTree Shader knows
 what I am talking about.
  This is why I prefer your previous approach that inject code found in
 StateAttribute in final program.
  It is also less intrusive. If i need to insert a new shader component in
 the program, no need to change main
  shader. More over, I introduce some new ShaderAttribute like camera to
 define where fragment shader output have to go,
  or drawable to define which vertex shader input are available,
 Instance to optionally use draw instance, ... so don't remove Shader
 Attribute. With modern OpenGL and depreciated data like fog, light, ...
 we need a way to introduce our custom attribute.
  I create a nodekit osgLighting just to manage different light source. I
 have 5 different light source (sun, car, streetlight, ...) that all use
 shaderAttribute to define data that compose the light and shader that use
 this data. So don't remove shaderAttribute this is really a good idea you
 have here !!!


  3)
 On a performance point of view, it will be a good thing to use subroutine
 to enable/disable feature.
  Many different path in shader composition result in many different
 program. And so many change
  of program in one frame, perhaps use the program A, then the program B,
 then the program A again...
  This is the main problem I currently have in my shader composition
 implementation.

 4)
  I always think that lack of define injection in shader is a drawback in
 osg. With your function and name convention,
  this will be difficult to add this feature. Replace import_define by
 import_module will fix this.
 Because we talk about shader module, lighting, fog, bump mapping, shadow
 ... all of this could be define as shader module.




  I really think that shader composition is a big piece of software,
 really usefull, and really complex.
  I think we need a  debate about this with all user that have already try
 to implement a shader composition.
  Clearly define our needs (have reusable module, keep code in shader
 files, use OpenGL feature to improve performance like subroutine,
 pipeline object, ...), debate about solution, propose implementation...


  This problem is really new and so few research has be done an the
 subject. I did my first implementation in octobre 2010
  I have used my shader composition in many way. Found some cool stuff and
 other bad about my design. I look for existing solution
  on internet, I found some one like libsh http://libsh.org/ but not
 easy and clean way to solve it. Recently i found CosMo
 http://www.vrvis.at/publications/pdfs/PB-VRVis-2014-001.pdf that did
 the job in many way
  like my implementation, but more deeply in abstraction of the code. They
 don't think in term of shader but in term of
 pipeline graphics, shader composition will decide which code put in
 vertex/tessellation/geometry/fragment shader. I also do this
  but it's clearly not a good idea.

 You propose a clean and (perhaps too) easy way to do the job. This is
 fresh. This is nice to have a new view on this complex problem.
  So, Robert, Other, we need to talk about this to create a robust, clean
 and easy way to do shader 

Re: [osg-users] #pragma(tic) shader composition support now checked into svn/trunk

2015-02-15 Thread David Callu
2015-02-14 18:52 GMT+01:00 Robert Osfield robert.osfi...@gmail.com:

 Hi David,


 On 14 February 2015 at 14:24, David Callu led...@gmail.com wrote:

 I also implement a shader composition framework for a client, based on
 osg shader composition, so remove it will be a big loss.
 My implementation handle OpenGL version, some pragma (optimize and
 debug), generate a main function for vertex and fragment shader based on
 what is found in shaderComponent list. So change from previous shader
 composition to new one will not be  straight forward.


 Is there a chance you could create an example that illustrates how you are
 using the old osg::ShaderComposition framework?


An example will not compile and require the two NodeKit I done to implement
Shader Composition to be comprehensible. But I can explain the main process:

I derived osg::ShaderComponent to containe shader code and provide
information how to assemble this component with other
shader component (input data and output data, version/extension
requirement, GLSL buildin variable used, ...).
I use ShaderAttribute that hold ShaderComponent (code) and uniform (data
used by code)
During draw stage, osg::StateSet are applied in osg::State, shaderAttribute
are stacked and shadercomponent are collected.
osg::State::ShaderComposition flag is enable so shader composer is used.
Then I derived from osg::ShaderComposer to implement my own composer by
reimplementing osg::ShaderComposer::getOrCreateProgram(...).

The part I never use is osg::Shader::*CodeInjection*

Other part of ShaderComposition could not be move in external nodekit
because osg::State use them. I talk about
osg::StateAttribute::_shaderComponent and osg::ShaderComposer. This last
one could just provide virtual method getOrCreateProgram(...).





 some thought about new shader composition

 1)
 OpenGL Shading Language specification
 3.3 Preprocessor :
 #pragma allows implementation dependent compiler control

 so pragma requires and import_defines should be use by shader
 compiler, replace them by osg_requires and osg_import_defines could
 be prevent futur pragma collisions. Thought ?



 Right now I would prefer to avoid adding the osg_ prefix as it's a bit
 clumsy, and the approach needed be OSG specific.

 I am consider other additions as well - such as having shaders be able to
 request the linking of other shaders - so the app could link a single main
 shader that pulls in the rest of the shaders to be linked to the program.
 Another possible addition would be to have osg::Program settings
 controllable via #pragmas.  Right now I want to keep things simple though.

ok



 2)

 Define a main function with all possibility and use define to choose the
 ones to enable and the ones to not will make
 a really complex shader, imagine, you optionally use
 - instancing
 - bump/deplacement mapping
 - vertex blending
 - material/texture/multi-texture
 - lighting/shadow
 - fog
 - physic
 - one/multi fragment output
 You will be quickly crazy. The one that work with SpeedTree Shader knows
 what I am talking about.


 The new shader composition framework doesn't add complexity where none
 exists.  If there are many different combinations that need to be supported
 then this complexity will be reflected in the shaders, but at least the
 developer will be able to see it directly and account for the possibility
 of different combinations.


If the main function is totally generated, developer don't have to fight
with a complex main function, hard to write/maintain/understand.
In a realistic simulation, environmental and atmospheric effect is the some
for all element in the scene. Light, fog, wind, ...
are applied on all drawn element. But drawables will need different shader
to be rendered. There are standard drawable (vertex, normal, texCoord),
tessellated drawable, generated geometry in geometry shader,
bump/displacement mapping... So all this element will add more and more
complexity to the main function of each pre-rasterization shader.
And now my realistic simulation need to draw all element in the scene, but
with a thermal vision or other non conventional vision.
So I need to change fragment shader code and add new combinations to draw
as I want, change vertex shader output, change
fragment shader input, ...
And now I have all my shader stage with really complex main functions, I
spend many time to create them. I am afraid each time I have to change
them. And more over, If I have to do the same thing for another simulation,
I have to rewrite new main function that will grow in complexity if a need
more feature.
What I need is a system that integrate new feature with only few additional
work, and be reusable as-is for any existing or futur scene. (And no I'm
not a dreamer)


Unifoms should be able to take over at least part of the attribute role.
In the case of fallbacks for things like osg::Light/glLight we'd need these
atttributes to provides one or more Uniforms when they are needed.  It
could

Re: [osg-users] #pragma(tic) shader composition support now checked into svn/trunk

2015-02-14 Thread David Callu
Hi Robert, Hi all


I also implement a shader composition framework for a client, based on osg
shader composition, so remove it will be a big loss.
My implementation handle OpenGL version, some pragma (optimize and debug),
generate a main function for vertex and fragment shader based on what is
found in shaderComponent list. So change from previous shader composition
to new one will not be  straight forward.



some thought about new shader composition

1)
OpenGL Shading Language specification
3.3 Preprocessor :
#pragma allows implementation dependent compiler control

so pragma requires and import_defines should be use by shader compiler,
replace them by osg_requires and osg_import_defines could be prevent
futur pragma collisions. Thought ?

but pragma is an elegant way to insert information directly in shader code.
well spot !!!




2)
Define a main function with all possibility and use define to choose the
ones to enable and the ones to not will make
a really complex shader, imagine, you optionally use
- instancing
- bump/deplacement mapping
- vertex blending
- material/texture/multi-texture
- lighting/shadow
- fog
- physic
- one/multi fragment output
You will be quickly crazy. The one that work with SpeedTree Shader knows
what I am talking about.
This is why I prefer your previous approach that inject code found in
StateAttribute in final program.
It is also less intrusive. If i need to insert a new shader component in
the program, no need to change main
shader. More over, I introduce some new ShaderAttribute like camera to
define where fragment shader output have to go,
or drawable to define which vertex shader input are available, Instance
to optionally use draw instance, ... so don't remove ShaderAttribute. With
modern OpenGL and depreciated data like fog, light, ... we need a way to
introduce our custom attribute.
I create a nodekit osgLighting just to manage different light source. I
have 5 different light source (sun, car, streetlight, ...) that all use
shaderAttribute to define data that compose the light and shader that use
this data. So don't remove shaderAttribute this is really a good idea you
have here !!!


3)
On a performance point of view, it will be a good thing to use subroutine
to enable/disable feature.
Many different path in shader composition result in many different program.
And so many change
of program in one frame, perhaps use the program A, then the program B,
then the program A again...
This is the main problem I currently have in my shader composition
implementation.

4)
I always think that lack of define injection in shader is a drawback in osg.
With your function and name convention,
this will be difficult to add this feature. Replace import_define by
import_module will fix this.
Because we talk about shader module, lighting, fog, bump mapping, shadow
... all of this could be define as shader module.




I really think that shader composition is a big piece of software, really
usefull, and really complex.
I think we need a  debate about this with all user that have already try to
implement a shader composition.
Clearly define our needs (have reusable module, keep code in shader files,
use OpenGL feature to improve performance like subroutine, pipeline object,
...), debate about solution, propose implementation...


This problem is really new and so few research has be done an the subject.
I did my first implementation in octobre 2010
I have used my shader composition in many way. Found some cool stuff and
other bad about my design. I look for existing solution
on internet, I found some one like libsh http://libsh.org/ but not easy
and clean way to solve it. Recently i found CosMo
http://www.vrvis.at/publications/pdfs/PB-VRVis-2014-001.pdf that did the
job in many way
like my implementation, but more deeply in abstraction of the code. They
don't think in term of shader but in term of
pipeline graphics, shader composition will decide which code put in vertex/
tessellation/geometry/fragment shader. I also do this
but it's clearly not a good idea.

You propose a clean and (perhaps too) easy way to do the job. This is
fresh. This is nice to have a new view on this complex problem.
So, Robert, Other, we need to talk about this to create a robust, clean and
easy way to do shader composition.

Thought ?

My 2 cents
David



2015-02-13 19:01 GMT+01:00 Robert Osfield robert.osfi...@gmail.com:

 Hi All,

 Attached is a screenshot of running (clock.osgt is in OpenSceneGraph-Data):

   osgshadercomposition clock.osgt

 A very simple example that provides a single osg::Program that have five
 different shader combinations used on the same subgraph to produce
 different results.  From left to right they are:

1) White unlit box - is the default implementation with no define's
 supplied from osg::StateSet's so no texturing or lighting

2) White lit box - GL_LIGHTING define is provided to the shaders via
 the stateset-setDefine(GL_LIGHTING);

3) Textured unlit box, 

Re: [osg-users] Not coding all the time? Running the West Highland Way tomorrow!

2014-06-20 Thread David Callu
Crazy stuff !!

for more info : http://westhighlandwayrace.org/entry/2014-entry-list/

Good luke Robert !!!

We will take a look Sunday on the result page
http://westhighlandwayrace.org/results/

Regards
David


2014-06-20 19:06 GMT+02:00 Robert Osfield robert.osfi...@gmail.com:

 Hi Michael,

 On 20 June 2014 16:05, michael kapelko korn...@gmail.com wrote:
  Wow. It's good to hear you take care of your health. But how many hours
 will
  it take to run such a long distance? Will you run it in several
 iterations
  or a single one?

 It's done all in one go, we have 35hrs to complete the course.
 Starting 1am tomorrow morning.

 I aiming to finishing between 20hrs and 24hrs but it could be well
 into the Sunday morning before I'm finished if things don't go to
 plan.  It's a hilly route so you walk the ascents and run the
 downhills and flatter parts.  There isn't many flatter parts though..
 it is the Highlands of Scotland :-)

 Robert.
 ___
 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


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

2014-06-03 Thread David Callu
Hi Robert

Even if this change break the API, this seem the best choice to keep
OSG consistency

Cheers
David

2014-06-03 12:05 GMT+02:00 Robert Osfield robert.osfi...@gmail.com:
 Hi All,

 I have returned to the task of refactoring of the core OSG to
 facilitate the promotion of Drawable to Node status.  I have checked
 in the following changes:

 1) I have removed the temporary osg::Bound adapter class, while this
 helped with porting there was a couple of cases where crashes were
 occurring that were getting awkward to workaround, so rather than make
 core more convoluted I have simply removed the class.  This does mean
 end user code will need to be refactored to handle the fact that
 Drawable::getBound() now returns a BoundingSphere, but I believe on
 balance this is the better compromise.

 2) I have refactored osg::Geode so that it now subclasses from
 osg::Group rather than osg::Node, and have changed the
 Geode::addDrawable/removeDrawable etc. calls to use the
 Group::_children list to store the Drawable rather than it's own local
 container.  This mean that one can call Geode::addChild() rather than
 addDrawable(), but addDrawable() just calls addChild() so they are
 effectively interchangable.  However, the addChild() allows you to add
 any type of Node, while addDrawable() just allows you to pass in
 Drawable.   This means potentially you could mix and match different
 node types within a Geode rather than just the Drawables that it once
 could.  Code that assumes that all children of Geode will be a
 Drawable could potentially need updating, however, all old code that
 populates a Geode will be fine.  For modern usage one wouldn't need to
 use a Geode so I don't think this will be a big issue.

 3) I have removed the composite methods
 (addChild/insertChild/removeChild) from osg::Node.

 4) I have reverted the change to the Node::ParentList, changing from
 std::vectorNode* back to std::vectorGroup*.  I have also update
 the various getParent() calls in the OSG codebase back to using Group
 pointer.

 Change 1 could break the build for some users, while the change 2 to 4
 should help porting as the usage will actually be closer to what
 original code base used.

 All these changes are now checked into svn/trunk.

 Cheers,
 Robert.
 ___
 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


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

2014-05-14 Thread David Callu
Hi All,


Promoting osg::Drawable from being subclassed from osg::Object to
osg::Node is really a good idea ?
Why osg::Drawable is a subclass of osg::Object in original design ?
Which concept are implemented by this design?
Except avoid the use of geode, what is the benefice of the new design ?

I use many time in my code one Geode with one drawable, and think to
myself that could be easiest to just attach a Drawable to a Group. But
a drawable is not a node. Don't forget the first coding rules of Agile
Software The Single Responsibility Principle. Drawable (and his
subclass) have to handle rendering of something. This is already a big
stuff, no need to add node concept in this class.

With the new design, osg::Geode is no longer a leaf node neither a
group, if it become a group, we need to check in add/removeChild
method if the node is a drawable or not, instead of constraint this by
design like this is done in original code.

osg::ParentList is not longer a list of osg::Group ... so other
thing that a group could be a parent? any node subclass  should be a
parent ? We have loose some concept in the process, logic of
Node/Group/Geode/Drawable is not really clear.


So ask yourself. Why drawable is not a subclass of osg node, and why
do we need to use a Geode ?
If you have no answer think again.
If you have an answer, could we avoid the concept implemented by
osg::Geode/osg::Drawable ?


My 2 cents

David




2014-05-14 18:08 GMT+02:00 Robert Osfield robert.osfi...@gmail.com:
 Hi All,

 I have now checked in further improvements to the Drawable/Node Bound
 changes.  You can now compile and run the OSG with or without the new
 Bound adapter class.

 I am still undecided about the merits of the Bound class.  My C++
 developer instinct is not have the Bond class and push end user code
 to be refactored to use drawable-getBoundingBox() in place of old
 getBound() usage.  While as caretaker of the OSG codebase I really
 don't want to force users to handle broken builds because of change to
 the core.

 One thing we could do is just try out how end user applications cope
 with the new changes with the Bound class compiled as default, if that
 works OK, then disable the default build of the Bound class and then
 get feedback from the community about the extent of the build
 breakages.

 Robert.
 ___
 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


Re: [osg-users] osgDesigner or other Editor

2014-02-27 Thread David Callu
Hi Daniel

I did osgDesigner with 2 friends as a end-studies project 7 years ago, It
is base on osgIntrospection and Qt. If I remember well,
you should see value of reflected class, but no change them, or not easely.

Today, I use a text editor and edit .osgt files. Whit this way, you could
only change value properties,  but not easely add/remove ones  or change
the structure of the scene graph.

I plan since some month/years to rework on osgDesigner, but I'm to busy by
client work and family stuff for now.

Regards
David


2014-02-26 8:14 GMT+01:00 Daniel Schmid daniel.sch...@swiss-simtec.ch:

 Hi all

 I know this topic comes from time to time. But it is a real pitty that
 there seems to be no good Editor that allows you to modify .osg files. I
 know that I can use blender or similar, but I when I really need to modify
 stuff in the scenegraph and classes that are proper to osg, then this is a
 real pain.

 I did another search today along side osgEdit osgscenemaker and similar,
 and I found osgDesigner. I was able to load a model, but couln't find a way
 to modify properties...

 - Is there anyone with experience with osgDesigner?
 - What tool do you use to modify .osg files?

 Thank you!

 Cheers,
 Daniel

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=58382#58382





 ___
 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


Re: [osg-users] Version numbers in dynamic libraries

2013-09-25 Thread David Callu
Hi Tony

not sure but disable OPENSCENEGRAPH_SONAMES and OPENTHREADS_SONAMES in
cmake.

HTH
David



2013/9/25 Tony Vasile ming...@gmail.com

 When we link our executables on our linux box we are getting version
 numbers in the .so.
 For example if I do an ldd on an executable compiled against
 OpenSceneGraph 2.8.0 I get :

 libosgUtil.so.65 = /usr/local/lib/libosgGA.so.65

 Is there any way to link the programs so that ldd only has references like:

 libosgUtil.so = /usr/local/lib/libosgGA.so

 or some such without the version number?

 Tony Vasile

 ___
 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


Re: [osg-users] Unwanted effect with two effect nodes in the line of sight (see-through)

2013-09-25 Thread David Callu
Hi Florian

We can't really help you without know how work your multi pass system.

My guess is that osg draw your first  pass #1 - draw original with a little
offset, then transparency pass, then pass #2 - draw tinted.
You can use osg::StateSet::RenderingHint(osg::StateSet::TRANSPARENT_BIN) in
your transparency stateSet
this will tell to osg that your geometry is transparency and have to be
draw after other drawable and from front to back order

Take a look to osg::StateSet::setRenderBinDetails and osgUtil::RenderBin
and how all of this work.

HTH
David


2013/9/25 Florian Kolbe florian.ko...@in-gmbh.de

 Hi,

 1. for transparent walls we use our own node (derived from Effect) - see
 code below
 2. for tinting objects, we also use an effect node derived from Effect
 - see code below

 Used by themselves, everything works fine. But if we have a tinted
 object behind a transparent object, the tinting effect is gone (see
 screenshot).

 Code for transparency effect:

 Code:
 void define_passes()
 {
 // implement pass #1
 {
 // s.a. http://www.mail-archive.com//msg13796.html
 osg::ref_ptrosg::StateSet stateSet = new osg::StateSet;

 // mat
 osg::Material* mat = new osg::Material;
 mat-setAlpha(osg::Material::FRONT_AND_BACK, alpha);
 stateSet-setAttributeAndModes(mat,
 osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE);

 // backface culling, führt dazu dass innere Rückseiten
 nicht angezeigt werden
 osg::CullFace* cull = new osg::CullFace();
 cull-setMode(osg::CullFace::BACK);
 stateSet-setAttributeAndModes(cull,
 osg::StateAttribute::ON);

 // turn on blending
 osg::BlendFunc* bf = new
 osg::BlendFunc(osg::BlendFunc::SRC_ALPHA,
 osg::BlendFunc::ONE_MINUS_SRC_ALPHA );
 stateSet-setMode(GL_BLEND, osg::StateAttribute::ON |
 osg::StateAttribute::OVERRIDE);
 stateSet-setAttributeAndModes(bf);
 // rendering hints
 stateSet-setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
 // lighting
 stateSet-setMode(GL_LIGHTING, osg::StateAttribute::OFF);

 addPass(stateSet.get());
 }
 }



 Code for coloring effect:

 Code:
 void define_passes()
 {
 // implement pass #1 - draw original with a little offset
 {
 osg::ref_ptrosg::StateSet ss = new osg::StateSet;

 osg::ref_ptrosg::PolygonOffset polyoffset = new
 osg::PolygonOffset;
 polyoffset-setFactor(1.0f);
 polyoffset-setUnits(1.0f);
 ss-setAttributeAndModes(polyoffset.get(),
 osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 addPass(ss.get());
 }
 // implement pass #2 - draw tinted
 {
 osg::ref_ptrosg::StateSet ss = new osg::StateSet;
 // Material überschreiben
 ss-setAttributeAndModes(_wf_mat.get(),
 osg::StateAttribute::OVERRIDE|osg::StateAttribute::ON);

 // notwendig, damit alpha greift

 ss-setMode(GL_BLEND,osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);

 addPass(ss.get());
 }
 }



 See attached image:
 The fire extinguisher should be all yellow, but behind the transparent
 wall - it is as if it was rendered without the effect.

 I hope someone can sched some light on this issue?

 Thank you!

 Florian

 PS sorry if the code snippets come out weird, leading space for
 indentation somehow goes wrong...[/img][/code]

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=56477#56477




 Attachments:
 http://forum.openscenegraph.org//files/transparency_bug_132.png


 ___
 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


Re: [osg-users] Multiple slave cameras render to a single texture

2013-08-23 Thread David Callu
Hi Alexandre

Yes
You could use viewport do control size/location where camera will draw in
the Frambuffer (or Texture in your case)
take a look to
  glViewport,
  osg::Viewport
  osg::Camera::setViewport

HTH
David




2013/8/22 Alexandre Vaillancourt alexandre.vaillancourt.l...@gmail.com

 Hello All,

 Is it possible to have multiple slave cameras draw on different parts of a
 single texture? (To do some post-process on it for instance.)

 Thanks

 --
 Alexandre Vaillancourt

 ___
 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


Re: [osg-users] Please test svn/trunk in prep for 3.1.8 dev release

2013-06-20 Thread David Callu
Hi Robert,

Build and run fine on
Debian 7.1 Wheezy
GCC 4.7.2
OpenGL version string: 4.3.0 NVIDIA 319.17

Cheers
David


2013/6/20 Robert Osfield robert.osfi...@gmail.com

 Hi All,

 I'm now ready to make the 3.1.8 dev release, but will wait a couple
 more hours for build and runtime testing feedback, so please test and
 report success/failure.

 Cheers,
 Robert.
 ___
 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


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

2013-06-13 Thread David Callu
Hi all

Aurelien :
GML is effectively the library i regularly look/use when a mathematics
feature is missing in osg,
so take idea from it, specially the half float, will save a lot of work
from me. Thanks


Robert:

About what we could add

this is really usefull,
- operator + - * / += -= *= /= (value_type)
- operator + - += -= (vec_type)
- operator -() for signed type
- componentMultiply, componentDivide
any user want a good operator support for fundamental type

this is convenient method
- swizzle, this meen 256 possible functions for Vec4, 512 possible
functions for xyzw and rgba combinaison
- constructor like in GLSL : Vec4(Vec2, Vec2) or  Vec4(float, Vec2, float)
or Vec4(float, Vec3),
if this feature are hot implemented, osg user will not say aarrrggg, where
is the function !!!



About why it's important that we have this additional functionality

I read/hear some programming rules, One well know is release early,
release often
another I think good is 'library implement all possible feature, executable
implement required feature.
This is not the exact sentence, i can't find it on google, but this is the
idea.

This is why I would like to have a complete vec{2,3,4} implementation.
Why I want to add all available opengl feature in OSG.
even if I don't use/need this feature today.

Robert, Aurelien, other, what it your opinion about this ?


Cheers
David



2013/6/13 Robert Osfield robert.osfi...@gmail.com

 Hi David et. al,

 On 12 June 2013 18:52, David Callu led...@gmail.com wrote:
  About Vec{2,3,4]{b,s,i,ub,us,ub}, I think we need to do a code
 harmonisation
  of all this header to provide
  - operator + - * / += -= *= /= (value_type)
  - operator + - += -= (vec_type)
  - operator -() for signed type
  - componentMultiply, componentDivide
 
  - swizzle, this meen 256 possible functions for Vec4, 512 possible
 functions
  for xyzw and rgba combinaison
  - constructor like in GLSL : Vec4(Vec2, Vec2) or  Vec4(float, Vec2,
 float)
  or Vec4(float, Vec3),
 
 
  - use of template
 
  thoughts ?

 My overriding thought is implement what we actually need, not what we
 think we might need.

 So if there is something specific that is missing that people really
 need then I think it would be appropriate to add, if it's a
 convenience method that a few people might find useful then I don't
 believe the extra code is justified, the greater the additional
 interface and implementation code the greater the bar that the code
 has to jump over to justify itself.

 So far most of the discussion looks to be about what we could add
 rather than why it's important that we have this additional
 functionality.

 Cheers,
 Robert.
 ___
 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


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

2013-06-13 Thread David Callu
Features have to implemented, ported and maintained, the more features
 you stuff into the code to more less each feature gets tested and
 debugged, and the lower the user to feature ratio is, so the less
 available resources you have to maintain each line of code, so... code
 quality goes down and down and down.


Really good answer in point of view of maintainer, and this is not a
negligible think.

Now see this in point of view of user. Little stuff like swizzle in
Vec{2,3,4} is not really
important, but implementation of all glDraw* command, Debug output,
Conditionnal rendering, ... and other OpenGL
feature, not required to use OpenGL, but just another way to use openGL,
are important.
For example, we already have glDrawElements and glDrawInstancedElements, we
not really need of
glDrawElementsInstanced{BaseInstance}{BaseVertex} or glDrawElementIndirect
but this could be a good
think to add them in osg.

For new osg-user that evaluate osg, this could be one of decisive thing to
choose osg instead of another 3D engine.

In my position, if something is missing in osg, I just implement it and
this solve the problem.
For other osg-user, perhaps they don't know how to implement a missing
feature and just wait someone
do it, or choose another 3D engine.


As you say, we need to carefully choose what we add in OSG,
but I think OpenGL feature have to be add before we need it,
to be sure that OSG is a fine layer over OpenGL and not a fine
layer over a subset of OpenGL.


thoughts ?


Cheers
David
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2013-06-13 Thread David Callu
Hi Robert

Thanks for the answer and thanks to keep OSG on the good way.
I will try to follow your rules about features that all OSG user will
rely upon, and niche features that a fair number of OSG users will
rely upon.

Don't blame me if I still try to add niche feature, this is not always easy
to do the good selection.

Best Regards
David




2013/6/13 Robert Osfield robert.osfi...@gmail.com

 Hi David,

 On 13 June 2013 15:31, David Callu led...@gmail.com wrote:
  As you say, we need to carefully choose what we add in OSG,
  but I think OpenGL feature have to be add before we need it,
  to be sure that OSG is a fine layer over OpenGL and not a fine
  layer over a subset of OpenGL.

 I don't believe the OSG should try and map all features OpenGL, rather
 just focus on the key features that all OSG will rely upon, and niche
 features that a fair number of OSG users will rely upon.  For niche
 features that used by few users we still need to be able to provide a
 path to implementing these features on the user side.

 For instance osg::StateAttribute system is extensible as is
 osg::Drawable allow users to integrate the OSG with NVidia specific
 extensions in the case of the osgNV library, and OpenCL etc.

 Know where to keep the niche features is something we have to
 continuously evaluate - once niche features can become mainstream,
 while once mainstream features can and sometimes should fall out of
 use.  An example of the later is OpenGL slow paths such as
 BIND_PER_PRIMITIVE and vertex indices that aren't even supported by
 modern OpenGL.  The fixed function pipeline will eventually go this
 way too.

 Being able to migrate things from external to the OSG to core OSG and
 back out again is something we will need to do.  Sometimes just making
 a feature usage may require modifications of the core OSG, even when
 the actual feature is implemented external to the OSG.

 I believe this flexibility has helped the OSG over years stay
 relevant, unfortunately we've also accumulated a bit of cruft that
 needs weeding out - like the slow path stuff in osg::Geometry.
 Avoiding cruft building up is also part of why I don't just accept any
 feature addition to the OSG, and why you see me pushing back on
 threads like this.  Often times when I have to easily accepted feature
 additions to the OSG it's come back to bite us - with extra NodeKits
 that have never quite fulfilled that original purpose and are now
 largely orphaned.

 Robert.
 ___
 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] Vec{2,3,4}{b,s,i,f,d,ub,us,ui} harmonisation

2013-06-12 Thread David Callu
Hi Robert, Hi All


About Vec{2,3,4]{b,s,i,ub,us,ub}, I think we need to do a code harmonisation
of all this header to provide
- operator + - * / += -= *= /= (value_type)
- operator + - += -= (vec_type)
- operator -() for signed type
- componentMultiply, componentDivide


- swizzle, this meen 256 possible functions for Vec4, 512 possible
functions for xyzw and rgba combinaison
- constructor like in GLSL : Vec4(Vec2, Vec2) or  Vec4(float, Vec2, float)
or Vec4(float, Vec3),


- use of template


thoughts ?
David
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2013-06-12 Thread David Callu
forgot [osg-users] in Object


Hi Robert, Hi All


 About Vec{2,3,4]{b,s,i,ub,us,ub}, I think we need to do a code
 harmonisation
 of all this header to provide
 - operator + - * / += -= *= /= (value_type)
 - operator + - += -= (vec_type)
 - operator -() for signed type
 - componentMultiply, componentDivide


 - swizzle, this meen 256 possible functions for Vec4, 512 possible
 functions for xyzw and rgba combinaison
 - constructor like in GLSL : Vec4(Vec2, Vec2) or  Vec4(float, Vec2, float)
 or Vec4(float, Vec3),


 - use of template


 thoughts ?
 David

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] singleton instane

2013-04-26 Thread David Callu
Hi Sajjadul,

There are nothing in OSG to do this, but make a class a singleton is really
straightforward.

- make constructor protected or private,
- add a static getInstance function

MyClass  getInstance()
{
static MyClass * myClass = new MyClass();
return *myClass;
}

then use it in your code

MyClass::getInstance().doStuff();

alternatively, you can google 'boost+singleton' to see some examples of
implementation

HTH
David


2013/4/26 Sajjadul Islam dosto.wa...@gmail.com

 Hello forum,

 I have a class declaration and i want to create a singleton instance to it.

 Is there any utility class inside OSG that enables something like this?

 Thank you!

 Cheers,
 Sajjadul

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=53820#53820





 ___
 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


Re: [osg-users] singleton instane

2013-04-26 Thread David Callu
oups beter like this, or with any other smart pointer

MyClass  getInstance()
{
static osg::ref_ptrMyClass myClass( new MyClass() );
return *myClass;
}



2013/4/26 David Callu led...@gmail.com

 Hi Sajjadul,

 There are nothing in OSG to do this, but make a class a singleton is
 really straightforward.

 - make constructor protected or private,
 - add a static getInstance function

 MyClass  getInstance()
 {
 static MyClass * myClass = new MyClass();
 return *myClass;
 }

 then use it in your code

 MyClass::getInstance().doStuff();

 alternatively, you can google 'boost+singleton' to see some examples of
 implementation

 HTH
 David



 2013/4/26 Sajjadul Islam dosto.wa...@gmail.com

 Hello forum,

 I have a class declaration and i want to create a singleton instance to
 it.

 Is there any utility class inside OSG that enables something like this?

 Thank you!

 Cheers,
 Sajjadul

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=53820#53820





 ___
 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


Re: [osg-users] singleton instane

2013-04-26 Thread David Callu
Hi Jan,

This is not for reference counting but to not forget to delete the instance
when program end.

Regards
David

2013/4/26 Jan Ciger jan.ci...@gmail.com

 On 04/26/2013 11:18 AM, David Callu wrote:

 oups beter like this, or with any other smart pointer

 MyClass  getInstance()
 {
  static osg::ref_ptrMyClass myClass( new MyClass() );
  return *myClass;
 }


 I wonder, why would you want a reference counting smart pointer for a
 singleton? There will be only a single instance, no matter what you do, so
 the smart pointer is useless.

 Regards,

 Jan

 __**_
 osg-users mailing list
 osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.**org/listinfo.cgi/osg-users-**
 openscenegraph.orghttp://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


Re: [osg-users] Finding Node Level

2013-03-29 Thread David Callu
Hi Max

If by level you mean how deep the node is in the graph, there are nothing
like this in OSG.
Indeed, you have to traverse the graph with a custom osg::NodeVisitor.
You could store information in osg::Object::setUserDataContainer(...).
osg::Object is the base class of osg::Node.

HTH
David

2013/3/27 Max Ashton m...@half-a-pixel.co.uk

 Hi guys,

 Sorry for the beginner question but I can't seem to find the answer in the
 documentation.

 How would one go about finding the level of a node in the tree, i'm
 presuming that the node knows its level. Or is it something I would have to
 work out by traversing the tree and then storing it myself??

 Just trying to avoid rewriting something that may already be there

 Thank you!

 Kind Regards
 Max

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=53339#53339





 ___
 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


Re: [osg-users] Vertex order

2013-03-29 Thread David Callu
Hi Gabriel,

OSG is a fine layer over OpenGL, so the vertex order rule
is the same as OpenGL. You code seem good.

Error is probably in the rest of the code we don't have.

HTH
David

2013/3/27 Gabriel Francu gabi.fra...@yahoo.com

 Hi,

 I try to build a very simple shape, represented in sketch.png.


 Code:

 osg::Vec3Array *points = new osg::Vec3Array();
 points-push_back( osg::Vec3( -0.5f, -0.5f, -0.5f ) );
 points-push_back( osg::Vec3( 0.5f, -0.5f, -0.5f ) );
 points-push_back( osg::Vec3( -0.5f, 0.5f, -0.5f ) );
 points-push_back( osg::Vec3( 0.5f, 0.5f, -0.5f ) );
 points-push_back( osg::Vec3( 0.5f, 0.5f, 0.5f ) );
 points-push_back( osg::Vec3( -0.5f, 0.5f, 0.5f ) );

 osg::DrawElementsUInt *faces = new osg::DrawElementsUInt(GL_TRIANGLES);
 faces-push_back(2); faces-push_back(0); faces-push_back(1);
 faces-push_back(2); faces-push_back(1); faces-push_back(3);



 Then three versions
 left

 Code:

 faces-push_back(2); faces-push_back(3); faces-push_back(4);
 faces-push_back(2); faces-push_back(4); faces-push_back(5);



 center

 Code:

 faces-push_back(3); faces-push_back(4); faces-push_back(2);
 faces-push_back(4); faces-push_back(5); faces-push_back(2);



 right

 Code:

 faces-push_back(4); faces-push_back(2); faces-push_back(3);
 faces-push_back(5); faces-push_back(2); faces-push_back(4);




 The order of vertices in center and right version is only rotated from the
 left version.
 Then I add the normals, with BIND_PER_VERTEX. I use a flat render mode.

 Why only the left version gives the correct result? Is there a rule for
 the vertex ordering?

 Thank you!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=53340#53340




 Attachments:
 http://forum.openscenegraph.org//files/result_209.png
 http://forum.openscenegraph.org//files/sketch_204.png


 ___
 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


Re: [osg-users] Save optimized scene (Big loading time, openflight)

2013-03-25 Thread David Callu
Hi Sergey

I'm not familiarized with OpenFlight loader,

But you could use osgconv to convert your model from flt to osgb.
Then use the osgb version in your application. This way, you use an
optimized
scene and read the native osg format when you load the model that will
speed up the read process.

HTH
David

2013/3/11 Sergey Bud sergey...@xakep.ru

 Hi,
 I am using openscenegraph 3.0.1 with Visual Studio 2010. Everything is
 working fine, I assume build is fine.

 Now I am trying to load OpenFlight models and terrains to my scene. The
 openflight plugin seem to have a  osgUtil::Optimizer::optimize() call
 inside it so it optimizes every loaded model.

 Code:

 // File ReaderWriter.flt
 // virtual ReadResult readNode(const std::string file, const Options*
 options) const
 // ...
 if (!document.getPreserveFace())
 {
 osgUtil::Optimizer optimizer;
 optimizer.optimize(document.getHeaderNode(),
 osgUtil::Optimizer::SHARE_DUPLICATE_STATE |
 osgUtil::Optimizer::MERGE_GEOMETRY |
 osgUtil::Optimizer::MERGE_GEODES |
 osgUtil::Optimizer::TESSELLATE_GEOMETRY |
 osgUtil::Optimizer::STATIC_OBJECT_DETECTION);
 }
 // ...




 So, the optimisation is helpfull, it cuts a lot of StateSet, Geode etc.
 nodes, but takes a lot of time. So I am trying to save the optimized
 model/terrain back to the file:

 Code:

 // the optimization is taking place in this instruction, inside the plugin
 code.
 osg::ref_ptrosg::Node root = osgDB::readNodeFile(model.flt);
 osgDB::writeNodeFile(*root,model_optimized.flt);




 But all I get is the file with different size (why?), but with the same
 stats (with the same amount of StateSet and others node) like the
 optimization never took place.

 Is it because this optimization is such that optimized scene cannot be
 saved, or am I doing something wrong?

 Please advise me how to either save optimized graph, or decrease loading
 time in any other way.

 Thank you!

 Cheers,
 Sergey

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=53024#53024





 ___
 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


Re: [osg-users] osg crashes when remove child

2013-03-08 Thread David Callu
I Lucie

You probably run OSG and  GUI in 2 different thread, and you try to
manipulate OSG data from GUI thread.

You have created the dll C++ that wrappe OSG. So you can modify it.

You need an asynchronous mechanism to say to OSG add node or remove
node or anything else
 like a queue of 'action' fill by GUI and done by OSG.
 ex : GUI create a custom object AddNode that contain a list of file to
add, put it in queue action, then OSG will does,
 at the good time (before event pass), look in queue action and process
action find.

or

You need a synchronisation mechanism in osgViewer::ViewerBase::frame like a
mutex locked before the even pass and unlocked after the cull/draw pass,
and you have to export, from the C++ dll, some function that does action
you want (add node/remove node/...).
this function must lock the mutex before process any action, so you are
sure that your action is not done during even/update/cull pass.


first solution is more complex but your application (GUI thread) will never
be stopped by OSG thread. Their work in asynchronous mode.
The second is perhaps more simple but if OSG take 5 second to do the
action, GUI will freeze during 5 second. Their work in synchronous mode.


HTH
David



2013/3/8 lucie lemonnier lucielemonn...@hotmail.fr

 With SingleThreaded, osg also crashes with the same error.

 lucie

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=52997#52997





 ___
 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


Re: [osg-users] osg crashes when remove child

2013-03-07 Thread David Callu
Hi Lucie,

It seem that you try to remove children during cull pass (ie when
cullVisitor go through sceneGraph).

For each frame, the main loop use visitor to do many operation on
scenegraph :

even pass : EvenVisitor to dispatch even
update pass : UpdateVisitor to allow Node/StateSet/... to update their
values
cull and draw pass : CullVisitor to select visible node in sceneGraph and
construct RenderBin Graph.

If you want to change scenegraph structure (ex remove children) you have to
do it before even pass
but not during a visitor do some stuff on SceneGraph.


take a look to osgViewer::ViewerBase::frame() function where this 3 pass
are done.


HTH
David


2013/3/7 lucie lemonnier lucielemonn...@hotmail.fr

 Hi,
 I embed osg in wpf application with this code :

 http://www.openscenegraph.org/projects/osg/wiki/Support/FAQ#HowdoIembedanOSGviewerina.NETcontrol

 I load a scene of vrml files.
 osg::Group* root = new osgGroup();
 for(int i = 0; i  listFichiers.size(); i++){
 osg::Node* node = osgDB::readNodeFile(listFichiers[i]);
 node-setDataVariance(osg::Object::DYNAMIC);
 root-addChild(node);
 }


 When I want to remove scene to load another scene
 (root-removeChildren(0,root-getNumChildren())), osg crashes with error :
 Debug assertion failed :
 Expression:(this-_Has_container(),0)
 ...

 The call stack is stop on this :
 osg80-osgd.dll!std::_Vector_const_iteratorosg::ref_ptrosg::Node,std::allocatorosg::ref_ptrosg::Node
  ::operator++()  Ligne 116 + 0x3a octetsC++

 osg80-osgd.dll!std::_Vector_iteratorosg::ref_ptrosg::Node,std::allocatorosg::ref_ptrosg::Node
  ::operator++()  Ligne 350C++
 osg80-osgd.dll!osg::Group::traverse(osg::NodeVisitor  nv={...})
  Ligne 60 + 0x8 octets C++
 osg80-osgd.dll!osg::NodeVisitor::traverse(osg::Node  node={...})
  Ligne 193 + 0x1c octets  C++

 osg80-osgUtild.dll!osgUtil::CullVisitor::handle_cull_callbacks_and_traverse(osg::Node
  node={...})  Ligne 312 + 0xf octets C++
 osg80-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group 
 node={...})  Ligne 1128 C++
 osg80-osgd.dll!osg::Group::accept(osg::NodeVisitor  nv={...})
  Ligne 38 + 0x41 octets  C++
 osg80-osgd.dll!osg::Group::traverse(osg::NodeVisitor  nv={...})
  Ligne 62 + 0x25 octetsC++
 osg80-osgd.dll!osg::NodeVisitor::traverse(osg::Node  node={...})
  Ligne 193 + 0x1c octets  C++

 osg80-osgUtild.dll!osgUtil::CullVisitor::handle_cull_callbacks_and_traverse(osg::Node
  node={...})  Ligne 312 + 0xf octets C++
 osg80-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group 
 node={...})  Ligne 1128 C++
 osg80-osgd.dll!osg::Group::accept(osg::NodeVisitor  nv={...})
  Ligne 38 + 0x41 octets  C++
 osg80-osgd.dll!osg::Group::traverse(osg::NodeVisitor  nv={...})
  Ligne 62 + 0x25 octetsC++
 osg80-osgd.dll!osg::NodeVisitor::traverse(osg::Node  node={...})
  Ligne 193 + 0x1c octets  C++

 osg80-osgUtild.dll!osgUtil::CullVisitor::handle_cull_callbacks_and_traverse(osg::Node
  node={...})  Ligne 312 + 0xf octets C++
 osg80-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group 
 node={...})  Ligne 1128 C++
 osg80-osgd.dll!osg::Group::accept(osg::NodeVisitor  nv={...})
  Ligne 38 + 0x41 octets  C++
 osg80-osgd.dll!osg::Group::traverse(osg::NodeVisitor  nv={...})
  Ligne 62 + 0x25 octetsC++
 osg80-osgd.dll!osg::NodeVisitor::traverse(osg::Node  node={...})
  Ligne 193 + 0x1c octets  C++

 osg80-osgUtild.dll!osgUtil::CullVisitor::handle_cull_callbacks_and_traverse(osg::Node
  node={...})  Ligne 312 + 0xf octets C++
 osg80-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group 
 node={...})  Ligne 1128 C++
 osg80-osgd.dll!osg::Group::accept(osg::NodeVisitor  nv={...})
  Ligne 38 + 0x41 octets  C++
 osg80-osgd.dll!osg::Group::traverse(osg::NodeVisitor  nv={...})
  Ligne 62 + 0x25 octetsC++
 osg80-osgd.dll!osg::NodeVisitor::traverse(osg::Node  node={...})
  Ligne 193 + 0x1c octets  C++

 osg80-osgUtild.dll!osgUtil::CullVisitor::handle_cull_callbacks_and_traverse(osg::Node
  node={...})  Ligne 312 + 0xf octets C++
 osg80-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group 
 node={...})  Ligne 1128 C++
 osg80-osgd.dll!osg::Group::accept(osg::NodeVisitor  nv={...})
  Ligne 38 + 0x41 octets  C++
 osg80-osgd.dll!osg::Group::traverse(osg::NodeVisitor  nv={...})
  Ligne 62 + 0x25 octetsC++
 osg80-osgd.dll!osg::NodeVisitor::traverse(osg::Node  node={...})
  Ligne 193 + 0x1c octets  C++

 osg80-osgUtild.dll!osgUtil::CullVisitor::handle_cull_callbacks_and_traverse(osg::Node
  node={...})  Ligne 312 + 0xf octets C++
 osg80-osgUtild.dll!osgUtil::CullVisitor::apply(osg::Group 
 node={...})  Ligne 1128 C++
 osg80-osgd.dll!osg::Group::accept(osg::NodeVisitor  nv={...})
  Ligne 38 + 0x41 octets  C++
 

Re: [osg-users] Getting Mipmap level from FBO

2012-10-30 Thread David Callu
Hi Sebastian


2012/10/30 Sebastian Messerschmidt sebastian.messerschm...@gmx.de

 Hello,

 I'm trying to implement an advanced HDR lighting algorithm where I need
 the average luminance of the last frame(s).
 Currently I've encountered two major problems:

 1. Is there a possibility to get only the last mipmap-level from
 texture/image bound to a FBO?
 I can get the whole image via readImageFromCurrentTexture in a
 postDrawCallback, but this unfortunately copies the complete texture.
 Looking at the code, I see that all mipmap levels are copied, and my
 question is if it would be feasible to either create a special function to
 copy only a specific mipmap-level or add an additional parameter to the
 function to specifiy the mipmap level?


I don't see any code in OSG to just read specific mipmap level, but with
readImageFromCurrentTexture code as model, this will not be difficult to
do appropriate function.




 2. I have trouble getting correct values from floating point buffers. It
 works if get the values as GL_UNSIGNED_BYTE (the values are indeed scaled
 to 0 -255) but this, of course, won't be precise enough as the buffer holds
 the logarithmic luminance.

check this :
- be sure to bind correct texture in Texture 0 :
state-applyTextureAttribute(0, myTextureToRead);
- be sure to active correct Texture Unit :
state-setActiveTextureUnit(0);
- be sure current texture have FLOAT internal Type :
osg::Image::computeFormatDataType(myTextureToRead-getInternalFormat()) ==
GL_FLOAT


And when you did
double data = *image-getMipmapData(0);
you read the buttom left pixel of the complet image, average luminance is
in the last mipmap level
double averageLuminance = *reinterprete_castdouble*(
image-getMipmapData(image-getNumMipmapLevels() - 1) );


HTH
David

Below you find a snippet of my PostDrawCallback, maybe I'm doint something
 fundamentally wrong.
 I'm running on OSG 3.0.1.

   virtual void operator () (osg::RenderInfo render_info) const
 {
 //state-apply(render_info.**getCurrentCamera()-**getStateSet());
 //state-**applyTextureAttribute(0,**mTexture);
 //mTexture-apply(*state);
 osg::ref_ptrosg::Image image=new osg::Image();
 mTexture-getImage()-**readImageFromCurrentTexture(**
 render_info.getContextID(),**true, GL_UNSIGNED_BYTE); //works , doesn't
 work with GL_FLOAT
 double data = *image-getMipmapData(0);
 std::cout  luminance   data  std::endl;
 //osgDB::writeImageFile(***image,snap.bmp);
 }


 cheers
 Sebastian

 __**_
 osg-users mailing list
 osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.**org/listinfo.cgi/osg-users-**
 openscenegraph.orghttp://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


Re: [osg-users] Shadow size dont change when i change model size in vertex shader

2012-08-30 Thread David Callu
Hi Umid

nobody can help you if you don't explain more precisely your problem

Cheer
David

2012/8/30 Umid Shahmaliyev quza...@yahoo.com

 Hi,

 Hi all. I have some problem with shadow. I have 2 models in scene whith
 shadow. And when i change model size in vertex shader nothing happens with
 shadow. Are there any way to do this?

 ...

 Thank you!

 Cheers,
 Umid

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=49671#49671





 ___
 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


Re: [osg-users] OSG Arrays and custom allocators?

2012-08-15 Thread David Callu
Hi Paul,


2012/8/13 Paul Martz pma...@skew-matrix.com

 Hi all --

 There doesn't seem to be a way to use a custom allocator with an OSG Array
 type. Is that correct, or have I missed something?



 You're right



 I have a large store of array data, and want to create a new instance of
 an OSG Array that references that data store without invoking a data copy
 or per-element constructor. The typical way to do this in C++ is with a
 custom allocator, but as near as I can tell, OSG's Array types don't allow
 an allocator as a template parameter.

 If I can't use a custom allocator, does anyone have any ideas on how to
 create an OSG Array that references a pre-allocated data store?

 Any ideas would be appreciated, thanks.



.
OSG Array use an osg::MixinVectorT template that use a std::vector under
the hood.
I think to some solutions :

1) extend MixinVector template with a second parameter, the CustomAllocator
and pass it to the std::vector used in this template. Then extend
osg::TemplateArray in the same way.
change
typedef TemplateIndexArrayGLbyte,Array::ByteArrayType,1,GL_BYTE ByteArray;
in
template AllocT = defaultAlloc
class  ByteArray :
public  TemplateIndexArrayGLbyte,Array::ByteArrayType,1,GL_BYTE
{
...
};
Then adapt ArrayVisitor, ConstArrayVisitor and all dependency to accept a
template instead of a class

class ArrayVisitor
{
template AllocT = defaultAlloc
virtual void apply(ByteArrayAllocT) {}
...
};

Really big work, and there are some limitations (serialization for example).
(This could be more simple with C++11 new possibility)



2) Change osg::MixinVectorT in your custom OSG implementation then use
Allocator that you need
and create Vec3ArrayMyAlloc and other osg::Array with your allocator,
extend ArrayVisitor for your new
Arrays types, and so on for all Array's dependency that your code
require.



3) Change osg::MixinVectorT to don't use std::vector anymore (do the
vector stuff yourself)
and add in the public interface a function that allow user to change
Allocator of array element at runtime.
All element of the vector will be remove if you change the allocator to
avoid any memory corruption.


4) You probably already dig this solution but ...
If you can store your large store of array data in an std::vector,
then just do a std::swap between std::vector and osg::Array.


5) In the same way of 3) define a custom allocator that could change its
behaviours at runtime, but still use a std::vector.

templateclass ValueT
class MixinVector
{
typedef typename std::vectorValueT, MyAdaptableAllocator vector_type;
public:
...
};

Allocator could have a callback mechanism like
osg::Node/osg::NodeCallback.
You can do something like this in allocator to don't hurt performance
in default behaviours (with if/else optimization):

   void MyAllocator::function()
   {
   if (callback == NULL)
  do stuff
   else
  callback()
   }






Anyway there are no really good solution...

HTH
David





 --
   -Paul Martz  Skew Matrix Software
http://www.skew-matrix.com/
 __**_
 osg-users mailing list
 osg-users@lists.**openscenegraph.org osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.**org/listinfo.cgi/osg-users-**
 openscenegraph.orghttp://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


Re: [osg-users] Multiple MatrixTransforms, single geometry

2012-05-21 Thread David Callu
Hi Fred

Take a look to osg::Array::setVertexBufferObject to assign
VertexBufferObject to an array,
and to osg::Geometry::get(Vertex | Color | ... | Attrib)Array() to get
access to arrays

then

Take a look to osg::DrawElement::setElementBufferObject to assign
ElementBufferObject
and  osg::Geometry::getPrimitiveSet()-getDrawElement() to get access to
DrawElement.


I already have to do this kind of optimization, I have used a NodeVisitor
to traverse
the graph and assign VBO and EBO to geometries.

HTH
David

2012/5/21 Fred Smith osgfo...@tevs.eu

 Hi,

 I have some geometry that is making use of a VBO. The VBO contains an
 extremely large number of vertices. Similarly, I have an element buffer
 (EBO) that contains a large amount of indices. I need to render some
 objects that reference selected vertices of the VBO and selected indices
 of the EBO, sequentially, but under different model-view transformations.

 Basically, what I am trying to achieve with OSG is the following OpenGL
 code:


 Code:
 glBindBuffer(my_huge_vbo)
 glBindBuffer(my_huge_ebo)

 glLoadMatrix(...); // transformation 1
 glDrawElements(GL_TRIANGLES, 10, ,
 offset_to_EBO_indices_for_object1); // draw the first object under
 transformation 1
 glLoadMatrix(...); // transformation 2
 glDrawElements(GL_TRIANGLES, 50, ,
 offset_to_EBO_indices_for_object2); // draw the first object under
 transformation 2
 glLoadMatrix(...); // transformation 3
 glDrawElements(GL_TRIANGLES, 8, ,
 offset_to_EBO_indices_for_object3); // draw the first object under
 transformation 3
 and so on



 My problem is that if I have the following scene graph (see below), I will
 have many VBO/EBO buffer bindings, which is what I want to avoid.


 Code:
 - MatrixTransform
  - Geode
- Geometry
 - MatrixTransform
  - Geode
- Geometry
 - MatrixTransform
  - Geode
- Geometry



 Is there a way to manually assign a VBO and an EBO to a geometry? If this
 is the case I could share these across different osg::Geometry object
 instances.

 Regards
 Fred

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=47788#47788





 ___
 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


Re: [osg-users] Multiple MatrixTransforms, single geometry

2012-05-21 Thread David Callu
Hi Fred


 ledocc wrote:
  I already have to do this kind of optimization, I have used a
 NodeVisitor to traverse
  the graph and assign VBO and EBO to geometries.

 Sounds like you are reusing the same VBO/EBO for all geometries.


Yes I did


 Did you check that OSG is indeed not binding/unbinding the buffers every
 time?


As so many time in OSG, thing are well done.

VBO and EBO are not bind/unbind for each array or each geometry draw.
During draw, all OpenGL state change are minimized, so VBO is bind at the
beginning of the
frame when the first geometry need it, then unbind when a different VBO
need to be bind.
All OpenGL State are save in osg::State. Each osg::Geometry use the same
instance of
osg::State (give in parameter in osg::RenderInfo to
osg::Geometry::drawImplementation )
and ask to this instance to bind its VBO/EBO. osg::State did it when it
need.

take a look to
osg::Geometry::drawImplementation
osg::State::setVertexPointer
osg::State::bindVertexBufferObject

HTH
David


 Again thanks for your reply,
 Fred

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=47790#47790





 ___
 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


Re: [osg-users] Uniform arrays.

2012-05-08 Thread David Callu
Hi Eldar

Only the second way is good,
but create an uniform with 5 element and not 20.

in your for loop be sure sz == 5.

Otherwise all is good in the code you show us.

HTH
David

2012/5/8 Eldar Insafutdinov e.insafutdi...@gmail.com

 Hi

 I am trying to use uniform arrays with OSG, but it fails. Here are the
 snippets of code that  a'm using:


 Code:

 osg::StateSet *ss = node-getOrCreateStateSet();

 // one way of populating uniform array that I tried
 for(int i = 0; i  sz; ++i)
 {
char buf[30];
sprintf(buf, colourPoints[%d], i);
osg::Vec3 colour = osg::Vec3(1.0, 0.0, 1.0);
ss-addUniform(new osg::Uniform(buf, osg::Vec4(colour, 1.0)));
 }

 // another way
 osg::Uniform *colourPoints = new osg::Uniform(osg::Uniform::FLOAT_VEC4,
 colourPoints, 20);
 for(int i = 0; i  sz; ++i)
 {
osg::Vec3 colour = osg::Vec3(1.0, 0.0, 1.0);
colourPoints-setElement(i, osg::Vec4(colour, 1.0));
 }
 ss-addUniform(colourPoints);

 // and glsl
 uniform vec4 colourPoints[5];

 void main(void)
 {
vec4 col = colourPoints[1];
gl_FragColor = col;
 }




 I tried to set up uniforms both ways but neither of them worked and all I
 get is a black colour. It must be something obvious that I am missing..

 Cheers,
 Eldar

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=47598#47598





 ___
 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


Re: [osg-users] Uniform arrays.

2012-05-08 Thread David Callu
Hi Sergey

The [0] was require by some driver and not by other.
Specification was not clear about this.
Since 19 09 2011, OSG fix automatically this and we didn't need anymore to
care about []
take a look to osg:Program::linkProgram(...) in src/osg/Program : line747

cheers
David

2012/5/8 Sergey Polischuk pol...@yandex.ru

 Hi, Eldar

 Try to create your uniform with second way, but use
 osg::Uniform(osg::Uniform::FLOAT_VEC4, colourPoints[0], 20);// note [0]
 in uniform name
 some drivers need this syntax to work propertly with uniform arrays

 Cheers

 08.05.2012, 18:12, Eldar Insafutdinov e.insafutdi...@gmail.com:
  Hi
 
  I am trying to use uniform arrays with OSG, but it fails. Here are the
 snippets of code that  a'm using:
 
  Code:
 
  osg::StateSet *ss = node-getOrCreateStateSet();
 
  // one way of populating uniform array that I tried
  for(int i = 0; i  sz; ++i)
  {
  char buf[30];
  sprintf(buf, colourPoints[%d], i);
  osg::Vec3 colour = osg::Vec3(1.0, 0.0, 1.0);
  ss-addUniform(new osg::Uniform(buf, osg::Vec4(colour, 1.0)));
  }
 
  // another way
  osg::Uniform *colourPoints = new osg::Uniform(osg::Uniform::FLOAT_VEC4,
 colourPoints, 20);
  for(int i = 0; i  sz; ++i)
  {
  osg::Vec3 colour = osg::Vec3(1.0, 0.0, 1.0);
  colourPoints-setElement(i, osg::Vec4(colour, 1.0));
  }
  ss-addUniform(colourPoints);
 
  // and glsl
  uniform vec4 colourPoints[5];
 
  void main(void)
  {
  vec4 col = colourPoints[1];
  gl_FragColor = col;
  }
 
  I tried to set up uniforms both ways but neither of them worked and all
 I get is a black colour. It must be something obvious that I am missing..
 
  Cheers,
  Eldar
 
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=47598#47598
 
  ___
  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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Geometry not rendered on ATI using GL3 shaders

2012-04-06 Thread David Callu
Hi Roland

So there are an OpenGL error somewhere in the scene graph when OSG compile
GL object.
You can use gDEBugger to track down the gl call that generate an error.

BTW have you installed the latest ATI driver ?

David Callu

2012/4/6 Roland Hill roland.h...@fourwindstechnology.com.au

 Hi David,

 Thanks for your suggestion. I tried adding the line but it did not make
 any difference - still nothing rendered using osgsimplegl3 on the ATI
 machine.

 I have updated to the latest trunk and now get the following message:

 Warning: detected OpenGL error 'invalid enumerant' at After
 Renderer::compile
 OpenGL extension '' is not supported.
 Setting up osg::Camera::FRAME_BUFFER
 ShaderComposer::~ShaderComposer() 0x2abc930
 OpenGL extension '' is not supported.

 The OpenGL error looks to come from line 544 in Renderer.cpp, just after
 using osgUtil::GLObjectsVisitor, which I think sets up display lists.

 Does this help at all?

 Thank you!

 Cheers,
 Roland

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=46905#46905





 ___
 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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-05 Thread David Callu
Hi Ulrich,

Thanks for the fix,
Can you post it on osg-submission list ?

Best Regards
David Callu

2012/4/5 Martin Naylor martinnay...@virginmedia.com

 Hi all,
 Thanks Ulrich that both options supplied seemed to work ok, but the latter
 does seem more appropriate.
 I cant see the values from glGetActiveUniformsiv, so not even sure if it is
 returning any values, don't believe it is.
 There is a check earlier in the code for GL_UNSIGNED_INT_ATOMIC_COUNTER,
 but
 I have just checked and it gets skipped over when stepping through with
 debugger, which leaves atomiccountermap not set.
 If I understood correctly!

 Cheers

 Martin


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org
 [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Ulrich
 Hertlein
 Sent: 04 April 2012 23:43
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] problem with svn (atomic counter?)

 Hi guys,

 On 5/04/12 6:05 , Martin Naylor wrote:
  if (_extensions-isShaderAtomicCounterSupported())
  {
  std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
  std::vectorGLuint uniformIndex;
  for (AtomicCounterMap::iterator it = atomicCounterMap.begin(),
  end = atomicCounterMap.end();
   it != end; ++it)
  {
  uniformIndex.push_back(it-first);
  }

 Coming to think of it, I believe the whole block should check if
 atomicCounterMap is not empty.  It does not need to be called if
 GL_UNSIGNED_INT_ATOMIC_COUNTER is supported but not used.

 code
 if (_extensions-isShaderAtomicCounterSupported() 
 !atomicCounterMap.empty()) {
std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
std::vectorGLuint uniformIndex;
 /code

 Cheers,
 /ulrich
 ___
 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] glGetActiveUniformsiv error

2012-04-05 Thread David Callu
Hi Micheal,

Bug already found in previous post problem with svn (atomic counter?),
fix in submission. Just wait some hours or one day, I hope Robert will
push it quickly. Or use the fix in previous post.

code
if (_extensions-isShaderAtomicCounterSupported() 
!atomicCounterMap.empty())
{
   std::vectorGLint bufferIndex( atomicCounterMap.size(), 0 );
   std::vectorGLuint uniformIndex;
/code

Thanks
David Callu

2012/3/29 Michael A. Eriksen erik...@ai.sri.com

 With the latest update I get an error in

 void Program::PerContextProgram::linkProgram(osg::State state)

 There error is in

  _extensions-glGetActiveUniformsiv( _glProgramHandle, uniformIndex.size(),
(uniformIndex[0]),
 GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX,
(bufferIndex[0]) );

 The size of uniformIndex is 0!!

 Try and run osgsimplegl3!!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=46684#46684





 ___
 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


Re: [osg-users] Geometry not rendered on ATI using GL3 shaders

2012-04-05 Thread David Callu
Hi Roland,

Hi have an Nvidia so I can't test on my side:

can you add this line

program-addBindFragDataLocation(fragData, 0);

at the end of configureShaders function and try again.

HTH
David Callu

2012/3/28 Roland Hill roland.h...@fourwindstechnology.com.au

 Hi,

 I have been trying to convert my application to use version 1.50 compliant
 shaders and found that they work on my NVidia machine, but not on my ATI
 Mobility Radeon HD 5850 laptop. The shaders compile and link on the ATI,
 but  no geometry gets rendered. Both machines are running Ubuntu 11.10 64
 bit and the ATI drivers are the latest available. OSG version is 3.1.1
 (developer release) / trunk (I've been trying both).

 The same issue can be seen using the osgsimplegl3 example. If I execute
 ./osgsimplegl3 cow.osg the NVidia desktop machine shows the cow, while the
 ATI machine shows an empty window.

 osgsimplegl3 was executed after export OSG_NOTIFY_LEVEL=INFO and the 2
 logs are attached.

 I would like to use version 1.40+ shaders to make potential porting to ES2
 devices easier in the future. In any case, osgsimplegl3 example should work
 on ATI cards.

 I am quite new to shader coding and this has me thoroughly confused. Any
 help would be much appreciated.

 Thank you!

 Cheers,
 Roland

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=46641#46641




 Attachments:
 http://forum.openscenegraph.org//files/osg_nv_log_123.txt
 http://forum.openscenegraph.org//files/osg_ati_log_274.txt


 ___
 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


Re: [osg-users] problem with svn (atomic counter?)

2012-04-02 Thread David Callu
Hi Martin

I use VS 2010, Windows 7 64 bit, Nvidia 460M, Driver 296.10, osg 3.1.2
build in 32 bit
and osggeometryshader work fine.

As I am a little bit paranoiac with the crappy VS developpement tools :

Have you restart Windows and/or VS after NVidia driver update ?
Have you rebuild OSG since your last SVN update or just do a 'build' ?
Are you sure to use good osg dll ?

HTH
David Callu

2012/4/2 Martin Naylor martinnay...@virginmedia.com

 Hello all,
 I have been just doing some testing of OSG (latest from the SVN).
 Whilst executing osggeomertyshaders I am getting a crash:

 CALL STACK:

msvcp90d.dll!std::_Debug_message(const wchar_t *
 message=0x07fee9bb9b68, const wchar_t * file=0x07fee9bb9bb0,
 unsigned int line=779)  Line 24 C++
osg92-osgd.dll!std::vectorint,std::allocatorint
 ::operator[](unsigned __int64 _Pos=0)  Line 780C++
 
 osg92-osgd.dll!osg::Program::PerContextProgram::linkProgram(osg::State 
 state={...})  Line 784 + 0xf bytes  C++
osg92-osgd.dll!osg::Program::compileGLObjects(osg::State 
 state={...})  Line 233  C++
osg92-osgd.dll!osg::StateSet::compileGLObjects(osg::State 
 state={...})  Line 1335 C++
osg92-osgUtild.dll!osgUtil::GLObjectsVisitor::apply(osg::StateSet 
 stateset={...})  Line 114   C++


 LOCALS:

 +   end (3452816845,Bad Ptr)
 std::_Treestd::_Tmap_traitsunsigned
 int,std::basic_stringchar,std::char_traitschar,std::allocatorchar
 ,std::lessunsigned int,std::allocatorstd::pairunsigned int const
 ,std::basic_stringchar,std::char_traitschar,std::allocatorchar  
 ,0
 ::iterator
 +   it  (3452816845,Bad Ptr)
 std::_Treestd::_Tmap_traitsunsigned
 int,std::basic_stringchar,std::char_traitschar,std::allocatorchar
 ,std::lessunsigned int,std::allocatorstd::pairunsigned int const
 ,std::basic_stringchar,std::char_traitschar,std::allocatorchar  
 ,0
 ::iterator
bufferIndex [0]()   std::vectorint,std::allocatorint
 
bufferIndexToUniformIndices [14757395258967641292]()
 std::mapint,std::vectorint,std::allocatorint
 ,std::lessint,std::allocatorstd::pairint const
 ,std::vectorint,std::allocatorint
activeAtomicCounterBuffers  3435973836unsigned
 int
uniformIndex[0]()   std::vectorunsigned
 int,std::allocatorunsigned int 
 +   this0x02838be0 {_program=0x027f8540
 _extensions={...} _glProgramHandle=4 ...}
 osg::Program::PerContextProgram * const

 Sorry for the garbage! I am using Windows VS 2008 as my compliler :)
 Unfortunately I have updated my Nvidia drivers to the latest a few days ago
 so I am unsure if it's a driver or the later openGL4.2 stuff that has been
 introduced in OSG just recently having review the logs of program.cpp ?

 Regards

 Martin Naylor



 ___
 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


Re: [osg-users] Strange problem: Only PrimiitiveSet of first Vertices displayed

2012-03-15 Thread David Callu
Hi Nicolas

Your 3 last plan have vertices order for a QUAD and not for TRIANGLE_STRIP,
except this, i see you 6 planes in my example (attached) based on your code.


HTH
David


2012/3/15 Nico DeLarge nicolas.dingel...@googlemail.com

 Hi folks,

 I have a strange problem: I want to draw a cube out of 6 PrimitiveSets
 containing Triangle Strips. Unfortunately, only the one PrimitiveSet out of
 the first 4 vertices is displayed.

 It does not matter, if I set a different starting index than 0 in the
 DrawArrays (seems to be ignored), only the first 4 vertices are used.

 If I switch the order of the push_back instruction e.g. for the back and
 the top plane (so that the top plane vertices are at the beginning of the
 array), then only the top plane will be displayed.

 If I set the start index in the first DrawArrays e.g. to 4 and comment out
 all other PrimitiveSets, still the back plane is displayed, not the top
 plane as expected.

 Does anyone know what is wrong with my code? Or any other suggestions?



 Code:

 double f64HalfCarLength = 2.0;
 double f64HalfCarWidth = 1.0;
 double f64CarHeight = 1.5;

 m_pCarModelBoxGeode = new osg::Geode();
 m_pCarModelTrafo-addChild(m_pCarModelBoxGeode);

 m_pCarModelBoxDrawable = new osg::Geometry();
 m_pCarModelBoxGeode-addDrawable(m_pCarModelBoxDrawable);
 m_pCarModelBoxDrawable-setUseDisplayList(true);

 //Set Vertices
 m_pCarModelBoxVertices = new osg::Vec3Array();
 m_pCarModelBoxVertices-reserve(24);
 m_pCarModelBoxDrawable-setVertexArray(m_pCarModelBoxVertices);

 //Back plane of the car

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,-f64HalfCarWidth,0.0));

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,-f64HalfCarWidth,f64CarHeight));

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,f64HalfCarWidth,0.0));

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,f64HalfCarWidth,f64CarHeight));



 //Top plane of the car

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,-f64HalfCarWidth,f64CarHeight));

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,-f64HalfCarWidth,f64CarHeight));

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,f64HalfCarWidth,f64CarHeight));

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,f64HalfCarWidth,f64CarHeight));



 //Front plane of the car

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,f64HalfCarWidth,f64CarHeight));

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,-f64HalfCarWidth,f64CarHeight));

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,f64HalfCarWidth,0.0));

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,-f64HalfCarWidth,0.0));


 //Right plane of the car

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,-f64HalfCarWidth,f64CarHeight));

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,-f64HalfCarWidth,f64CarHeight));

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,-f64HalfCarWidth,0.0));

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,-f64HalfCarWidth,0.0));


 //Bottom plane of the car

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,+f64HalfCarWidth,0.0));

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,-f64HalfCarWidth,0.0));

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,-f64HalfCarWidth,0.0));

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,+f64HalfCarWidth,0.0));


 //Left plane of the car

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,f64HalfCarWidth,f64CarHeight));

 m_pCarModelBoxVertices-push_back(osg::Vec3(f64HalfCarLength,f64HalfCarWidth,0.0));

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,f64HalfCarWidth,0.0));

 m_pCarModelBoxVertices-push_back(osg::Vec3(-f64HalfCarLength,f64HalfCarWidth,f64CarHeight));

 m_pCarModelBoxDrawable-addPrimitiveSet(new
 osg::DrawArrays(osg::PrimitiveSet::TRIANGLE_STRIP,0,4));
 m_pCarModelBoxDrawable-addPrimitiveSet(new
 osg::DrawArrays(osg::PrimitiveSet::TRIANGLE_STRIP,4,4));
 m_pCarModelBoxDrawable-addPrimitiveSet(new
 osg::DrawArrays(osg::PrimitiveSet::TRIANGLE_STRIP,8,4));
 m_pCarModelBoxDrawable-addPrimitiveSet(new
 osg::DrawArrays(osg::PrimitiveSet::TRIANGLE_STRIP,12,4));
 m_pCarModelBoxDrawable-addPrimitiveSet(new
 osg::DrawArrays(osg::PrimitiveSet::TRIANGLE_STRIP,16,4));
 m_pCarModelBoxDrawable-addPrimitiveSet(new
 osg::DrawArrays(osg::PrimitiveSet::TRIANGLE_STRIP,20,4));


 //Set plane normals
 m_pCarModelBoxNormals = new osg::Vec3Array();
 m_pCarModelBoxNormals-reserve(6);
 m_pCarModelBoxDrawable-setNormalArray(m_pCarModelBoxNormals);

 m_pCarModelBoxDrawable-setNormalBinding(osg::Geometry::BIND_PER_PRIMITIVE_SET);

 m_pCarModelBoxNormals-push_back(osg::Vec3(-1.0,0.0,0.0)); //back
 m_pCarModelBoxNormals-push_back(osg::Vec3(0.0,0.0,1.0)); //top
 m_pCarModelBoxNormals-push_back(osg::Vec3(1.0,0.0,0.0)); //front
 m_pCarModelBoxNormals-push_back(osg::Vec3(0.0,-1.0,0.0)); 

Re: [osg-users] Looking for a guide on renderbins

2011-11-29 Thread David Callu
Hi Sean

A nice tutorial about
StateSethttp://www.bricoworks.com/articles/stateset/stateset.htmland
StateGraph http://www.bricoworks.com/articles/stategraph/stategraph.html have
a part on renderleaf and renderbin
thank to Tim Moore for this

HTH
David Callu

2011/11/18 Sean Sullivan sullivan0s...@gmail.com

 Hey guys,

 Does anybody know about some sort of guide for how the renderbins work?
 I'm having to use them quite a bit lately but am having trouble finding in
 depth coverage of the subject.

 Cheers,
 Sean

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=43945#43945





 ___
 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


Re: [osg-users] Problem with shadows after use sketchupToOSG

2011-09-29 Thread David Callu
Hi Renato,

By default, many shadow technique use the Texture Unit 1.
And as I can see, your model use this one too.

You can check your model or change the texture unit use by the shadow.
If I'm right, this will fix the probleme

HTH
David Callu

2011/9/28 Renato Silveira silveira@gmail.com

 Hi,
 I exported a model with sketchupToOSG and loaded it in an osg application.
 When I enable shadows (the default osgShadows techniques) the textures of
 the loaded models becomes wrong. If I disable shadows, everything works.
 Anybody ever had this problem?

 That's what I got:
 http://imageshack.us/photo/my-images/849/shadowafterexport.png/

 That's what it should be:
 http://imageshack.us/photo/my-images/59/shouldbed.png/



 --
 *Renato Silveira
 *
  Ph. D. Student
  Informatics Institute - UFRGS
  Porto Alegre - RS - Brazil
  http://www.inf.ufrgs.br/~rsilveira


 ___
 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


Re: [osg-users] TextureArray

2011-09-26 Thread David Callu
Hi Paul,

I can't find example that use TextureArray in osg example.
but I can answer to your question.

2011/9/26 Paul Palumbo paul1...@yahoo.com

 Where can I find an example on how to use a TextureArray with OSG?

 I'm trying to setup a uniform to send this TextureArray to my fragment
 shader and I'm confused on how to do this. Usually, you'd send a texture to
 the shader by setting the texture uniform to the texture number so I thought
 I would need to do this for a TextureArray:
   geometry-getOrCreateStateSet()-setTextureAttribute(BASE_TEX_ID,
 textureArray, osg::StateAttribute::ON);

that is good


   sset-addUniform(
new osg::Uniform(osg::Uniform::SAMPLER_2D_ARRAY, textureArray,
 BASE_TEX_ID));

The third argument is the size of the uniform variable.
1 for value (float, int, vector, textureIndex, ...)
1 for an array of value (float[], int[], textureIndex[], ...)

the size of the TextureArray is the depth component of Texture2DArray.
you can specify it by Texture2DArray::setDepthTexture(...), or by adding an
image
Texture2DArray::setImage(unsigned int layer, osg::Image * image);


HTH
David Callu


However, when I assign BASE_TEX_ID to 0, I'm getting:
 Uniform numElements  1 is invalid

 from this call:
 Uniform::Uniform( Type type, const std::string name, int numElements ) :

 This seems to imply that the third argument to the Uniform constructor
 isn't the texture number but the TextureArray size (?).   Then how do you
 set this TextureArray to a particular texture number?

 I'm confused...  Is there an example out there that shows how to use a
 TextureArray?

 Paul P.

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=43014#43014





 ___
 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


Re: [osg-users] TextureArray

2011-09-26 Thread David Callu
2011/9/26 Paul Palumbo paul1...@yahoo.com

 Let me phrase my question better...

 How do I associate a Texture2DArray defined in my stateset with a
 particular Uniform so that it can be accessible in the shader? For regular
 textures, this would be done using the Texture Unit number.


this is the same thing for Texture2DArray, you define the Texture Unit
number in the StateSet
and in the uniform:

int textureUnit = 0;
osg::StateSet * ss = node-getOrCreateStateSet();
ss-setTextureAttributeAndMode( textureUnit, textureObject );

osg::Uniform * uniform = new osg::Uniform(osg::Uniform::SAMPLER_2D_ARRAY,
textureArray, 1);
uniform-set( textureUnit );
or
uniform-set( (int) 0 );  // don't forget to cast in int, some compiler
define 0 as an unsigned int

ss-addUniform(uniform);



Also, is it valid to have a Texture2DArray defined as having a texture
 format of GL_LUMINANCE_ALPHA32F_ARB?

 I've defined my texture array like this:

 Code:
 osg::Texture2DArray *textureArray = new osg::Texture2DArray();
 textureArray-setTextureSize(0, 0, depth);


textureSize = 0, 0, depth,
you have depth texture, with each have a size of 0 by 0, strange.
the size must be the size of texture read in the loop 'for (int i = 0;
idepth; i++) ...'



 textureArray-setInternalFormatMode(osg::Texture2DArray::USE_IMAGE_DATA_FORMAT);

 textureArray-setFilter(osg::Texture2D::MIN_FILTER,osg::Texture2D::LINEAR_MIPMAP_LINEAR);
 textureArray-setFilter(osg::Texture2D::MAG_FILTER,osg::Texture2D::LINEAR);
 textureArray-setUseHardwareMipMapGeneration(true);

 for (int i = 0; idepth; i++)
 {
   char filenameStr[1040];
   snprintf(filenameStr, 1040, /%06d.tiff, i);
   std::string filename = directory + filenameStr;
   osg::ref_ptrosg::Image image = osgDB::readImageFile(filename);
   image-setInternalTextureFormat(GL_LUMINANCE_ALPHA32F_ARB);
   textureArray-setImage(i, image.get());
 }
 geode-addDrawable(polyGeom);
 polyGeom-getOrCreateStateSet()-setTextureAttribute(TEX_ARRAY_ID,
 textureArray, osg::StateAttribute::ON);
 osg::ref_ptrosg::Uniform TextureArrayUniform =
  new osg::Uniform(osg::Uniform::SAMPLER_2D_ARRAY, textureArray,
 TEX_ARRAY_ID);


here, there are an error, this is not TEX_ARRAY_ID but just 1, see note
before.



 geode-getOrCreateStateSet()-addUniform(TextureArrayUniform.get());


 This is too complicate to give you a valid answer, depend to your hardware
and need to look OpenGL specification.
 You can use the free tool gDEBugger http://www.gremedy.com/ to debug your
opengl call.
 You can specify to gDEBugger to break on openGL error.
 and you immediatly know what opengl function call do an error.

HTH
David Callu


 And I'm getting this OpenGL error when compiling my TextureArray:

  Warning: detected OpenGL error 'invalid enumerant' at
 StateSet::compileGLObejcts() compiling texture attribute.


 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=43018#43018





 ___
 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


Re: [osg-users] Colour map

2011-08-31 Thread David Callu
Hi Clement,

Take a look to example/osgtexture1D in OpenSceneGraph source.

Color are defined with 4 float value clamp between 0.0f and 1.0f.
then image are create with GL_RGBA for the pixel format and GL_FLOAT for
value type.
you can change the value type to
   GL_BYTE
   GL_UNSIGNED_BYTE
   GL_SHORT
   GL_UNSIGNED_SHORT
   GL_INT
   GL_UNSIGNED_INT
   GL_UNSIGNED_SHORT_4_4_4_4
   GL_UNSIGNED_INT_8_8_8_8
...
So osg support 32 bit color/ 64 bit color / 128 bit color

Remember the main Rules   What your OpenGL implementation can does, OSG can
does.
OSG is a fine layer upon OpenGL, it simplify and automatise OpenGL
initialization/manipulation.

So to know pixel format and type supported by your hardware,
take a look to OpenGL specification (and optionaly OpenGL Extension) on
opengl.org http://www.opengl.org/documentation/specs/

HTH
David Callu


2011/8/31 clement@csiro.au

 Hi Robert,

  Does osg support 32 bit color and have up to 65536 colours?

  I used TransferFunction1D because I will use the generated index to find
 out the colour later.  Would you give me an example how to simply create
 osg::image and assign to texture1d?  Thanks.


 Regards,
 Clement

 
 From: osg-users-boun...@lists.openscenegraph.org [
 osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield [
 robert.osfi...@gmail.com]
 Sent: Wednesday, 31 August 2011 5:45 PM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Colour map

 Hi Clement,

 TransferFunction1D is really meant for making it easy to handle sparse
 data when setting up a 1D Texture for use as a colour look up on the
 GPU.

 For data where you are just encoding the colours directly in packed
 form then it would be more appropriate to simply create a osg::Image
 and assign this a Texture1D to use a colour look up table.

 Robert.

 On Wed, Aug 31, 2011 at 8:19 AM,  clement@csiro.au wrote:
  Anyone knows how many colour does osg support?  I would like to generate
 65536 colour map by using the code below.  The size of the object colorMap
 is 65535.  Is it possible?  I am sure osg can support 8 bit colour, how
 about 32bit?  Thanks.
 
 osg::TransferFunction1D::ColorMap colorMap;
 
 double fcr = 255.0;
 int ri, gi, bi, ai, cc;
 int step = 16;
 int rgb_step = fcr /(step-1);
 int a_step = (fcr +1) / step;
 
 cc = 0;
 colorMap[0] = osg::Vec4(0.0f, 0.0f, 0.0f, 0.0f);
 for (int r=0; rstep; r++) {
 ri = r*rgb_step;
 for (int g=0; gstep; g++) {
 gi = g*rgb_step;
 for (int b=0; bstep; b++) {
 bi = b*rgb_step;
 for (int a=1; a=step; a++) {
 ai = min(a*a_step, fcr );
 cc++;
 colorMap[cc] = osg::Vec4(ri/fcr,
 gi/fcr, bi/fcr, ai/fcr);
 }
 }
 }
 }
 tf-assign(colorMap);
 
 
  Regards,
  Clement
  ___
  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 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


Re: [osg-users] Autoshadow aliasing in shadow maps

2011-08-26 Thread David Callu
Hi Justo,


Take a look to the Variante Shadow Map
algorithmhttp://developer.nvidia.com/node/165 to
apply shadow on the scene.
Instead of use default OpenGL ShadowMap comparaison technique, this
algorithm
provide a different way to capture and apply shadow.
This technique take more resource but with a better result.

HTH
David Callu



2011/8/25 Robert Osfield robert.osfi...@gmail.com

 Hi Justo,

 Surfaces that are parallel to the light source will be subject to
 numerical aliasing issues that will mean that either the fragment is
 inside or outside that shadow map.  You can't avoid these aliasing
 issues completely but if the vertex and fragment shaders are set up
 correctly then the parallel surfaces should in theory have the same
 ambient lighting regardless of being in the shadow or not so you
 shouldn't see the aliasing artifact.

 I have just developed a new shadow technique that you'll find checked
 into svn/trunk, look for the ViewDependentShadowMap, use the --vdsm
 option in osgshadow example.  All going well this will replace the
 collection of other shadow techniques.  I would recommend testing
 against this new technique.

 Robert.

 On Thu, Aug 25, 2011 at 7:12 PM, Justo Ureña chil...@hotmail.com wrote:
  Hi,
 
  I´m testing diferent shadows techniques for my scene, and after some
 adjusts, I got them working fine... Except for very big aliasing that
 appears in some surfaces that are parallel to the light direction. It
 happens in all the shadow maps techniques (ShadowMap, StandardShadowMap,
 LISPSM)... and I´ve tried all the things that I could imagine to get rid of
 them without success... Please, anyone can help me with that?
 
  From my investigation I got that the problem is that the depth map
 calculated by the shadow camera does not fit exactly with the curved shape
 in the scene. In the attachment you can see a render of the scene (that only
 includes the cessna and a vertical directional light that produces the
 shadow) coloured with the depth map. As you can see, in the laterals of the
 cessna appear these withe stiches that means that the depth calculated in
 these texels of the map is infinite, what is obviously wrong. There is any
 way to avoid this annoying effect?
 
  Thank you very much!
 
  Cheers,
  Justo
 
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=42241#42241
 
 
 
 
  ___
  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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] osg website down

2011-07-13 Thread David Callu
Hi all, Hi José

http://www.openscenegraph.org/projects/osg/wikihttp://www.openscenegraph.org/projects/osg/wiki/Downloads

return this :


Traceback (most recent call last):
  File /usr/lib/python2.5/site-packages/trac/web/api.py, line 339,
in send_error
'text/html')
  File /usr/lib/python2.5/site-packages/trac/web/chrome.py, line
684, in render_template
data = self.populate_data(req, data)
  File /usr/lib/python2.5/site-packages/trac/web/chrome.py, line
592, in populate_data
d['chrome'].update(req.chrome)
  File /usr/lib/python2.5/site-packages/trac/web/api.py, line 168,
in __getattr__
value = self.callbacks[name](self)
  File /usr/lib/python2.5/site-packages/trac/web/chrome.py, line
460, in prepare_request
for category, name, text in contributor.get_navigation_items(req):
  File /usr/lib/python2.5/site-packages/trac/versioncontrol/web_ui/browser.py,
line 295, in get_navigation_items
if 'BROWSER_VIEW' in req.perm:
  File /usr/lib/python2.5/site-packages/trac/perm.py, line 523, in
has_permission
return self._has_permission(action, resource)
  File /usr/lib/python2.5/site-packages/trac/perm.py, line 537, in
_has_permission
check_permission(action, perm.username, resource, perm)
  File /usr/lib/python2.5/site-packages/trac/perm.py, line 424, in
check_permission
perm)
  File /usr/lib/python2.5/site-packages/trac/perm.py, line 282, in
check_permission
get_user_permissions(username)
  File /usr/lib/python2.5/site-packages/trac/perm.py, line 357, in
get_user_permissions
for perm in self.store.get_user_permissions(username):
  File /usr/lib/python2.5/site-packages/trac/perm.py, line 175, in
get_user_permissions
cursor.execute(SELECT username,action FROM permission)
  File /usr/lib/python2.5/site-packages/trac/db/util.py, line 51, in execute
return self.cursor.execute(sql)
  File /usr/lib/python2.5/site-packages/trac/db/sqlite_backend.py,
line 58, in execute
args or [])
  File /usr/lib/python2.5/site-packages/trac/db/sqlite_backend.py,
line 50, in _rollback_on_error
return function(self, *args, **kwargs)
OperationalError: database is locked



Can you fix this when you have the time.

Cheers
David Callu
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPPU] osgPPU and the stencil buffer

2011-06-10 Thread David Callu
Hi Miguel

Your code seem good.
I am not familiar with MLAA and its optimization.

Have you try gDEBugger, it allow you to see the StencilBuffer at anytime.

You're right, use of osg::ClearNode between osgPPU::Unit is probably not a
good idea

If you could provide an simple example, I could play and search on my side.

Cheers
David Callu


2011/6/6 Miguel Angel Exposito rad...@gmail.com

 Thanks David!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=40121#40121





 ___
 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


Re: [osg-users] DrawElementsUInt no Element of osg

2011-06-06 Thread David Callu
Hi Diana,

osg::DrawElementsUInt is defined in 'OSG/include/osg/PrimitiveSet'
but 'OSG/include/osg/Geometry' already include it. And you have include
'OSG/include/osg/Geometry' so this not look like to be an include error.

And this is not an link error : c2039 is a definition/include error.


HTH
David Callu

2011/6/6 Diana Kittelmann diana.kittelm...@gmx.de

 Hi,

 I'm trying to add a simple Point to my scene based on the BasicGeometry
 tutorial. I get the following error:

 error c2039: 'DrawElementsUInt' is not an element of 'osg'

 Do I have to include sth special for this method or do i have to link sth?

 I use osg 2.8.3 with vc8 and I'm linking osgd.lib, osgUtild.lib,
 osgViewerd.lib, osgGAd.lib, osgDBd.lib, osgTextd.lib an I include

 osg/Node
 osg/Group
 osg/Geode
 osg/Geometry
 osg/Texture2D
 osgDB/ReadFile
 osgViewer/Viewer
 osg/PositionAttitudeTransform
 osgGA/TrackballManipulator

 Thank you!

 Cheers,
 Diana[/url]

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=40109#40109





 ___
 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


Re: [osg-users] [osgPPU] osgPPU and the stencil buffer

2011-06-05 Thread David Callu
Hi Miguel,

I'm too busy this week end to take a look on this problem.
Next week after Wednesday, my planning will be free and
you are the first on my todo list.

Cheers
David Callu

2011/6/3 Miguel Angel Exposito rad...@gmail.com

 Come on, guys!!, a little help here :D

 Sorry for bumping this but I couldn't figure out this yet :(

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=40065#40065





 ___
 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


Re: [osg-users] [osgPPU] osgPPU and the stencil buffer

2011-05-29 Thread David Callu
Hi Miguel,



2011/5/28 Miguel Angel Exposito rad...@gmail.com

 Hi,

 I'm pretty new to osgPPU and I'm working on a port of Jimenez's MLAA full
 scene antialiasing algorithm.

 It's a 3-pass post processing effect and I got it working on osgPPU.

 - The first step detects the edges of the RTT'd scene and makes an 'edge
 texture'.
 - The second step uses the previous texture and a precomputed one to
 calculate the area which pixels belonging to an edge would cover from an
 ideal trapeze.
 - The final step blends each pixel in its 4-neighborhood according to the
 weights calculated in the previous step.

 I got it fully working in osgPPU, however, an important optimization can be
 done by using the stencil buffer. The idea behind this is:

 - Initially the stencil is cleared out to 0

 - The first step of the post effect (edges detection) creates a stencil
 mask writing 1's to the stencil wherever there's an edge pixel. The pixels
 not belonging to an edge are discarded in the shader, so no writting to the
 stencil will occur in that case.

 - In the subsequent steps the stencil test discards every pixel not covered
 by the mask, hence only the edge pixels are processed (weights calculation
 and final blend).

 And this is how I tried to achieve it:

 - I created two osg::Stencils, one for creating the mask and other for
 using the mask and discarding everything else.
 - I attached the stencils to their corresponding osgPPU::Unit's.

 (now, I need to clear the stencil at the beginning of the postFX chain, but
 not between each pass)
 - I'm not sure about where glClear (with the clear mask of the camera the
 osgPPU::Processor is using) is called, but my guess is when rendering the
 scene to texture, not between units so I think that setting the clearMask in
 the camera is pointless.
 - I tried to call glClear(GL_STENCIL_BUFFER_BIT) in a notify callback set
 in the first unit of my chain.


 This has been driving me nuts for a couple of days now. It seems that the
 stencil buffer is not being written, or cleared prematurely between passes.
 And the stencil test only seems to be done if I enable it in the last unit's
 stateset.

 What am I missing?



- Have you create an opengl context with a stencil buffer ?
- Have you try to use osg:ClearNode to clear the stencil buffer ?
- Have you check opengl call order in a debugger like gDEBugger ?

no more ideas ... for now.





 I can post the code if you want!

 yes please, could be more simple to find the bug.

Cheers
David Callu

...


 Thank a lot in advance!

 Cheers,
 Miguel

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=39894#39894





 ___
 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


Re: [osg-users] texture to shader parameter?

2011-05-04 Thread David Callu
Hi Nan

Can you provide link of tutorial you are talking about ?

Cheer
David Callu


2011/5/4 Nan WANG nan.c...@gmail.com

 Hello everyone:

 i have a question regarding how to pass texture to shader

 There were some code in the tutorial, such as:


 Code:

  bumpMapProgramObject-addShader( bumpFragmentObject );
   bumpMapProgramObject-addShader( bumpVertexObject );

   osg::Uniform* lightPosU =
  new osg::Uniform(LightPosition,osg::Vec3(0,0,1));
   osg::Uniform* normalMapU = new osg::Uniform(normalMap,1);
   osg::Uniform* baseTextureU = new osg::Uniform(baseTexture,0);

   bumpMapState-addUniform(lightPosU);
   bumpMapState-addUniform(normalMapU);
   bumpMapState-addUniform(baseTextureU);
   lightPosU-setUpdateCallback(new updateBumpShader() );

   bumpMapState-setAttributeAndModes
  (bumpMapProgramObject, osg::StateAttribute::ON);

   osg::Texture2D* tankBodyNormalMap = new osg::Texture2D;
   tankBodyNormalMap-setDataVariance(osg::Object::DYNAMIC);
   osg::Image* tankBody = osgDB::readImageFile(TankBump.png);
   if (!tankBody)
   {
  std::cout   couldn't find texture, quiting.  std::endl;
  return -1;
   }

   tankBodyNormalMap-setImage(tankBody);
   bumpMapState-setTextureAttributeAndModes
  (1,tankBodyNormalMap,osg::StateAttribute::ON);




 Here, the example creates
  osg::Uniform* normalMapU = new osg::Uniform(normalMap,1);

 '1'is the initial value of normalMap? how to link to texture unit in
 shader?

 using (Am I right?)

   bumpMapState-setTextureAttributeAndModes
 (1,tankBodyNormalMap,osg::StateAttribute::ON);


 here the value of first parameter should be the same as initial value in
 the 'new osg::Uniform(normalMap,1);'

 and the way to have the 'tankBodyNormalMap' in bumpmap.vert, using
 gl_MultiTexCoord0 or gl_MultiTexCoord1?

 where we can find  bumpmap.vert?

 Thank you!

 Cheers,
 Nan

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=38982#38982





 ___
 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


Re: [osg-users] texture to shader parameter?

2011-05-04 Thread David Callu
Hi Nan,

I can't found the bumpmap.vert file on internet.

But you can access to tankBodyNormalMap in shader this way:

in the Vertex/Fragment Shader, declare
uniform sampler2D normalMap;


then use it like this:
vec4 normalFromTexture = texture(normalMap, texCoord1);


HTH
David Callu





2011/5/4 Nan WANG nan.c...@gmail.com


 http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/ShadersUpdating

 Thank you!

 Cheers,
 Nan

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=38986#38986





 ___
 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


Re: [osg-users] texture to shader parameter?

2011-05-04 Thread David Callu
I use texCoord1 as an example.


in fact you have to use:

in the vertex shader:
gl_TexCoord[1] =  gl_MultiTexCoord1;
or define your own output variable
out vec2 texCoord1;
texCoord1 = gl_MultiTexCoord1;



in the vertex/fragment shader:
vec4 normalFromTexture = texture(normalMap, gl_TexCoord[1]);
or define your own input variable
   in vec2 texCoord1;
   vec4 normalFromTexture = texture(normalMap, texCoord1);


HTH
David Callu

2011/5/4 Nan WANG nan.c...@gmail.com

 could you explain why here you used texCoord1?

 because of we setting '1' here?
sset-setTextureAttributeAndModes(1,tex2D,osg::StateAttribute::ON);
sset-addUniform(new osg::Uniform(tex,1));

 i dont think so ...





 Thank you!

 Cheers,
 Nan

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=38990#38990





 ___
 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


Re: [osg-users] texture to shader parameter?

2011-05-04 Thread David Callu
To complete my answere:

2011/5/4 Nan WANG nan.c...@gmail.com

  could you explain why here you used texCoord1?


  because of we setting '1' here?

 here, you push tex2D in the texture unit 1

 sset-setTextureAttributeAndModes(1,tex2D,osg::StateAttribute::ON);

 here you set uniform tex to 1

 sset-addUniform(new osg::Uniform(tex,1));

 i dont think so ...

 But you can use any texCoord you want. Generally the texCoord 1 for
consistency.

HTH
David Callu





 Thank you!

 Cheers,
 Nan

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=38990#38990





 ___
 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


Re: [osg-users] Multiple lights in a scene

2011-04-19 Thread David Callu
Hi Chris, Hi Jean-Sébastien


I just ending a similar work for a client and i could provide some advice on
the subject.
First, I derived from osg::LightSource to osgLighting::LightSource (that
could contain many light, not only one as osg::LightSource) and add a
cullCallback to do a similar job of
osgUtil::CullVisitor::accept(osg::LightSource).
I create a osgLighting::LightGroup (not a node) which contain light
parameter (ambient, diffuse, position, direction ...)
in uniforms arrays, and be shared by all lights
I derived from osg::Light to osgLighting::Light that contain an
osgLighting::LightGroup to store parameter in it.

Shader is handle by a shader generator so I can't help you on this point.
But I conclude after some test that per pixel lighting is not a choice.
If you want apply shadow per light, you have to combine each light/shadow
pair
in the pixel shader. you can't compute light in vertex shader, then pass
result of each light
in pixel shader, and apply shadow on each light result. if you have 40
lights in you scene.
you have to pass 40 vec3 from vertex shader to pixel shader ouch!!!
according to Real-Time Rendering 3ed,
Shader Model 4 have 16 interpolation registre between Vertex and
Geometry/Pixel Shader and
32 between Geometry and Pixel Shader.


J-S:
About deferred shading, this is my first reflex to not pay the Z complexity
of the scene.
But OpenGL allow only 8 texture target to render in, so 8*4=32 values.
We can use 3 for eye position, 3 for normal. This let's us with 26 value to
pass light direction/position.
That is largely under the need to handle more that 8 lights.
I read an article about Unreal Engine that push the 3 nearest lights in RTT,
and all others lights are combined in one, so only 4 light is pass to RTT,
then computed in deferred shader.
I have to dig this way ...

Still according to Real Time Rendering 3ed, if you don't write the
gl_FragDepth in your shader, recent hardware
discard automatically the pixel computation if pixel in frame buffer is
front of the incoming pixel.
You can use OSG_DEFAULT_BIN_SORT_MODE=SORT_FRONT_TO_BACK to help hardware to
do the job.


I am in negotiation with my client to put osgLighting and osgGLSL (the
shader generator) in OpenSource.
But this will not happen before summer I think. Many people to convince that
OpenSource is the good way for every body.


HTH
David Callu

2011/4/19 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com

 Hi Chris,

 First of all, I have to commend you on all the work you've put into doing
 this. You obviously put a lot of thought and research into your problem, and
 explored multiple avenues before posting, which I have to admire!

 I've personally never needed more than the 8 light sources the fixed
 pipeline gave me, so I've always used the built-in gl_LightSource[i]
 structure and osg::LightSource+osg::Light to manage my lights. I have a
 mechanism in place that lets me reuse light IDs when lights get turned on or
 off (a light turned off frees its light ID, and a light turned on will take
 the first available light ID), and this uses IDs 0-7, which has been
 sufficient for me. Add to that the fact that OSG's built-in shadow
 techniques support casting shadows from only one light, and I've never
 really had a need (personally or from client requirements) to go further.
 But that's not to say it won't happen.

 What I'd say in response to your question is, I think you have a good idea
 of what is the best solution to your problem (solution 1), but it requires
 some small changes to OSG itself in order to be feasible. So what prevents
 you from proposing these changes? Robert hasn't been against making some
 methods virtual when needed in the past, and even deeper changes will be
 possible when they're justified.

 About the CullVisitor, I don't understand what you mean about not
 recognizing new classes. First of all, sure, you could add new classes to
 its interface, but even if not, you can always, in the
 accept(osg::LightSource) method, check with a dynamic_cast if the
 lightSource is of your derived class:

 virtual void accept(osg::LightSource ls)
 {
  if (dynamic_castmyOwnLightSource*(ls) != 0)
  {
// My light source subclass.
  }
  else
  {
// Plain old osg::LightSource
  }
 }

 But whatever you decide, I think you shouldn't rule out changes to the core
 OSG. The fixed pipeline is out, and shaders are in, and if OSG could be made
 to support its own osg_LightSource[i] uniforms, with indices limited only by
 shader memory (while not ruling out the possibility that the first 8 of
 those be mapped to the fixed pipeline light sources if the fixed pipeline is
 available) then that would be very nice indeed.

 I'll just add one last note, another way to deal with many light sources
 would be to do deferred shading, maybe you should look this up. It all
 depends on what you're doing, but deferred shading has the advantage that
 all complex lighting calculations (per pixel lighting, normal mapping, etc

Re: [osg-users] osgjs

2011-03-29 Thread David Callu
Hi Cedric,

Really funny app.
Good Idea, Good Job.

See you
David


2011/3/29 Cedric Pinson cedric.pin...@plopbyte.com

 Hi,
 I wanted to share improvement done on osgjs the last few months. It has
 been used for a firefox demo you can watch
 https://demos.mozilla.org/en-US/#globetweeter or
 http://plopbyte.com:2048/globetweeter/ if the previous server is
 overloaded.

 If you are interested by the project look on the http://osgjs.org blog


 Cedric

 --
 Provide OpenGL, WebGL and OpenSceneGraph services
 +33 659 598 614 Cedric Pinson mailto:cedric.pin...@plopbyte.com
 http://plopbyte.com

 ___
 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


Re: [osg-users] TexGen Python Scripting

2011-03-03 Thread David Callu
Hi Adam,

Seem that you don't use the good forum/mailing list.
This one is the OpenSceneGraph User Mailing List

TexGen forum is here http://texgen.sourceforge.net/phpBB2/index.php

HTH
David Callu


2011/2/22 Adam Healey ah...@ex.ac.uk

 Hello,

 This was the first forum that came up after I googled my query that was not
 linked to the recently broken TexGen support website.

 I've been using TexGen for the past couple of weeks to generate fabric
 weaves that I then intend to impact test using ABAQUS. I am relatively
 inexperienced with programming and scripting, so I ask for your patience.

 I've had some trouble recently creating a 'non-crimp fabric;' TexGen does
 not accept the Python script I've written for it, citing an 'Invalid Syntax'
 when 'for Yarn in Yarns' is used.

 The curious thing is that the same instruction was used in creation of a
 tri-axial braid fabric which was accepted, albeit a bit messily.

 Can anyone suggest a solution to my problem? The scripts I've written for
 both the non-crimp fabric and the tri-axial braid are available on request.
 I'd really appreciate any help anyone can give me.

 Cheers,

 Adam

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=36991#36991





 ___
 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


Re: [osg-users] Render To Texture is very slow

2011-02-02 Thread David Callu
Hi Martin


What is your Hardware/Software configuration?
Which osg::Camera::RenderTargetImplementation did you use in your code ?

Try the osgprerendercubemap example to test performance of your hardware.

HTH
David Callu


2011/2/2 Martin Großer grosser.mar...@gmx.de

 Hello,

 I would like use render to texture in every render step. My texture
 resolution is 2048 x 2048 and it is very slow. There are tipps and tricks to
 speed up the render to texture?
 With 2048 x 2048 I get around 15 FPS and with 1024 x 1024 I get 45 FPS.

 Thanks

 Martin
 --
 Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
 Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
 ___
 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


Re: [osg-users] Need Help ! How to get Camera Position inside shaders

2011-01-13 Thread David Callu
Hi Lait,

If you want the camera position in world coordinate, you have to pass it
yourself.
OSG, like OpenGL only work in Eye Coordinate inside the shader.

HTH
David Callu


2011/1/13 Laith Dhawahir laithbasildot...@gmail.com

 Heey Guys,
 I hope you will fine,
 anyway, i have question about how i can get the camera position inside
 shader from open scene graph do i must pass it, or open scene graph already
 do that.

 Thank you!

 Cheers,
 Laith

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=35600#35600





 ___
 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


Re: [osg-users] how to do shadows in large scenes?

2011-01-03 Thread David Callu
I Peter,


PSSM is probably the best choice for large scene.
PSSM technique have been fixed in osg 2.9.9 or 2.9.10 for minor bug.
If you didn't see shadow in your scene with this technique, this probably
a bug in your code.
Take a look to osgshadow example to know how use it. You have to run
osgshadow --pssm to see pssm in action.

HTH
David Callu



2011/1/3 Peter Amstutz peter.amst...@tseboston.com

 Hello all,

 I am trying to determine the right approach to apply shadows to a large
 scene.  My test scene is 2k x 2k, but I need to support larger terrains
 as well.  The scene consists of static geometry (ordinary osg::Geodes)
 and animated dynamic entities.  I have a single directional light as the
 sun.  I'm using osg 2.8.3 with a Radeon 3400 on Windows 7 64 bit.

 I've attached some screenshots.  First is a view with no shadows for
 reference.

 I tried osgShadow::ShadowMap as that seems to be most recommended.  This
 works but unfortunately the resolution of the depth map is far too low
 relative to the terrain size, resulting in numerous artifacts (see
 attachment).  Increasing the shadow map resolution don't help, as a
 2048x2048 shadow map is still much too small (attached).

 After doing some research, it seems that cascaded shadow maps are a
 possible solution to the resolution problem, so I tried
 osgShadow::ParallelSplitShadowMap.  This doesn't work at all, as seen in
 the attached image.

 I've also been looking at doing an offline radiosity render and baking
 the results into shadow maps, but that creates its own set of challenges
 and doesn't deal with shadows from dynamic entities.

 I'm not sure where to go from here.  Are there other shadow techniques
 that I should try?  Does PSSM work any better in osg 2.9?  Should I look
 at fixing writing my own cascaded shadow map implementation and/or try
 to fix PSSM?  Or do something else entirely?

 By the way, the wiki page discussing shadows seems to have last been
 updated for osg 2.4, which adds to the confusion:

 http://www.openscenegraph.org/projects/osg/wiki/Support/ProgrammingGuide/osgShadow

 Advice will be very appreciated.  Thanks!

 --
 Peter Amstutz
 Senior Software Engineer
 Technology Solutions Experts
 Natick, MA
 02131


 ___
 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


Re: [osg-users] draw a partial torus and a half sphere

2011-01-03 Thread David Callu
Hi Lucie,

You can fill an osg::Geometry by computing yourself the vertices position.
take a look to osggeometry to know how to use and fill osg::Geometry.

You can also use an osg::Shape combined with osg::ShapeDrawable
to draw a half sphere. Take a look to osgshape to know how to use osg::Shape
and osg::ShapeDrawable.
And take a look to osg::DrawShapeVisitor::drawHalfSphere(...) which do what
you want.

Don't forget that osg::Shape is not an optimized way to draw a geometry.
osg::Geometry is a better solution by need more work from you.

HTH
David Callu


2011/1/3 lucie lemonnier lucielemonn...@hotmail.fr

 Hi,

 I want to draw a partial torus, I know the center, the starting angle, the
 angle of arrival, the minimum radius and maximum radius.
 I want to draw also a half sphere!
 Can you help me?

 Thank you!

 Cheers,
 lucie

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=35268#35268





 ___
 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


Re: [osg-users] runtime error

2011-01-03 Thread David Callu
I Michael,

This seem that you run 64bit osgversion executable and use 32bit libosg.so
library, or vice versa.
You have to choose one version to install on your computer, or put the
directory containing the
right version of osg library in first place of your PATH environment
variable

ex : if you use the 32bit version of osg, do
# export PATH=/usr/local/lib:$PATH
# /usr/local/bin/osgversion

HTH
David Callu



2011/1/3 Michael Hall hal...@att.net

 Ok.  I installed OSG using apt-get and it installed 2.8.1 on both my 32 and
 64 bit machines.  Both ran the osgversion command.  However, I removed the
 package from the 32 bit machine and tried to compile the latest.  The
 compile goes fine no errors, the make install works great.  However, when I
 try osgversion, I still get the following:

 osgversion: symbol lookup error: /usr/local/lib/libosg.so.70: undefined
 symbol: _ZN11OpenThreads5MutexC1ENS0_9MutexTypeE

 How do I run the ldd with osgversion to see what it needed?  I have tried
 and I cannot figure out how to use it.  I do have the libosg.s0.70 on my
 machine.  Is any one else seeing this.  Could be that I am missing something
 needed to run.  Any help with ldd will be appreciated.

 Michael


 ___
 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


Re: [osg-users] multipass blurring and frame buffer object

2010-11-24 Thread David Callu
Hi sajjad,

Take a look to osgPPU http://projects.tevs.eu/osgppu done by Art Tevs.
This is a nodeKit to do want you want.
Some example show you how to use it.
To blur the just the half of the scene, you can use the windows coordinate
available in
fragment shader.

HTH
David Calu

2010/11/24 Sajjad dosto.wa...@gmail.com

 Hello forum,

 I already have scene that i want to render to  an FBO-attached texture and
 run that texture through  a fragment shader that applies a image
 processing(blurring) to  the half of the scene. Then with  a particular key
 press event the processed image(half of the scene) will go through several
 passes of blurring operation.


 At last the two color outputs  - one half  - the original scene and the
 other half  - the blurred part with one/several passes of blurring
 operation, from the fragment shader are mapped to an FBO with two color
 attachments. The two textures with two different framebuffer effects are ten
 tiled a final pass to the window after unbinding the fbo.


 Which examples demonstrate the scenario that i am trying get?


 Thanks
 Sajjad

 ___
 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


Re: [osg-users] multipass blurring and frame buffer object

2010-11-24 Thread David Callu
 in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/osgPPU
 linked by target osgdb_ppu in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/osgPlugins/osgPPU
 OSGUTIL_LIBRARY_RELEASE
 linked by target osgppu_hdr in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/hdr
 linked by target osgppu_viewer in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/viewer
 linked by target osgppu_dof in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/dof
 linked by target osgppu_cubemap in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/cubemap
 linked by target osgppu_texture3D in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/texture3D
 linked by target osgppu_video in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/video
 linked by target osgppu_ssao in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/ssao
 linked by target osgppu_glow in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/glow
 linked by target osgPPU in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/osgPPU
 linked by target osgdb_ppu in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/osgPlugins/osgPPU
 OSGVIEWER_LIBRARY_RELEASE
 linked by target osgppu_hdr in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/hdr
 linked by target osgppu_viewer in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/viewer
 linked by target osgppu_dof in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/dof
 linked by target osgppu_cubemap in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/cubemap
 linked by target osgppu_texture3D in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/texture3D
 linked by target osgppu_video in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/video
 linked by target osgppu_ssao in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/ssao
 linked by target osgppu_glow in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/glow
 OSG_LIBRARY_RELEASE
 linked by target osgppu_hdr in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/hdr
 linked by target osgppu_viewer in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/viewer
 linked by target osgppu_dof in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/dof
 linked by target osgppu_cubemap in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/cubemap
 linked by target osgppu_texture3D in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/texture3D
 linked by target osgppu_video in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/video
 linked by target osgppu_ssao in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/ssao
 linked by target osgppu_glow in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/example/glow
 linked by target osgPPU in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/osgPPU
 linked by target osgdb_ppu in directory
 /home/sajjad/Downloads/osgPPU/osgPPU-0.4.0/src/osgPlugins/osgPPU

 -- Configuring incomplete, errors occurred!


 **


 Sorry for this lengthy paste. I know that this forum is not meant for
 osgPPU.


 Could have been better if you know some examples within the osg main
 repository.


 Going thruough the osgstereomatch example and i am not sure if this example
 provide the hints i am looking for.



 Regards
 Sajjad


 On Thu, Nov 25, 2010 at 12:01 AM, David Callu led...@gmail.com wrote:

 Hi sajjad,

 Take a look to osgPPU http://projects.tevs.eu/osgppu done by Art Tevs.
 This is a nodeKit to do want you want.
 Some example show you how to use it.
 To blur the just the half of the scene, you can use the windows coordinate
 available in
 fragment shader.

 HTH
 David Calu

 2010/11/24 Sajjad dosto.wa...@gmail.com

  Hello forum,

 I already have scene that i want to render to  an FBO-attached texture
 and run that texture through  a fragment shader that applies a image
 processing(blurring) to  the half of the scene. Then with  a particular key
 press event the processed image(half of the scene) will go through several
 passes of blurring operation.


 At last the two color outputs  - one half  - the original scene and the
 other half  - the blurred part with one/several passes of blurring
 operation, from the fragment shader are mapped to an FBO with two color
 attachments. The two textures with two different framebuffer effects are ten
 tiled a final pass to the window after unbinding the fbo.


 Which examples demonstrate the scenario that i am trying get?


 Thanks
 Sajjad

 ___
 osg-users mailing list
 osg-users

Re: [osg-users] OSG greensceen

2010-10-19 Thread David Callu
Hi Aruna

Can you explain what is green screen ?

David

2010/10/19 Aruna Madusanka osgfo...@tevs.eu

 Hi,

 Can we make a green screen with openscenegraph

 Thank you!

 Cheers,
 Aruna

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=32847#32847





 ___
 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


Re: [osg-users] Lighting shader problem

2010-10-08 Thread David Callu
Hi Aitor

In your code lightPosition = (x=0, y=40, z=0, w=0.3), so you use a
directional light (w != 1.0).
so you need in your shader a  directional light computation. (see Orange
book or here http://www.lighthouse3d.com/opengl/glsl/index.php?ogldir1 for
more explanation)

Or you want a point light and you can keep your shader but lightPosition.w
must be equal to 1.0.


HTH
David Callu


2010/10/5 Aitor Ardanza aitoralt...@terra.es:

 Trajce (Nick) Nikolov wrote:
 maybe better to put something in while we can compile and test and see if
can help - including the model-Nick


 Ok, here you have...

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=32382#32382




 ___
 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


Re: [osg-users] Lighting shader problem

2010-10-04 Thread David Callu
Hi Aitor,


Is you normal of your model well defined and normalized ?

I suppose you used an osg::Light to define your light.
Have you put it in a osg::LightSource ?

Could you provide an example to reproduce your issue
This will become hard to solved it without more information.

David Callu

2010/10/4 Aitor Ardanza aitoralt...@terra.es:

 Trajce (Nick) Nikolov wrote:
 the viewer by default is attaching a light. Setup your viewer with NO_LIGHT 
 (or something like that, look in the code), and then create and control your 
 own light-Nick


 Neither solves ...
 Could I use the standard osg lighting if I use a vertex program to change the 
 position of the vertices?
yes, you can.


 If I coment
 Code:
 //gl_FrontColor =  diffuse + globalAmbient + ambient + specular;

  the result is this...
 [Image: http://img210.imageshack.us/img210/4333/30581070.jpg ]

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=32359#32359





 ___
 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


Re: [osg-users] Lighting shader problem

2010-10-01 Thread David Callu
Hi Aitor

try this:


Your code do the job in eye coordinate so eyePosition  = vec3(0,0,0)
and you don't need eyePosition uniform;

bug fix:
- ViewDirection  = normalize(eyePosition - fvObjectPosition.xyz);
+ ViewDirection  = normalize( - fvObjectPosition.xyz);


HTH
David Callu

2010/10/1 Aitor Ardanza aitoralt...@terra.es:
 Thanks for the correction, but the result is the same ...

 Aitor

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=32254#32254





 ___
 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


Re: [osg-users] nofity in two files from two differents applications

2010-07-07 Thread David Callu
Hi Vincent

osg::nofify is a simple log system with only one logger. So you can't expect
have many logger or one logger per thread.



To do this, you need a strongest log library like
log4cpphttp://log4cpp.sourceforge.net/,
or the
incoming Boost.Log http://sourceforge.net/projects/boost-log/.

HTH
David Callu

2010/7/6 Vincent Bourdier vincent.bourd...@gmail.com

 Hi all,

 I'm using the osg::notify logs, but in two applications(threads) in the
 same process.
 Each application uses the notify logs of osg that are redirected into a log
 file, but when one application run and the second is started, it redirect
 each logs into a new common file...
 I would like to keep each log into a separate file, but keeping the
 osg::notify usage.

 Do you have any idea or suggestion ?

 Thanks

 Regards,
   Vincent.
 ___
 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


Re: [osg-users] crash with setTextureAttributeAndModes

2009-10-27 Thread David Callu
Hi Otto


We don't have enough information to solve you problem.
Have you try to debug you application ?
Have you an available callstack to found where you application crash ?
Have you a simple program test which isolate the problem ?
but more simply, is your datasetList array store texture pointer in
osg::ref_ptr ?

Nobody can help you with this too little description.
This probably a misusing of osg code more than a bug in OSG.

HTH
David Callu



2009/10/27 Otto Cologne schur...@gmx.de

 Hi,

 I'm having a crash with setTextureAttributeAndModes I don't know how to
 fix.

 To explain the issue. I have a list of data sets which hold a pointer to a
 osg::Texture3D. The texture mixing is done in a shader and my texture update
 function containing the following loop is called from an update  callback.
 Since the order of the textures can/must change i loop over the textures and
 do this


 Code:

 osg::StateSet* sliceState = m_sliceNode-getOrCreateStateSet();
 for ( size_t i = 0; i  datasetList.size(); ++i)
 {
  osg::Texture3D* texture3D = datasetList[i] )-getTexture3D();
  sliceState-setTextureAttributeAndModes( i, texture3D,
 osg::StateAttribute::ON );
 }




 This works just find when adding one texture after another. However when
 the order changes, thus overwriting a different order it crashes. So
 apparently I'm doing it wrong.

 Any help would be greatly appreciated.
 ...

 Thank you!

 Cheers,
 Otto

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=18753#18753





 ___
 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


Re: [osg-users] Cleaning out Community/JobOffers -- osg

2009-10-26 Thread David Callu
Hi Roland


BTW, I see my job request is still on JobRequests wiki
pagehttp://www.openscenegraph.org/projects/osg/wiki/Community/JobRequests

I create an account on the trac and login to remove it,
but I haven't WIKI_MODIFY permission (don't know why).

Can you remove my job request please ?
Or fix my permission if you can ?
Or anyone can help me ?


David Callu


2009/10/26 Chris 'Xenon' Hanson xe...@alphapixel.com

 Roland Smeenk wrote:
  Done.
  I added the some of the rules for the jobs page in the past. Typically
 companies don't take the effort to remove jobs when filled so I don't take
 the effort to contact them and remove the jobs when they are old enough. If
 it's not OK they can always restore the data from the page history.

   Thanks Roland!

  Roland

 --
 Chris 'Xenon' Hanson, omo sanza lettere  Xenon
 AlphaPixel.com
 PixelSense Landsat processing now available!
 http://www.alphapixel.com/demos/
 There is no Truth. There is only Perception. To Perceive is to Exist. -
 Xen
 ___
 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


Re: [osg-users] Cleaning out Community/JobOffers -- osg

2009-10-26 Thread David Callu
ok

Thanks Roland

David

2009/10/26 Roland Smeenk roland.sme...@tno.nl

 Please, contact Jose Luis Hidalgo to let him update your Wiki permissions.

 --
 Roland

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=18701#18701





 ___
 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


Re: [osg-users] [Beginner question]Keyboard event handling tutorial.

2009-05-06 Thread David Callu
Hi Lev


2009/5/5 Lev earlnucl...@gmail.com

 Hi,

 I have using been keyboard handling code from basic keyboard handling (
http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/BasicKeyboardInput)
tutorial.




 As I understand to implement further functionality, I need to modify
TankInputDeviceStateType class.

TankInputDeviceStateType is just an shared object between
MyKeyboardEventHandler and UpdateTankPosCallback
to simplify communication between this 2 object. To add further
functionality:
You have to modify MyKeyboardEventHandler to handle the event you want add (
for moveFwdRequest, 'w' key is handle),
You have to modify TankInputDeviceStateType to store the event you want add
( for moveFwdRequest, moveFwdRequest property is used),
You have to modify UpdateTankPosCallback to apply the event you want add (
for moveFwdRequest, tank is moved),


 However I cannot seem to find a way to add more members to the class. i.e.
trying to add moveBckRequest.

Did you mean something like this :

   class tankInputDeviceStateType
   {
   public:
   tankInputDeviceStateType::tankInputDeviceStateType() :
moveFwdRequest(false), moveBckRequest(false) {}

   bool moveFwdRequest;
   bool moveBckRequest;
   };

If it is, you simply need to study C++.

HTH
David Callu






 Anyone knows how to do this?

 Thanks. [Embarassed]

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=11407#11407





 ___
 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


Re: [osg-users] Force updating

2009-05-06 Thread David Callu
Hi Miriam

Sorry but ... What is the question ?
Can you more explain you issue.

David Callu

2009/5/6 Miriam D'Elia miriamde...@gmail.com

 Hi to all!
 I would need to change the height (at runtime) to the forms (osg::Capsule)
 that make up my scene.
 I make the interpolation with osg::AnimationPath to move the shapes.

 The structure of each shape is as follows:

 PositionAttitudeTransform
 |
   MatrixTransform
 |
Geode
 |
   Capsule

 Thanks !


 ___
 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


Re: [osg-users] Picking, how to identify object?

2009-04-27 Thread David Callu
hi Paul

You have an UserData property in osg::Object and so in osg::Node by
inheritance.
You can assign any osg::Referenced based class to it.

Another solution could be to use std::mapID, osg::ref_ptrosg::Node 
or boost::bimapID, osg::ref_ptrosg::Node 

HTH
David

2009/4/27 Paul gaffe...@gmail.com

 Hi,

 Im using the code from osgpick example. How do I identify the object being
 picked as refering to it by name has little use.

 Can I assign some user data to the objects such as an id? or extra
 information

 Thank you.

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=10892#10892





 ___
 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


Re: [osg-users] [build] make : Build error on FFmpegDecoder.cpp while compiling OSG-dev

2009-04-20 Thread David Callu
Hi all

same issue for me,

# uname -a
Linux mrburns 2.6.27.21-170.2.56.fc10.i686.PAE #1 SMP Mon Mar 23 23:24:26
EDT 2009 i686 i686 i386 GNU/Linux
# gcc --version
gcc (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7)


Update ffmpeg from 0.49 to 0.5 solve the problem.

HTH
David

2009/4/20 Robert Osfield robert.osfi...@gmail.com

 Hi David,

 Did the changes that the compiler and J-S suggested work?

 Robert.


 On Mon, Apr 20, 2009 at 2:03 PM, david bruyer davidbru...@gmail.comwrote:

 hi robert,

 I'm compiling OSG-dev on a Mandriva 2009.0


 Code:
 [da...@mandrake ~]$ uname -a
 Linux Mandrake 2.6.22.19-desktop-2mdv #1 SMP Mon May 5 20:55:05 EDT 2008
 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz GNU/Linux
 [da...@mandrake ~]$



 And i'm using the 0.4.9 version of ffmpeg
 =


 Code:
 [da...@mandrake ~]$ rpm -qa | grep ffmpeg
 libffmpeg-devel-0.4.9-3.pre1.14161.1.1plf2009.0
 libffmpeg51-0.4.9-3.pre1.14161.1.1plf2009.0
 ffmpeg-0.4.9-3.pre1.14161.1.1plf2009.0
 [da...@mandrake ~]$



 Thanks for your interest
 David

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=10430#10430





 ___
 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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Bug in RenderBin (?)

2009-03-23 Thread David Callu
Hi Christof, Hi Robert


Christof talk about the thread Bug in RenerBin (?) in date of 13 march
2009 - 
herehttp://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/41482
for the last message
herehttp://article.gmane.org/gmane.comp.graphics.openscenegraph.user/41604

Robert, Your code seem to work fine.

Cheer
David

2009/3/23 Christof Krüger o...@christof-krueger.de


  I'm afraid your new email has started a new thread... so one will have to
 do manual searches to know exactly what you might be on about... could you
 give us some more clues I did merge some changes to the destruction of
 RenderBin's, is this the code?
 


 Sorry abut this, I'm using the forum and have no clue what went wrong.
 What I meant was the code posted by ledocc (David Callu) on Marth, 13th
 in the Bug in RenderBin (?) thread. He asked me to test the code and it
 worked fine.

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=9008#9008





 ___
 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


Re: [osg-users] Bug in RenderBin (?)

2009-03-13 Thread David Callu
Hi Christof


Robert prefer search the RenderBin instance that you want to remove instead
of search the name of a render bin.
like this :

void RenderBin::removeRenderBinPrototype(RenderBin* proto)
{
   RenderBinPrototypeList* list = renderBinPrototypeList();
   if (list  proto)
   {
for(RenderBinPrototypeList::iterator itr = list-begin();
   itr != list-end();
   ++itr)
   {
   if (itr-second.get() == proto)
   {
   list-erase(itr);
   return;
   }
   }
   }
}

Can you test this solution ?

David

2009/3/13 Christof Krüger osgfo...@tevs.eu

 Changing the removeRenderBinPrototype to use the binName instead of the
 classname fixes the crash. For this, you need to also add a member string
 variable to the Proxy object in order to remember the binName.

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=8445#8445





 ___
 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] OSG trunk crash when use osgdb_osgparticle plugin

2009-03-13 Thread David Callu
Hi all

osgviewer crash when i try to load any data which require osgdb_osgparticle,
in release and debug mode
- osgviewer cessnafire.osg
- osgviewer spaceship.osg
- osgviewer fountain.osg
- osgviewer osgcool.osg
- osgviewer SmoxeBox.osg
- osgblendequation (it use cessnafire.osg)

Crash occure when osgdb_osgparticle is loaded and used.
If i do
# osgviewer my_osg_path/osgdb_osgparticle.so cow.osg
all work fine.

I use the last OSG SVN version
Linux Fedora 10
GCC 4.3.2
glibc 2.9

backtrace :

*** glibc detected *** osgviewer: corrupted double-linked list: 0x09d89930
***
=== Backtrace: =
/lib/libc.so.6[0xa84e1f]
/lib/libc.so.6[0xa8692d]
/lib/libc.so.6(__libc_calloc+0xef)[0xa8848f]
/lib/libc.so.6[0xa43ae1]
/lib/libc.so.6(__cxa_atexit+0x20)[0xa43bc0]
/home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/osgPlugins-2.9.1/osgdb_osgparticle.so[0x7c03db]
/home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/osgPlugins-2.9.1/osgdb_osgparticle.so[0x7c8dfd]
/home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/osgPlugins-2.9.1/osgdb_osgparticle.so(_init+0x2c)[0x7af940]
/lib/ld-linux.so.2[0x4521ed]
/lib/ld-linux.so.2[0x4568d2]
/lib/ld-linux.so.2[0x451db6]
/lib/ld-linux.so.2[0x455f5e]
/lib/libdl.so.2[0x43897c]
/lib/ld-linux.so.2[0x451db6]
/lib/libdl.so.2[0x43805c]
/lib/libdl.so.2(dlopen+0x4f)[0x4389ff]
/home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/libosgDB.so.56(_ZN5osgDB14DynamicLibrary16getLibraryHandleERKSs+0xef)[0x8ce1af]
/home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/libosgDB.so.56(_ZN5osgDB14DynamicLibrary11loadLibraryERKSs+0x52)[0x8ceed2]
/home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/libosgDB.so.56(_ZN5osgDB8Registry11loadLibraryERKSs+0x8f)[0x8f6b3f]
...
...
...



This bug seem to be really tricky so if anyone could test this commande line
# osgviewer cessnafire.osg
and report the result and the OSG version / platform, this could be a nice
help for track this bug.

Or if anyone have a solution, i am be happy to know it ;-)


David
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG trunk crash when use osgdb_osgparticle plugin

2009-03-13 Thread David Callu
Hi J-S

Thanks for report
I will try some old SVN version and test again.

Cheer
David

2009/3/13 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com

 Hi David,

  This bug seem to be really tricky so if anyone could test this commande
 line
 # osgviewer cessnafire.osg
 and report the result and the OSG version / platform, this could be a nice
 help for track this bug.


 Using OSG SVN (as of midnight Eastern time), Windows Vista 32-bit,
 cessnafire.osg runs ok.

 I wonder if Robert's fix for the possible divide by zero has something to
 do with this? I don't know when that was checked in, but perhaps my OSG was
 compiled before it went in. Then again, perhaps it has nothing to do with
 your crash.

 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

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG trunk crash when use osgdb_osgparticle plugin

2009-03-13 Thread David Callu
Hi Robert




2009/3/13 Robert Osfield robert.osfi...@gmail.com

 Hi David,

 Just tried various .osg files with particles systems and they all work
 fine with svn/trunk + 2.9.1.  My guess is that you have an out of sync
 set of libs/plugins, try a clean build and make sure that you don't
 have older but the same so version number libs hanging around.


I do a complet rebuild and the problem is always there.
I try some old version of OSG, and the problem is different but still there
... g

This seem to be a glibc/std-c++/gcc/other-thing issue.
So I search ..

Thanks for your report.
We can close this thread

David



 Robert.

 On Fri, Mar 13, 2009 at 2:22 PM, David Callu led...@gmail.com wrote:
  Hi all
 
  osgviewer crash when i try to load any data which require
 osgdb_osgparticle,
  in release and debug mode
  - osgviewer cessnafire.osg
  - osgviewer spaceship.osg
  - osgviewer fountain.osg
  - osgviewer osgcool.osg
  - osgviewer SmoxeBox.osg
  - osgblendequation (it use cessnafire.osg)
 
  Crash occure when osgdb_osgparticle is loaded and used.
  If i do
  # osgviewer my_osg_path/osgdb_osgparticle.so cow.osg
  all work fine.
 
  I use the last OSG SVN version
  Linux Fedora 10
  GCC 4.3.2
  glibc 2.9
 
  backtrace :
 
  *** glibc detected *** osgviewer: corrupted double-linked list:
 0x09d89930
  ***
  === Backtrace: =
  /lib/libc.so.6[0xa84e1f]
  /lib/libc.so.6[0xa8692d]
  /lib/libc.so.6(__libc_calloc+0xef)[0xa8848f]
  /lib/libc.so.6[0xa43ae1]
  /lib/libc.so.6(__cxa_atexit+0x20)[0xa43bc0]
 
 /home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/osgPlugins-2.9.1/osgdb_osgparticle.so[0x7c03db]
 
 /home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/osgPlugins-2.9.1/osgdb_osgparticle.so[0x7c8dfd]
 
 /home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/osgPlugins-2.9.1/osgdb_osgparticle.so(_init+0x2c)[0x7af940]
  /lib/ld-linux.so.2[0x4521ed]
  /lib/ld-linux.so.2[0x4568d2]
  /lib/ld-linux.so.2[0x451db6]
  /lib/ld-linux.so.2[0x455f5e]
  /lib/libdl.so.2[0x43897c]
  /lib/ld-linux.so.2[0x451db6]
  /lib/libdl.so.2[0x43805c]
  /lib/libdl.so.2(dlopen+0x4f)[0x4389ff]
 
 /home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/libosgDB.so.56(_ZN5osgDB14DynamicLibrary16getLibraryHandleERKSs+0xef)[0x8ce1af]
 
 /home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/libosgDB.so.56(_ZN5osgDB14DynamicLibrary11loadLibraryERKSs+0x52)[0x8ceed2]
 
 /home/ledocc/graphisme/osg/SVN/OpenSceneGraph/release/lib/libosgDB.so.56(_ZN5osgDB8Registry11loadLibraryERKSs+0x8f)[0x8f6b3f]
  ...
  ...
  ...
 
 
 
  This bug seem to be really tricky so if anyone could test this commande
 line
  # osgviewer cessnafire.osg
  and report the result and the OSG version / platform, this could be a
 nice
  help for track this bug.
 
  Or if anyone have a solution, i am be happy to know it ;-)
 
 
  David
 
 
  ___
  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 mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Bug in RenderBin (?)

2009-03-12 Thread David Callu
Hi Paul, Hi Christof


What is smells fishy is the use of proto-className() to identify the
renderBin prototype to remove in removeRenderBinPrototype();

code

void RenderBin::removeRenderBinPrototype(RenderBin* proto)
{
RenderBinPrototypeList* list = renderBinPrototypeList();
if (list  proto)
{
// something wrong there
RenderBinPrototypeList::iterator itr =
list-find(proto-className());
if (itr != list-end()) list-erase(itr);
}
}

/code

proto-className() return always RenderBin because this is the name of the
class :).

Instead, in void RenderBin::removeRenderBinPrototype(RenderBin* proto) we
need something like this


code

void RenderBin::removeRenderBinPrototype(const std::string  binName,
RenderBin* proto)
{
RenderBinPrototypeList* list = renderBinPrototypeList();
if (list  proto)
{
RenderBinPrototypeList::iterator itr = list-find(binName);
if (itr != list-end()) list-erase(itr);
}
}

/code


Thought ?


David Callu

2009/3/12 Paul Melis p...@science.uva.nl

 Christof Krüger wrote:

 I'm using the current 2.8.0 stable release. I used the 'Browse Source' to
 check the current trunk version of RenderBin.cpp and I see no change since.

 The actual crash occurs later in static object destruction when
 s_renderBinPrototypeList is destructed itself. I don't understand enough of
 osg to know what's exactly wrong. However, the s_registerDepthSortedBinProxy
 doesn't release the object it created and this looks very suspicious to me.


 The fact that two different instances of RenderBin get registered under the
 same name indeed smells fishy :)

 Paul

 ___
 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


Re: [osg-users] Bug in RenderBin (?)

2009-03-12 Thread David Callu
Hi Robert


What about the case of register two prototype with the same name. There are
any warning message for the user.
I fix this like that


void RenderBin::addRenderBinPrototype(const std::string binName, RenderBin*
proto)
{
RenderBinPrototypeList* list = renderBinPrototypeList();
if (list  proto)
{
RenderBinPrototypeList::iterator itr = list-find(binName);
if (itr != list-end())
osg::notify(osg::WARN)  Warning: RenderBinPrototype named
\ binName \ already registered  std::endl;
else
(*list)[binName] = proto;
}
}

void RenderBin::removeRenderBinPrototype(const std::string  binName,
RenderBin* proto)
{
RenderBinPrototypeList* list = renderBinPrototypeList();
if (list  proto)
{
RenderBinPrototypeList::iterator itr = list-find(binName);
if (itr != list-end())
{
if (itr-second != proto)
osg::notify(osg::WARN)  Warning: Registered
RenderBinPrototype named \  binName  \ not match the instance  
proto  std::endl;
else
list-erase(itr);
}
}
}


thought ?

David

2009/3/12 Robert Osfield robert.osfi...@gmail.com

 HI David  Christof et. al,

 On Thu, Mar 12, 2009 at 10:13 AM, David Callu led...@gmail.com wrote:
  What is smells fishy is the use of proto-className() to identify the
  renderBin prototype to remove in removeRenderBinPrototype();

 Well spotted David, the addRenderBinPrototype() correctly uses
 binName, while the removeRenderBinProtoype() attempts to use the
 className() as it's binName.  The later is definitely a bug, and one
 that is easy to fix...


  Instead, in void RenderBin::removeRenderBinPrototype(RenderBin* proto)
 we
  need something like this
 
  code
 
  void RenderBin::removeRenderBinPrototype(const std::string  binName,
  RenderBin* proto)
  {
  RenderBinPrototypeList* list = renderBinPrototypeList();
  if (list  proto)
  {
  RenderBinPrototypeList::iterator itr = list-find(binName);
  if (itr != list-end()) list-erase(itr);
  }
  }
 
  /code
 
  Thought ?

 There is no need to use the binName, one just needs to search for the
 pointer in the map by hand, and remove it.

 I'm just tested the following code and it looks to be working properly :

 void RenderBin::removeRenderBinPrototype(RenderBin* proto)
 {
RenderBinPrototypeList* list = renderBinPrototypeList();
if (list  proto)
{
 for(RenderBinPrototypeList::iterator itr = list-begin();
itr != list-end();
++itr)
{
if (itr-second == proto)
{
list-erase(itr);
return;
}
}
}
 }

 I've attached the modified file.  Christof could you test this and let
 me know how you get on.  If things look fine I'll check the changes
 into svn/trunk and OSG-2.8 branch.

 Robert.

 ___
 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


Re: [osg-users] Simple question: How to set the icon that willbe used when a viewer is realized?

2009-03-12 Thread David Callu
Hi Matt

Can you put your submissions in osg-submissions mailing list.
Take a look to submissions
protocolhttp://www.openscenegraph.org/projects/osg/wiki/MailingLists/SubmissionsProtocolfor
more detail.

Cheer
David Callu

2009/3/11 Matt McPheeters mmcpheet...@rscusa.com

 Hi Robert,

 These source files came from OpenSceneGraph-2.7.4, which I checked out
 first from subversion.

 Please find the only three modified files attached.

 Thanks


 -Original Message-
 From: osg-users-boun...@lists.openscenegraph.org [mailto:
 osg-users-boun...@lists.openscenegraph.org] On Behalf Of Guy
 Sent: Wednesday, March 11, 2009 2:06 AM
 To: OpenSceneGraph Users
 Subject: Re: [osg-users] Simple question: How to set the icon that willbe
 used when a viewer is realized?


 Robert,
  I'm probably stating the obvious, but besides Matt changes I guess icon
 loading implementation for each of the platforms except windows will be
 required too.

 Guy.

 Hi Matt,

 Could you post the whole modified files, I can then review then with a
 view to merging them or something similar.

 Cheers,
 Robert.



 On Tue, Mar 10, 2009 at 6:43 PM, Matt McPheeters mmcpheet...@rscusa.com
 wrote:
  Awesome, it worked.  The icon I was talking about is the one in the
  upper left hand corner of the window.  But it also appears in the
  taskbar and the
  alt-tab popup menu.
 
  This is a Windows platform so the solution I came up with is not
  platform independent, but I believe I implemented it in the same generic
  way that
  GraphicsWindow::setWindowName() is done.
 
  In GraphicsWindow (header file, line 121):
 
 /** Set the icons the window uses */
 virtual void setWindowIcons(const std::string /*iconPath*/) {
  osg::notify(osg::NOTICE)GraphicsWindow::setWindowIcons(..) not
  implemented.std::endl; }
 
 /** Set the name of the window */
 virtual void setWindowName(const std::string /*name*/) {
  osg::notify(osg::NOTICE)GraphicsWindow::setWindowName(..) not
  implemented.std::endl; }
 
 
  In GraphicsWindowWin32 (header file, line 85):
 
 /** Set the icons for the window */
 virtual void setWindowIcons(const std::string /*iconPath*/);
 
 /** Set the name of the window */
 virtual void setWindowName(const std::string /*name*/);
 
  (and on line 151, the member variables):
 
 HWND_hwnd;
 HDC _hdc;
 HGLRC   _hglrc;
 HCURSOR _currentCursor;
 HICON   _currentIcon;
 
 
  In GraphicsWindowWin32.cpp (source file, line 959, the constructor):
 
  GraphicsWindowWin32::GraphicsWindowWin32( osg::GraphicsContext::Traits*
  traits )
  : _hwnd(0),
   _hdc(0),
   _hglrc(0),
   _currentCursor(0),
   _currentIcon(0),
 
  (and on line 1006, the destructor):
 
  GraphicsWindowWin32::~GraphicsWindowWin32()
  {
 if (_currentIcon != NULL)
 {
 DestroyIcon(_currentIcon);
 }
 
 close();
 destroyWindow();
  }
 
  (and on line 1878, the Windows implementation of the new function):
 
  void GraphicsWindowWin32::setWindowIcons( const std::string  iconPath )
  {
 HINSTANCE hinst = ::GetModuleHandle(NULL);
 _currentIcon = ExtractIcon(hinst, iconPath.c_str(), 0 );
 
 if (_currentIcon != NULL)
 {
 SendMessage(_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)_currentIcon
  );
 SendMessage(_hwnd, WM_SETICON, ICON_BIG, (LPARAM)_currentIcon );
 }
  }
 
  void GraphicsWindowWin32::setWindowName( const std::string  name )
  {
 _traits-windowName = name;
 SetWindowText(_hwnd, name.c_str());
  }
 
 
 
  Here is the code from my ::osgViewer application.  Names have been
  changed
  to protect the innocent (haha):
 
 viewer.realize();
 
 osgViewer::Viewer::Windows windows;
 viewer.getWindows( windows );
 std::string windowName;
 windowName.assign( fooViewer );
 windows[0]-setWindowName( windowName );
 windows[0]-setWindowIcons( barney.ico );
 
  All that is required is that barney.ico exists in the same directory
  that
  the executable is run from and contains a valid icon.  However, I
  verified that this code works even if the iconPath parameter contains
  full path information.  I did a test:
 
 windows[0]-( C:\\WINDOWS\\nvidia icons\\Portal_32x32.ico );
 
  And it worked like a charm.  If the file doesn't exist or exists but
  doesn't actually contain a valid icon, the viewer doesn't crash.  You
  just get the same default icon from before.
 
  Thanks for the great hints,
  -Matt
 
 
  -Original Message-
  From: osg-users-boun...@lists.openscenegraph.org
  [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Guy
  Sent: Monday, March 09, 2009 11:24 PM
  To: OpenSceneGraph Users
  Subject: Re: [osg-users] Simple question: How to set the icon that will
  beused when a viewer is realized?
 
  Hi,
   I guess it depends on your platform. I haven't seen generic
  implementation for it but I guess it could be added to display settings
  or something like that (maybe

Re: [osg-users] Qt4.5 problem

2009-03-12 Thread David Callu
Hi Martin

With the last version of Virtual Box 2.1, you can enable 3D acceleration.
HTH for your test with -graphicssytem opengl.

Cheer
David

2009/3/12 Martin Beckett osgfo...@tevs.eu

 Installed Qt4.5/Osg2.8.0 on Ubuntu in a VM and tested on that.
 with --QOSGWidget the osgviewerQT runs but doesn't redraw at all, there is
 no mouse movement.
 With adaptor widget the model displays correctly.
 It doesn't seem possible to run -graphicssytem opengl in a VM (at least
 in Virtualbox)

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=8371#8371





 ___
 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


Re: [osg-users] [build] Building from CMAKE on Windows - missing PNG_PNG_INCLUDE_DIR

2009-03-12 Thread David Callu
Hi Andrew

Just check the 'Show Advanced Values' check box on the top right of cmake
window.

HTH
David

2009/3/12 Andrew osgfo...@tevs.eu

 I am building the 2.8.0 Windows VS 2005 projects using CMAKE 2.6 and I get
 these (expected) messages in the CMAKE GUI log Window

 Could NOT find CURL  (missing:  CURL_LIBRARY CURL_INCLUDE_DIR)
 Could NOT find JPEG  (missing:  JPEG_LIBRARY JPEG_INCLUDE_DIR)
 Could NOT find PNG  (missing:  PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
 Could NOT find TIFF  (missing:  TIFF_LIBRARY TIFF_INCLUDE_DIR)

 Unfortunately, the PNG_PNG_INCLUDE_DIR or  PNG_LIBRARY are missing in the
 list of settable CMAKE variables - unlike the others.

 I noticed this in 2.6.1 as well.

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=8387#8387





 ___
 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


Re: [osg-users] OpenThreads : which config for win32 VC7 ?

2009-03-04 Thread David Callu
Hi Fabien

_OPENTHREADS_ATOMIC_USE_MUTEX is the default configuration. It use a mutex
to lock osg::Referenced instance for multi threaded access.
_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED is only use if compilator support
it. When you run cmake to configure the project, a test is done to determine
if _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED can be used.

It seem that VC7 didn't support it.

HTH
David Callu

2009/3/4 Fabien Dachicourt d...@spaceyes.fr

 Hi All,
 I noticed that on Win32 VC7, (OSG 2.8) Cmake auto shift OpenThread atomic
 config to _OPENTHREADS_ATOMIC_USE_MUTEX

 In which case can we use_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED, is it
 possible on VC7 Win32  ?

 Is it risky to use the config _OPENTHREADS_ATOMIC_USE_MUTEX ?

 Thanks in advance,

 --
 
 Fabien


 ___
 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


Re: [osg-users] What about User-Meeting in Europe - osgInEurope?

2009-03-03 Thread David Callu
Hi all

+1 for Paris ;-)

See you soon
David Callu

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=7869#7869





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Problem with 2D and 3D text in the same scene

2009-02-19 Thread David Callu
Hi Frank,

This is a bug.
I take a look.

more in next episode.
Cheer

David Callu

2009/2/18 frankmil...@jhmi.edu

 Greetings,

 I am experiencing problems rendering osgText::Text and osgText::Text3D
 in the same scene. I have boiled it down to a nice bite-size chunk of
 code which I have attached. I am running version 2.8.

 Is this a bug?

 Frank


 ___
 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


Re: [osg-users] Problem with 2D and 3D text in the same scene

2009-02-19 Thread David Callu
Hi Frank

Problem:
 osgText::Text and osgText::Text3D use the same font file.
 The first really load the file and obtain an osgText::Font object,
 the second use the cache created during the first load of the
 font file, and so obtain an osgText::Font object instead of
 osgText::Font3D object. To obtain an osgText::Font3D object,
 osgText::Text3D call osgDB::readObjectFile(...) with an option
 to specify the plugin we want an osgText::Font3D instead of
 osgText::Font.

Generalised Problem:
In osgDB::Registry, loaded file cache is referenced by the name
of this file, so if I load a file with some options, and the cache
already contain object for this filename, I obtain an object
potentially not loaded with my options.


Behaviours:
Cache management is delegate to osgDB::Registry, but cache
coherence (load a file with option then reuse it, deactivate the
cache when load a specific file or don't cached the loaded file)
is user's responsibility.


Text3D case:
Delegate the cache coherence of font file in osgText to the user
is not a good idea. So to fix this I think to 2 solution:
- never use the cache when load a font for a Text3D. Just because
  to load a Font3D, we use option in osgDB::readObjectFile()
- move osgText::Font3D implementation in osgText::Font,
  suffix ex-Font3D method with 3D in osgText::Font
  (so osgText::Font3D::getGlyph() become osgText::Font::getGlyph3D()
)
  And so Text and Text3D use the same osgText::Font object which
contain
  2D and 3D glyph.


Thought, Robert, Other ?

David Callu


2009/2/19 David Callu led...@gmail.com

 Hi Frank,

 This is a bug.
 I take a look.

 more in next episode.
 Cheer

 David Callu

 2009/2/18 frankmil...@jhmi.edu

 Greetings,

 I am experiencing problems rendering osgText::Text and osgText::Text3D
 in the same scene. I have boiled it down to a nice bite-size chunk of
 code which I have attached. I am running version 2.8.

 Is this a bug?

 Frank


 ___
 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


Re: [osg-users] Problem with 2D and 3D text in the same scene

2009-02-19 Thread David Callu
Hi Robert


I think merging the osgText::Font and Font3D implementations would be
 the cleanest approach.

I think too ... but ...



 Another, more hacky approach would be to postfix the font file name by
 .Text3D or something similar and then have the freetype plugin return
 Font3D when it detects this.


This solution is really smart, it not break the scalability of osgText.
I don't know which use can be done with a font except 2D or 3D glyph,
but this keep the door open to other thing.

osgText::Text3D have to ensure that name of font file is ended by .Text3D
and
font file cache coherence is not delegate to the user.

I have try this solution and work fine.

I prepare a submission if you prefer the second solution.
Or implement the first one otherwise.

As you want.

David



 Robert.

 Robert.
 ___
 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


Re: [osg-users] Please test svn/trunk in prep for 2.7.7 dev release

2008-12-12 Thread David Callu
Hi Robert, Hi all

OSG 2.7.7 already tagged but always good to know build report.



Fedora 8
GCC 4.1.2
OSG - SVN 9345 - except DCMTK, FOX, INVENTOR, ITK, OPENVRML, Performer

release and debug build fine
exemples run fine too.



Cheers
David Callu



2008/12/12 Robert Osfield robert.osfi...@gmail.com

 Hi Cedric,

 On Fri, Dec 12, 2008 at 6:31 PM, Cedric Pinson morni...@plopbyte.net
 wrote:
  did you merge osgWidget branch with ?

 No I haven't merged in recent changes from the osgWidget branch.   I'm
 inclined to get 2.7.7 out the door, then merge osgWidget.  My plan is
 to start making dev release more regularly now we are closing in on
 2.8.

  Because if yes we need to sync data, i
  updated
  osgAnimation, examples, bvh plugin, and data.
  I created a data repository here http://hg.plopbyte.net/osg-data that is
  sync with our branch.

 Robert.
 ___
 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


Re: [osg-users] avoid writing some node on osgDB::writeNodeFile

2008-10-15 Thread David Callu
Hi Alexandre

You can just copy the Scene Graph structure (osg::Node, osg::Group, ...)
and share every other thing (StateSet, Drawable, texture, ...)
You can specify which object to share and which to clone with the
osg::CopyOp class.


HTH
David Callu

2008/10/6 amalric alexandre [EMAIL PROTECTED]

 Hi osg-users,

 I would have know if it was possible to avoid to write some node in a scene
 when calling osgDB::writeNodeFile on the current scene.

 Let's assume I got a group of nodes and I wand to save this group on disk
 without saving some chosen nodes from the group. But I don't want to modify
 the group because I need it to stay the same.

 My first choice was to make a copy from the group, modifying the copy
 keeping the original and writing the copy. But I think it's a bad choice
 because I got very big nodes (300Mo and more) and making a copy use more
 memory.

 If someone has a great idea, please let me know

 Thank you,

 --
 Alexandre AMALRIC   Ingénieur RD
 ===
 PIXXIM S.A. 73E, rue Perrin-Solliers 13006 Marseille
 http://www.pixxim.fr

 ___
 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


Re: [osg-users] Example osgtexture1d

2008-09-29 Thread David Callu
oups .. forgotten

OSG svn rev 8956


David Callu



2008/9/29 David Callu [EMAIL PROTECTED]

 Hi Mathieu

 Same thing for me.


 Fedora 8, kernel 2.6.26
 gcc 4.1.3
 driver NVidia 173.14.12


 David Callu

 2008/9/29 Mathieu MARACHE [EMAIL PROTECTED]

 Hi,
 While playing with the example osgtexture1d, I wasn't able to see the
 changes from object linear to eye linear mode. I've run the example both on
 linux and windows with latest svn version. I would have expected to see
 bands of colours linked to the object in OBJECT_LINEAR and eye linked bands
 of colours in EYE_LINEAR mode. But it seems to me that only the
 OBJECT_LINEAR mode is working...

 Could someone please test it and see if the dumptruck changes it's texture
 every other second to eliminate a possible driver issue ?

 Thanks in advance

 --
 Mathieu

 ___
 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


Re: [osg-users] osgText - size is half of font resolution

2008-08-25 Thread David Callu
Hi Sherman,


I download the FontForge http://fontforge.sourceforge.net/ editor on
sourceforge.
When I examine a Glyph of arial.ttf font with a size of 12 :
   - A, there are 9 line for the glyph and 3 blank line under.
   - a, there are 2 blank line on the top, 7 line for the glyph and 3
blank line under.
   - q, there are 2 blank line on the top, 10 line for the glyph.

My conclusion is when you specify a size for a font,
this ensure that all glyph of the font have a height lesser to the specified
size.
But the place of the glyph is for someone largely over the base line ( for
example `),
and for other under the base line, _. So all the height is used by the
font.

Other source:
In Qt documentation, for a given Font, height is equal to ascend of this
Font
(space over the base line) + descend of this Font (space under the base
line)
+ 1 ( for the base line) pixels.






try attached example,

I take your code and adapt it in a main function.
I print text with height equal to the screen height
(1024 for me, modify the SCREEN_SIZE in file
osgtext_sherman2 : l.11 if you need). When the text is
display in fullscreen, you are sure that all text have
a height less or equal to the screen height,
many time the glyph height is half of the screen
height, but for some glyph ( for example the | or $ glyph)
 the height is 3/4 of the screen height.



HTH
David Callu










2008/8/22 sherman wilcox [EMAIL PROTECTED]

 Can someone explain why the code below consistently produces text that
 is half the height specified? If I render this text, take a screenshot
 and measure the height of the text ABC in a paint program it will
 measure up as approximately 64 pixels tall for a character size /
 resolution of 128. I change the 128 to 256, the text will then
 measures 128 and so on. Always measures half of what I specify. Should
 this not render text that is approximately 128 pixels in height? I
 understand that the characters won't be exactly the width/height I
 specify, but half? Is this a bug or what?

 {
osg::Vec3d pos(osg::DegreesToRadians(someLat),
 osg::DegreesToRadians(someLon), 0);
ellipsoidModel-convertLatLongHeightToXYZ(pos[0], pos[1], pos[2],
 pos[0], pos[1], pos[2]);
osg::ref_ptrosg::MatrixTransform mt = new osg::MatrixTransform();
mt-setMatrix(osg::Matrix::identity());
mt-setMatrix(osg::Matrix::translate(pos));

osg::ref_ptrosgText::Text text = new osgText::Text;
text-setFont(Arial.ttf);
osgText::Text::BackdropType type = osgText::Text::OUTLINE;
text-setBackdropType(type);
text-setColor(osg::Vec4(1,1,1,1));
text-setBackdropColor(osg::Vec4(0,0,0,1));
text-setAlignment(osgText::TextBase::CENTER_CENTER);
text-setAutoRotateToScreen(true);
text-setText(ABC);
text-setCharacterSizeMode( osgText::TextBase::SCREEN_COORDS );
text-setCharacterSize(128);
text-setFontResolution(128, 128);


osg::ref_ptrosg::Geode geode = new osg::Geode();
geode-addDrawable(text.get());

mt-addChild(geode.get());
mt-getOrCreateStateSet()-setMode(GL_DEPTH_TEST,
 osg::StateAttribute::OFF);
root-addChild(mt.get());
  }
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

#include osg/Geode
#include osg/MatrixTransform
#include osgText/Text
#include osgGA/TrackballManipulator
#include osgGA/StateSetManipulator
#include osgViewer/Viewer
#include osgViewer/ViewerEventHandlers

//#include 

#define SCREEN_SIZE 1024

int main()
{
osgViewer::Viewer viewer;
viewer.setCameraManipulator(new osgGA::TrackballManipulator());
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()-getOrCreateStateSet()) );
viewer.addEventHandler(new osgViewer::WindowSizeHandler);
viewer.addEventHandler(new osgViewer::StatsHandler);


 

osg::ref_ptrosgText::Text text = new osgText::Text;
text-setFont(arial.ttf);
text-setBackdropType(osgText::Text::OUTLINE);
text-setColor(osg::Vec4(1, 1, 1, 1));
text-setBackdropColor(osg::Vec4(0, 0, 0, 1));
text-setAlignment(osgText::TextBase::CENTER_CENTER);
text-setAutoRotateToScreen(true);
text-setText(!\#$%'()*+,-./123456789:;=[EMAIL PROTECTED]|}~);
text-setCharacterSizeMode(osgText::TextBase::SCREEN_COORDS);
text-setCharacterSize(SCREEN_SIZE);
text-setFontResolution(SCREEN_SIZE, SCREEN_SIZE);

osg::ref_ptrosg::Geode geode(new osg::Geode());
geode-addDrawable(text.get());

osg::ref_ptrosg::Group root = new osg::Group();
root-addChild(geode.get());
root-getOrCreateStateSet()-setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);

viewer.setSceneData(root.get() );
viewer.setThreadSafeReferenceCounting(true);
viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);

viewer.realize();

while (viewer.done() == false)
{
viewer.frame();
}

return 0

Re: [osg-users] [Not OSG related question] Virtual memory management on Windows

2008-06-25 Thread David Callu
power linux Serge ;-).

Regards
David Callu

2008/6/25 Serge Lages [EMAIL PROTECTED]:

 Hi all,

 I have a question not related to OSG but I can't find any answer, and this
 is something that some of you probably knows. That's why I try here to find
 some help.

 Here is my problem : I have a big image database with some images larger
 than 1.5Go uncompressed, and I fail to load them (Win XP SP2 32bits with
 Visual Studio 8). My computer has 3Go of virtual memory and the option /3GB
 is activated on the system. In this document (page 13) :

 http://actes.sstic.org/SSTIC05/Vulnerabilites_et_gestion_des_limites_memoire/SSTIC05-article-Delalleau-Vulnerabilites_et_gestion_des_limites_memoire.pdf
 It says it's not possible to allocate more than 1.3Go in one call, and it's
 actually the limit where it crashs. If I do 2 allocations of 1Go each, it
 works, but 1 allocation of 1.4Go crashs...

 Has someone any idea if it's possible to change this limit ? My only hope
 will be to make smaller images, or even to develop under Linux ? :)
 Thanks in advance !

 --
 Serge Lages
 http://www.tharsis-software.com
 ___
 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


Re: [osg-users] (no subject)

2008-06-12 Thread David Callu
Hi Pecoraro

thank to spot the bug
please send your submissions on osg-submissions the next time.


after review the original code, at line Optimizer.cpp:1561

lod-getNumRanges() is used to know how many iteration will be done in the
for loop, and
getNumRanges have to be equal to getNumChild, so lod-getChild(i) at line
1563 is not the problem.

Perhaps you LOD is not synchronised (num of  children and num of range are
not equal)i don't know why or how is possible.
Anyway, in a case of a PagedLOD, only the code of LOD is used, so not
special case for a PagedLOD.

correct me if i'm wrong.

Cheers
David Callu

2008/6/6 Pecoraro, Alexander N [EMAIL PROTECTED]:


 I think there is a bug in the osgUtil::Optimizer::CombineLODVisitor - at
 line 1530 of Optimizer.cpp it does a dynamic_cast on and osg::Node* to
 osg::LOD* and then at line 1563 it calls getChild(i) (even if
 getNumChildren() == 0) on the dynamically casted LOD node. This works
 fine when the node is an LOD node, but when it is a PagedLOD node then
 it causes in invalid access to the _children vector. I attached a screen
 shot to show what I mean.

 This situation would only ocurr when a PagedLOD node was a sibling of an
 LOD node, which is probably why it hasn't been spotted before.

 Not sure if this is the accepted way to submit a fix, but anyway I made
 a fix to the Optimizer code (version 2.4) and attached it to the email.

 Alex

 ___
 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


Re: [osg-users] Shader Problem

2008-06-12 Thread David Callu
hi CG

when you remove a shader, osg::Program need to be relinked.
this is done by osgUtil::GLObjectVisitor in osgViewer::Renderer::draw
method.
So this seem can be done at runtime.

Which OSG version did you use ?
Did you use osgViewer ?

David Callu


2008/6/12 CG [EMAIL PROTECTED]:

 Hi all,

 Are there any ways to remove the shader during runtime? I've tried
 the removeShader function but the effect of the shader is still applied to
 my models (e.g tank) i.e. the appearance of the models do not go back to the
 state before shader is applied.

 Regards,
 Cg
 --
 Chat online and in real-time with friends and family! Windows Live
 Messenger http://get.live.com/messenger/overview

 ___
 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


Re: [osg-users] BlueMarble example

2008-06-12 Thread David Callu
Hi Michael

osgDB::ImageOptions class is in the SVN trunk.
I can't found osgbluemarble in the SVN trunk so no idea what is wrong.
perhaps an include issue...

can you send an exact error message.

David Callu


2008/6/12 Michael W. Hall [EMAIL PROTECTED]:

 I was using some code from the osgbluemarble.cpp example.  I am getting
 an error stating that ImageOptions is not a member of osgDB.  I have
 been looking in the documentation on the website and have not found
 anything.  Can someone tell me what has replaced this or where it is
 now?

 Thanks.


 ___
 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


Re: [osg-users] Shader Problem

2008-06-12 Thread David Callu
Hi CG


When your remove a shader, void Program::dirtyProgram() is called to
request a relink in the next frame.
Program is relinked in the next frame in void Program::apply( osg::State
state ) const method.
Follow your code in a debugger to see if all is properly done.

Are you sure your shader is well removed from your program ?

HTH
David Callu

2008/6/12 CG [EMAIL PROTECTED]:


 Hi David,

 I'm using osg 2.4 and osgViewer.

 Regards,
 Cg

  --
 Date: Thu, 12 Jun 2008 11:09:49 +0200
 From: [EMAIL PROTECTED]
 To: osg-users@lists.openscenegraph.org
 Subject: Re: [osg-users] Shader Problem


 hi CG

 when you remove a shader, osg::Program need to be relinked.
 this is done by osgUtil::GLObjectVisitor in osgViewer::Renderer::draw
 method.
 So this seem can be done at runtime.

 Which OSG version did you use ?
 Did you use osgViewer ?

 David Callu


 2008/6/12 CG [EMAIL PROTECTED]:

 Hi all,

 Are there any ways to remove the shader during runtime? I've tried
 the removeShader function but the effect of the shader is still applied to
 my models (e.g tank) i.e. the appearance of the models do not go back to the
 state before shader is applied.

 Regards,
 Cg
 --
 Chat online and in real-time with friends and family! Windows Live
 Messenger http://get.live.com/messenger/overview

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



 --
 Always-on security tools provide safer ways to connect and share anywhere.
 Find out more. Windows Live http://get.live.com/familysafety/overview

 ___
 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


  1   2   >