ronron
17-11-2008 13:21:01
Hi all
I'm french and new to ogre, so I'm sorry for all dumb things that I could say !
So,
I have a problem with the cg script "Example_BumpMapping.cg" when I use it with NxOgre.
When i let this code like this :
NxWorld = new NxOgre::World("FrameListener: Yes, log: none");
I fall down to 6 FPS when the mesh with the material using "Example_BumpMapping.cg" is rendered. ( I try various World's options, nothing help. )
But when I comment it :
//NxWorld = new NxOgre::World("FrameListener: Yes, log: none");
Everything goes back to normal. ( 500 fps when rendering the mesh )
This is the only line of NxOgre code in my program.
( I try to find answers on Google and on this forum, but nothing. )
If it is a NxOgre issue, how can I fix this ? Or it is a know bug from PHYSX ?
betajaen
17-11-2008 14:51:19
PhysX/NxOgre have nothing to do with CG/Shaders, and I haven't seen an issue or a problem like yours before.
Caphalor
17-11-2008 15:48:53
Hmm strange. And there is no fps slowdown if you create the NxOgre world but do not use the shader?
Do you run PhysX in software mode? Or do you have a newer NVidia graphics card?
@betajaen: Yes that's also my idea beacause cuda is, like the shader, computed on the gpu. But I also never heard about a problem like it before.
betajaen
17-11-2008 16:22:00
Or do you have a newer NVidia graphics card?
Perhaps it could be CUDA. But again; I've never heard of a problem like it before.
ronron
17-11-2008 18:14:30
When I put another texture on my mesh with NxOgre ( without bump mapping, just flat texture ), no fps slowdown.
I run PHYSX in software mode, i have a geforce 8800 GTS 320 Mb.
It's definitly a "PhysX/NxOgre problem" because if I remove NxOgre header file or if I change the texture material, all work fine again.
I hope make a mistake because if it isn't, I will have no solutions :/
betajaen
17-11-2008 18:35:33
Most likely it's a PhysX problem. Probably something to do with CUDA. NxOgre doesn't touch shaders and it barely touches Ogre.
Have you you tried upgrading the Nvidia drivers and PhysX software?
ronron
17-11-2008 18:53:14
I just make the upgrade. My drivers was the 178.24 and I upgrade to the 178.28.
Same problem. But i find what was the problem! My normal map was too huge ! I resize it and everything is OK.
I think the PHYSX use too much CPU time for this big normal map when enabled.
I have no CUDA processor, i hope is can help someone else
Thanks BetaJaen for help and NxOgre, and thx Caphalor too
Caphalor
17-11-2008 19:27:17
As far as I know the Geforce 8 series is able to run Cuda/GPU PhysX.

Good to hear that you solved your problem.
nargil
17-11-2008 19:36:07
I think the PHYSX use too much CPU time for this big normal map when enabled.
PhysX doesn't use a normal map. Neither does the CPU the computing of a normal map.
ronron
17-11-2008 23:49:07
As far as I know the Geforce 8 series is able to run Cuda/GPU PhysX. Wink
Good to hear that you solved your problem.
I must believe that is wrong, i download the latest driver, et the CUDE toolkit + SDK, and when I run an example of CUDA 1.0 ( and + ), the app show this error message :
VideoCodec: MPEG 2
Frame rate: 30000/1001fps ~ 29.97fps
Sequence format: Progressive
Coded frame size: [1280, 720]
Display area: [0, 0, 1280, 720]
Chroma format: 4:2:0
Bitrate: 14116kBit/s
Aspect ratio: 16:9
cudaVideoDecode:
<GeForce 8800 GTS> CUDA 1.0 device 0 detected
This device not CUDA 1.1 capable, exiting
Test PASSED
Press ENTER to exit...
Maybe I don't understand the message, I am not really good in english

But i think i have "0 device detected" for CUDA.
I have the first generation of GeForce8's series, maybe that's the only one reason.
--------
Right for the fact that bump mapping is not a CPU task, it's CG programming :/ I'am dumb
So I don't understand why there is a conflict with CG scripts and PHYSX with a huge sized normal map.
-------
2nd Question :
Why my callback don't work ?
using namespace NxOgre;
class MyCallBack : public NxOgre::GroupCallback::InheritedCallback
{
public:
void onStartTouch( NxOgre::Actor* Actor1 , NxOgre::Actor* Actor2 /*, NxOgre::ContactStream* Stream*/ )
{
LogManager::getSingleton().logMessage( "-= Entered onStartTouch Callback! =-" );
}
void onEndTouch( NxOgre::Actor* Actor1 , NxOgre::Actor* Actor2 /*, NxOgre::ContactStream* Stream*/)
{
LogManager::getSingleton().logMessage( "-= Entered onEndTouch Callback! =-" );
}
void onTouch( NxOgre::Actor* Actor1 , NxOgre::Actor* Actor2 /*,NxOgre::ContactStream* Stream*/ )
{
LogManager::getSingleton().logMessage( "-= Entered onTouch Callback! =-" );
}
};
.....
Class foo{
public:
NxOgre::ActorGroup * MainPlayer;
NxOgre::ActorGroup * MapObjects;
void Init( )
{
MainPlayer = NxScene->createActorGroup( "MainPlayer" );
MapObjects = NxScene->createActorGroup( "MapObjects" );
}
void foofunc( )
{
MyCallBack * Joueur_VS_Map = new MyCallBack();
MainPlayer->setCallback(Joueur_VS_Map);
MainPlayer->setCollisionCallback( NxScene->getActorGroup("MapObjects"), NX_NOTIFY_ALL, true);
MainPlayer->setCallback<MyCallBack>(Joueur_VS_Map, &MyCallBack::onStartTouch, &MyCallBack::onEndTouch, &MyCallBack::onTouch );
}
}
I have this error msg :
nxogre\include\NxOgreGroup.h(173) : error C2661: 'NxOgre::GroupCallback::GroupCallback'Â : overloaded function does not requires 5 arguments
Humm, guess what ? Empty log. ( Yes, i collide 2 mesh of opposite groups

)
ronron
18-11-2008 03:10:14
Solved, I don't know why but I must make my declaration function like this :
virtual void onStartTouch( NxOgre::Actor* Actor1 , NxOgre::Actor* Actor2 /*, NxOgre::ContactStream* Stream*/ )
{
LogManager::getSingleton().logMessage( "-= Entered onStartTouch Callback! =-" );
}
virtual void onEndTouch( NxOgre::Actor* Actor1 , NxOgre::Actor* Actor2 /*, NxOgre::ContactStream* Stream*/)
{
LogManager::getSingleton().logMessage( "-= Entered onEndTouch Callback! =-" );
}
virtual void onTouch( NxOgre::Actor* Actor1 , NxOgre::Actor* Actor2 /*,NxOgre::ContactStream* Stream*/ )
{
LogManager::getSingleton().logMessage( "-= Entered onTouch Callback! =-" );
}
I see that with the "NxOgreGroup.h" header file.

I hope that will help newbies like me.
mcaden
18-11-2008 05:17:30
I had a major slowdown issue from like 200fps to 11fps. Turned out it was texture thrashing...have you compressed your textures as dds? DXT1 compression? (DXT3 or DXT5 if you're using alpha)
ronron
18-11-2008 05:32:14
Textures are not yet compressed, I think that's was the resolution in DPI, since i'm in 72 DPI with a reasonnable size, everything is ok.
A little detail to care of.
mcaden
18-11-2008 06:34:12
even at 72 DPI textures can eat up memory quickly.
even a 38k png file can end up taking up 4 meg of video memory depending on how big the image actually is.
ronron
18-11-2008 06:49:52
Talking about numbers
My buggy huge normal map : 4000 x 2000 - 92 DPI - JPG - 8000Ko @ 6 FPS
My actual normal map : 2500 x 1250 - 72 DPI - JPG - 955Ko @ 500 FPS
mcaden
18-11-2008 07:28:34
Talking about numbers
My buggy huge normal map : 4000 x 2000 - 92 DPI - JPG - 8000Ko @ 6 FPS
My actual normal map : 2500 x 1250 - 72 DPI - JPG - 955Ko @ 500 FPS
2500 * 1250 * 24 bits per pixel = over 9 meg video memory
video memory != disk memory
jpg is compressed on disk but is completely uncompressed in video memory
use the directX texture editor and it'll probably take that down to about 2-4 meg and is loaded into video memory as-is.
You're probably texture-thrashing and physx is using your GPU a bit so the swapping takes forever to do.
Compress your textures to dds with DXT1 compression (DXT 3 or 5 if you're using alpha) and I bet that'll fix your FPS issue. I fell into the same problem myself a couple months ago. Now I'm using NxOgre and I've got twice as many textures and I'm still running at a great FPS rate.
ronron
18-11-2008 17:32:13
Thanks for the tips
I'll try it soon, for now I play with PHYSX :p