Re: [osg-users] VBO Bug ?

2011-10-15 Thread Wojciech Lewandowski

Hi, Guys,
Bug reported to NVidia.  Will keep you posted on progress. See my report 
below:

WL


From: Wojciech Lewandowski
Sent: Saturday, October 15, 2011 2:10 PM
To: devsupp...@nvidia.com
Subject: OpenGL VBO bug in Windows (OpenSceneGraph)

Dear Dev Support,

We have recently isolated an issue with Vertex Buffer Objects in 
OpenSceneGraph on Windows 7 platform. Issue seems to happen on variety of 
boards and drivers. We actually saw it on everything we tested on. GF580, 
GF460, GF540, GF 280 with recent drivers from 270.xx to most current 285.xx. 
And people on osg forums also reported seeing it on several Quadros (don’t 
remember which ones, though) with older 186.xx drivers.  We did not see it 
on other manufacturer boards and we did not see it on NVidia in Linux. It 
can be “fixed” by turning off Threading optimization in NVidia control 
panel. So its most probably an issue in NVidia OpenGL Windows drivers.


The problem we observe is corruption of the texture coords stored in VBOs in 
one or more primitive sets when sufficiently large VBOs are used. It happens 
when VBO sizes are close to range limits addressable with 16 bit ushort and 
greater (we use Uint 32 bit indices, though). These large VBOs contain 
vertices and texcoords.  These triangles are indexed and drawn with 
glDrawElements call. 32 bit Uint indices are used and also stored in buffer 
objects. It seems that issue is somehow triggered by small addition of 
legacy code. All these triangles use single overall normal (I am not sure 
but this probably translates to glNormal call). If this overall normal is 
not added output seems correct.
I have attached modifed osgViewer applet showing the issue. Package contains 
both prebuilt binary with neccessary osg dlls and modified osgViewer source 
if you prefer to use your OSG version. osgViewer should be run without 
command line arguments to show the problem.


Sample code in osgViewer replicating the issue was created in process of 
elimination of various factors so its now rather artificial. It just draws 
two primitive sets: one triangle and second primitve made of grid build from 
many triangles. Problem directly affects this grid of triangles. First 
triangle is somehow involved and neccessary to make it happen, though. If 
there is no first triangle and there is no overall normal problem does not 
appear.


Visually the code just draws one triangle and quad over the triangle. Both 
quad and triangle are colored with red yellow magenta gradient. If all is 
ok - its hard to notice the border between quad and triangle. If the problem 
shows up - quad is either drawn in red or not drawn at all, so only a 
triangle is drawn with gradient and nasty z-fighting between red quad and 
triangle can be observed.


See attached screenshots for correct and incorrect output. I will be 
grateful for some feedback on this issue. Let me know if you are going to 
fix it and in what drivers ?


Best Regards,
Wojtek Lewandowski


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


[osg-users] About how to update the camera

2011-10-15 Thread ramy panda
Hi,

Now I have faced a problem is that when i import a model into my own 
application, the model is not show at the center of the viewport, only after 
interacted with the model using translate function i can see the model in the 
view. I'm wondering that how to update the camera to make sure the model is 
showed in the center of the viewport after i import the model into the scene. 
Please be detail as i am a new user. Thanks very very very much.

Thank you!

Cheers,
ramy

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





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


Re: [osg-users] About how to update the camera

2011-10-15 Thread Sergey Polischuk
Hi, Ramy

By default camera view matrix is identity. You should set view matrix on viewer 
camera to get what you want, or use camera manipulator.
Also you can use viewer::run() instead of calling viewer::frame() in loop, this 
call (along with other things) adds camera manipulator and center view on scene.

Cheers

15.10.2011, 17:22, ramy panda ramypanda@gmail.com:
 Hi,

 Now I have faced a problem is that when i import a model into my own 
 application, the model is not show at the center of the viewport, only after 
 interacted with the model using translate function i can see the model in the 
 view. I'm wondering that how to update the camera to make sure the model is 
 showed in the center of the viewport after i import the model into the scene. 
 Please be detail as i am a new user. Thanks very very very much.

 Thank you!

 Cheers,
 ramy

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

 ___
 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