Re: [osg-users] CPU usage

2011-02-20 Thread Neil Neilson
Hi Jean

My third notebook has a Mobile Intel(R) 945GM Express Chipset
That is the one I use most for development.
The refresh rate is set at 60 Hertz
I don't know if that is the vsync you are referring to.
If it is then osgEarth must be changing it because when zoomed way out
pressing the S key showed about 120.

My app will redraw/change once per second unless a user wants to tinker
with the mouse or pen which will be seldom.

I will do some checking, OpenScreenGraph may be able to display a 
globe with terrain and height data.  osgEarth has many functions that are 
nice but for my purpose they may not be necessary until later.
I am still new to this.  CPU usage is important.
Even in the WWJ app most of what is in the SDK/JDK 
was not used except the core display code.

As mentioned before all the apps that interact with the display are in C++
that feeds data in and calls for a redraw.  Any direct manipulation of the 
display is usually just to get familiar with it.

Thanks

Neil

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





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


Re: [osg-users] CPU usage

2011-02-20 Thread Jean-Sébastien Guay

Hi Neil,


I have 2 Notebooks with ATI and a Desktop NVIDIA cards.  Changing something 
there
would not help if an app is run on someone else's computer but that is good to 
know.


My comment about the differences between ATI's drivers and Nvidia's only 
concerned *default* settings. You can make your app force vsync on (I 
think it's in the Traits structure when you create a GraphicsContext, or 
else it's part of the GraphicsWindow class). I would highly encourage 
you to turn vsync on in your apps as it leads to a more consistent and 
pleasing experience (no tearing and no large frame rate spikes).


That being said, run on demand is good too if you can use it (i.e. if 
things are not animating all the time in your app), but the two are not 
mutually exclusive, so you can turn vsync on anyways :-)


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] Porting GraphicsWindowWin32 and PixelBufferWin32 from WGL to EGL

2011-02-20 Thread Eric Weitzman
(cross-post from forum post on "Sat Feb 19, 2011 9:50 pm" to mail2forum)

 

I'm moving along with this port. osgViewer is partially running on top of
imgtek's PVRVFrame ES 2.0 emulator on Windows 7. At this point, osgViewer
starts ups, OGLES initialization is working, windows are created, and the
emulator's control panel opens up. When I run osgViewer with cow.osg, a
problem occurs compiling a shader. 

 

The problem is most likely a compatibility issue so hopefully someone with
more experience might see the problem. 

 

When I look at the call stack, a runtime access violation occurs in
libGLES2v2.dll. The last function in osg before calling into the emulator is
osg::Shader::compileShader and the program ends. 

 

The following is output by the PVRVFrame libraries and/or osg. Though I'm
only trying to use the GLESv2 library, the results are the same if the v1
library is in the path or not.

 

 

PVRVFrameSetGlesLibraryPath: C:\Windows\system\libGLES_CM.dll 

PVRVFrameSetGlesv2LibraryPath: C:\Windows\system\libGLESv2.dll 

vendor/shl: Imagination Technologies (Host GL: `ATI Technologies Inc.`) 

vendor/shl: OpenGL ES 1.1 ( SDK build: 2.07.27.0297)3.3.10061
Compatibility Profile Context`) 

bufek withs es1 exts: OGLES1 EXTENSIONS: GL_OES_byte_coordinates 

GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get 

GL_OES_read_format GL_OES_compressed_paletted_texture 

GL_OES_point_sprite GL_OES_point_size_array GL_OES_matrix_palette 

GL_OES_dra w_texture GL_OES_query_matrix GL_IMG_read_format 

GL_IMG_texture_compression_pvrtc GL_IMG_texture_format_BGRA 

GL_OES_texture_ env_crossbar GL_OES_texture_mirrored_repeat 

GL_OES_blend_subtract GL_OES_blend_func_separate 

GL_OES_blend_equation_separate GL_O ES_stencil_wrap 

GL_OES_extended_matrix_palette GL_OES_stencil8 GL_OES_rgb8_rgba8 

GL_OES_depth24 GL_OES_texture_cube_map 

GL_OES_compressed_ETC1_RGB8_texture GL_OES_mapbuffer 

GL_EXT_multi_draw_arrays GL_OES_framebuffer_object 

vendor/shl: Imagination Technologies (Host GL: `ATI Technologies Inc.`) 

vendor/shl: OpenGL ES 2.0 ( SDK build:  2.07.27.0297) 3.3.10061
Compatibility Profile Context`) 

vendor/shl: OpenGL ES GLSL ES 1.00 ( Host GL: `3.30`) 

Warning: detected OpenGL error 'invalid enumerant' at Before
Renderer::compile 

 

The first shader being compiled breaks. It appears to be generated by
osg::ShaderGenCache::createStateSet(). Here it is:

 

 

varying vec3 normalDir; 

varying vec3 lightDir; 

varying vec3 viewDir; 



void main() 

{ 

 gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex; 

 gl_TexCoord[0] = osg_MultiTexCoord0; 

 normalDir = osg_NormalMatrix * osg_Normal; 

 vec3 dir = -vec3(osg_ModelViewMatrix * osg_Vertex); 

 viewDir = dir; 

 vec4 lpos = gl_LightSource[0].position; 

 if (lpos.w == 0.0) 

  lightDir = lpos.xyz; 

 else 

  lightDir = lpos.xyz + dir; 

} 



Any ideas about what the problem might be? 

 

Thanks, 

- Eric

 

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


[osg-users] Porting GraphicsWindowWin32 and PixelBufferWin32 from WGL to EGL

2011-02-20 Thread Eric Weitzman
(cross-post from forum post on "Fri Feb 11, 2011 6:59 pm" to mail2forum)

 

I'd like to port GraphicsWindowWin32 and PixelBufferWin32 to work on EGL as
well as WGL. I'd use the PVRVFrame EGL libraries as the target. 

There's a pending mini-milestone for this at the bottom of the OpenGL-ES
support page on the wiki (wiki/Community/OpenGL-ES) but this is pretty old
information. I don't want to reinvent the wheel if this has already been
done by someone else. Does anyone know the status of this? 

Thanks, 
- Eric

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


Re: [osg-users] Announcing osg.js

2011-02-20 Thread Cedric Pinson
Sure,
Do the lift you want and send me back your update I will be happy to
look at it and report it back on osg.js

Cheers,
Cedric

On Sat, 2011-02-19 at 19:29 +0100, Martin Scheffler wrote:
> Very awesome!
> 
> I'm especially interested in the JS side - I've just been looking for a 
> javascript linear algebra library to use with my own project 
> (http://www.sourceforge.net/apps/mediawiki/delta3d-extras/index.php?title=DtEntity)
> 
> Mind if I lift your vector, matrix and quat classes? I've already tried them 
> out and they seem to work perfect!
> The only thing I missed was a function to rotate a vec around a quaternion, 
> so I wrote one:
> (in osg.Quat:)
> 
> Code:
> 
> rotate: function(q, v, result) {
> var uv = [0, 0, 0];
> var uuv = [0, 0, 0];
> osg.Vec3.cross(q, v, uv);
> osg.Vec3.cross(q, uv, uuv);
> osg.Vec3.mult(uv, 2.0 * q[3], uv);
> osg.Vec3.mult(uuv, 2.0, uuv);
> osg.Vec3.add(v, uv, result);
> osg.Vec3.add(result, uuv, result);
> },
> 
> 
> 
> 
> Thank you!
> 
> Cheers,
> Martin
> 
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=36860#36860
> 
> 
> 
> 
> 
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 

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


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] CPU usage

2011-02-20 Thread Neil Neilson
Hi Jean

I tried the --run-on-demand in a .bat file
osgviewer --run-on-demand C:\OpenSceneGraph-2.9.9\data\cessna.osg
That worked very well, the CPU was nearly 0 when the image was not being 
changed.

I have 2 Notebooks with ATI and a Desktop NVIDIA cards.  Changing something 
there 
would not help if an app is run on someone else's computer but that is good to 
know.

I am porting an app from Java for display to C++.
All of the apps that interact with it have are in C++.
http://www.nlneilson.com/nlnww.html

By the time I get the basics ported osgEarth may have the
--run-on-demand or similar option, maybe by default as I don't see a
need to "redraw" if there is no change in the image.

Running an .earth file with terrain and height it looks like when the levels 
(LOD) changes 
it can be optimized.  The NASA WWJ SDK does that well so I will see what can be 
done to port 
that and submit proposed changes.

Thank you!

Cheers,
Neil

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





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


Re: [osg-users] CPU usage

2011-02-20 Thread Jean-Sébastien Guay

Hi Neil,


After trying the examples using a pre-built 2.9.9 and the latest from the SVN 
built with VS10 the CPU usage is high.
On a dual core one is nearly max and the other core is minimal.


Apart from the run on demand functionality that others suggested, you 
should make sure vsync is enabled (i.e. that you're not rendering more 
than 60 times per second). On nvidia this is the default, but on ATI 
it's off by default so you'd want to turn it on either in your app or in 
the driver's control panel.


When vsync is on the swapbuffers will wait for vsync before swapping. 
This wait is a yield that will release the processor for other tasks to 
run, so it will reduce CPU usage.


However, note that I've seen some cases where the yield waiting for 
vsync was done with a "busy wait" in the video driver, which meant that 
it appeared as if it was using the CPU all that time, but in reality if 
your app needed to do some work during that time it would get CPU cycles 
as normal. So the "busy wait" just makes it look as if the CPU is busy, 
but that's just an appearance.


Hope this helps,

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


Re: [osg-users] Why Compiled OSG is slower than pre-compiled version?

2011-02-20 Thread GeeKer Wang
Yes, it's CXXFLAGS. I just misspelled it and did nothing wrong.
I configured it in ccmake and found those flags in gcc comandline.

Nothing changed anyway. I don't know what's the real reason for that.

On Sun, Feb 20, 2011 at 3:52 PM, Alberto Luaces  wrote:

> GeeKer Wang writes:
>
> > Unfortunately, after I have add the CXXFLAG, still the compiled version
> runs
> > "bin/osgviewer cow.osg" with fps<10,
> > while the RPM version fps>40.
> >
> > It seems even worse than before.
> >
> Did you make sure that cmake is using those flags during the build by
> adding VERBOSE=1 to the make call? I say because it's CXXFLAGS, not
> CXXFLAG.
>
> --
> Alberto
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



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