Re: [osg-users] Build error in FBX plugin

2011-05-15 Thread Robert Osfield
Thanks Rui, fix looks appropriate, I've made this change and the
warning goes away.  Plenty more warnings still to fix though...  This
particular fix is now checked into svn/trunk.  Cheers, Robert.

On Sun, May 15, 2011 at 12:58 AM, Wang Rui wangra...@gmail.com wrote:
 Hi Robert and J-S,

 I've met the same problem while compiling with FBX SDK 2012.1. Edit
 the line 364 of WriteNodeVisitor.cpp:

 _fbxTexture = KFbxTexture::Create(...);

 to

 _fbxTexture = KFbxFileTexture::Create(...);

 and it compiles fine now.

 Cheers,

 Wang Rui


 2011/5/15 Robert Osfield robert.osfi...@gmail.com:
 Hi J-S,

 I downloaded FBX SDK for linux on Thursday and it built fine with the
 fbx plugin in svn/trunk.  I've just rebuilt the plugin and while I get
 lots of warnings everything compiles.  One of the warnings is;

 /home/robert/OpenSceneGraph/src/osgPlugins/fbx/WriterNodeVisitor.cpp:364:76:
 warning: invalid conversion from ‘fbxsdk_2012_1::KFbxTexture*’ to
 ‘fbxsdk_2012_1::KFbxFileTexture*’

 Which lots mightly like the one that is causing an error for you.
 I'm afraid I don't know anything about the fbx plugin or the fbx SDK
 so can't say what the appropriate fix would be.  I'll defer to those
 who've been working with the fbx SDK for guidance on this.

 Cheers,
 Robert.


 On Sat, May 14, 2011 at 1:18 PM, Jean-Sébastien Guay
 jean-sebastien.g...@cm-labs.com wrote:
 Hi all,

 I had fixed my nightly build lately (I had to update my FBX plugin), but it
 has started failing again. Is it possible that a recent submission has been
 made with the wrong version of the FBX plugin?

 The error I get is:

 1..\..\..\..\src\osgPlugins\fbx\WriterNodeVisitor.cpp(364) : error C2440:
 '=' : cannot convert from 'fbxsdk_2012_1::KFbxTexture *' to
 'fbxsdk_2012_1::KFbxFileTexture *'

 Thanks,

 J-S
 --
 __
 Jean-Sebastien Guay    jean-sebastien.g...@cm-labs.com
                               http://www.cm-labs.com/
                    http://whitestar02.dyndns-web.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

 ___
 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] Transformation nodes with shaders

2011-05-15 Thread SkullCheck
Hi,

I'm working on implementing some lighting effects with shaders and
I've run into the problem that vertex positions are passed to the
shader in local coordinates. This means that if there are any
transformation nodes in the scenegraph underneath where the shader is
active, the lighting calculations won't be transformed correctly.

I've dug into the OSG source code a bit and found the following:

- special osg_* uniforms are maintained in the State class, the ones
of interest are osg_ModelViewProjectionMatrix, osg_Vertex, etc

- the updating of these uniforms during draw traversal must be enabled
by calling State::setUseModelViewAndProjectionUniforms(true)
  I'm not quite sure where to set this though since States are used in
multiple places, I've tried the following:

osgViewer::Viewer * viewer = new osgViewer::Viewer;
osgViewer::Renderer * renderer = dynamic_castosgViewer::Renderer
*(viewer-getCamera()-getRenderer());
osgUtil::SceneView * sceneView = renderer-getSceneView(0); // Do
this also for 2nd sceneview
sceneView-setActiveUniforms( osgUtil::SceneView::ALL_UNIFORMS );
sceneView-getState()-setUseModelViewAndProjectionUniforms(true);


- Modify the shader source to use the special osg_* built-in uniforms:

osg::ref_ptrosg::State state = new osg::State;
state-convertVertexShaderSourceToOsgBuiltIns( srcString );
shader-setShaderSource(srcString);

   (Couldn't osg::State::convertVertexShaderSourceToOsgBuiltIns() be a
static method or free function?)

But when I do this, then nothing appears. What am I doing wrong or are
there other things I should be doing?

Thanks,
Chris
___
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-05-15 Thread SkullCheck
I've started a separate thread for the transformation problem with
subject: Transformation nodes with shaders

On Fri, May 13, 2011 at 2:42 PM, SkullCheck csklu...@gmail.com wrote:
 Hi David,

 Thank you for your feedback. It looks like we are doing similar
 things, but a bit differently. I was distracted by another project the
 past couple of weeks but returned to this one and was given the go
 ahead to do a complete redesign. I have the UML of the design if
 you're interested. Basically I try to replicate the interface of
 osg::Light and osg::LightSource and automate all the uniform updates
 underneath. Also automated the setup of the shader programs.
 Unfortunately I need to wrap this all up next week so am not sure if
 we could've collaborated.

 But I have am still having one problem though. If there are some
 transform nodes in the scenegraph under the stateset containing the
 shader code, the vertex shader receives vertices in the transform
 node's local coordinates. The screenshot shows an example. There is a
 green light at the center of the spiral. I've placed a box offset from
 the center, but the green light from the center is showing up on the
 box instead of the peachish light that is nearby.

 Thanks,
 Chris

 On Tue, Apr 19, 2011 at 9:42 AM, David Callu led...@gmail.com wrote:
 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 

[osg-users] save a movie

2011-05-15 Thread Sergey Kurdakov
Hi

you may use

http://code.google.com/p/osgworks/source/browse/trunk/src/osgwTools/ScreenCapture.cpp

http://code.google.com/p/osgworks/source/browse/trunk/src/osgwTools/ScreenCapture.cpp
Regards
Sergey
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgexport for blender?

2011-05-15 Thread issam boughanmi
any news on the 2.57 blender exporter ?

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





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


Re: [osg-users] osgexport for blender?

2011-05-15 Thread Damyon Wiese
I am working on a new version of the exporter - it works for static meshes, but 
not animations yet. It does support vertex colors, materials and textures. I'll 
post it as soon as I have fixed the animation problem. 

The animations are exported from the list of nla tracks - but they don't work 
yet.

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





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


Re: [osg-users] osgexport for blender?

2011-05-15 Thread issam boughanmi
Hi damyon ,

can you post this unfinished exporter for 2.57 ?

can we use it if we have only static models ?

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





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


[osg-users] [build] osg with QT how to?

2011-05-15 Thread jin tongo
Hi,

I want to use osg with QT.
What I have:
- VS2008 on Windows 7,
- QTSDK installed
- compiled osg with VS in C:\OpenSceneGraph-2.8.4\build.

Now I want to try out an example that uses QT and osg.
Running CMake over that example now produces the following:


Code:

CMake Error at C:/Program Files (x86)/CMake 
2.8/share/cmake-2.8/Modules/FindOpenSceneGraph.cmake:226 (message):
  ERROR: Missing the following osg libraries: osgViewer osgGA osgDB osgUtil
  osgQt osg OpenThreads.

  Consider using CMAKE_PREFIX_PATH or the OSG_DIR environment variable.  See
  the C:/Program Files (x86)/CMake
  2.8/share/cmake-2.8/Modules/FindOpenSceneGraph.cmake for more details.
Call Stack (most recent call first):
  CMakeLists.txt:12 (find_package)




So it seems like he doesnt even find osg.
He also doesnt find any OSGQT library, which is obvious, because I don't have 
any OSGQT folder in osg/src.

I read that i needed the osg trunk version for OSGQT, so I checked out, tried 
to run cmake over it and compile it, but when I try to ALL BUILD I always get 
windows incremental linker has stopped working error messages.

The attachments are screenshots of my env variables for osg and QT, for your 
info.I'd be happy if there is someone out there who can tell me how to get it 
working!

Thank you!

Cheers,
jin[/code]

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




Attachments: 
http://forum.openscenegraph.org//files/env3_774.jpg
http://forum.openscenegraph.org//files/env2_111.jpg


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


[osg-users] Shadow is not updated with the light

2011-05-15 Thread Sumit Pandey
While working with shadow I stumbled across the problem.  I am using
LightSpacePerspectiveShadowMapDB. If am passing the light from the viewer to
minimalshadowmap(base class of LightSpacePerspectiveShadowMapDB), then the
shadow doesn't works. If I don't intitialize it with the viewer's light(or
any other light). Then it gives some shadow at the beginning, but its not
updated with the lights in the scene. If I don't give the light, which light
it uses? What I could be doing wrong? One more thing, what is meaning of
global light of scene in terms of OpenGL?

Thanks

 

Cheers

Sumit Pandey

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


Re: [osg-users] osgexport for blender?

2011-05-15 Thread Cedric Pinson
Hi,

Even if animation does not work yet, if it exports models it's something
useful for a lot of people. I suggest we merge your current work then It
will be possible to improve animation part.

Cedric

On Sun, 2011-05-15 at 17:26 +0200, issam boughanmi wrote:
 Hi damyon ,
 
 can you post this unfinished exporter for 2.57 ?
 
 can we use it if we have only static models ?
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=39380#39380
 
 
 
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 

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


signature.asc
Description: This is a digitally signed message part
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] OSG 2.9.10 on iOS

2011-05-15 Thread Büsra Gülten
Hi,

after debugging , I finally get only this error: 


 target specifies product type 'com.apple.product-type.tool', but there´s no 
 such product type for the 'iphonesimulator' platform. 


Does it mean, that OSG isn´t available for iPhoneSimulator?What can/should I 
do? 

Thank you!

Cheers,
Büsra

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





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


Re: [osg-users] OSG 2.9.10 on iOS

2011-05-15 Thread Ulrich Hertlein
Hi Büsra,

On 16/05/11 9:01 , Büsra Gülten wrote:
 after debugging , I finally get only this error:
 
 target specifies product type 'com.apple.product-type.tool', but there´s no 
 such
 product type for the 'iphonesimulator' platform.
 
 Does it mean, that OSG isn´t available for iPhoneSimulator?What can/should I 
 do?

OSG certainly runs in the simulator (I have yet to run it on the actual device 
;-)

I've never encountered that error message before, could you paste your cmake 
configuration
command line?  What version of Xcode/iOS SDK are you using?

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