Author Topic: Running multiple instances of program slow?  (Read 1844 times)

Offline Disastorm

  • long
  • ***
  • Posts: 161
    • View Profile
Running multiple instances of program slow?
« on: March 28, 2012, 12:30:27 pm »
Hello, whenever I run multiple instances of my program it runs insanely slow like less than 1fps.  When running a single instance its perfectly fine.  Do you know why this might happen?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Running multiple instances of program slow?
« Reply #1 on: March 28, 2012, 12:49:20 pm »
Which hardware, OS, drivers, memory size etc...

Offline Disastorm

  • long
  • ***
  • Posts: 161
    • View Profile
Re: Running multiple instances of program slow?
« Reply #2 on: March 28, 2012, 07:46:13 pm »
I have windows 7 64-bit, 8GB RAM, AMD Phenom II X6 1055T, Radeon HD 5870.  I have most recent drivers for my radeon but I remember that jpct always did this for me, except it used to be a little faster but still super slow, but recently its like less than 1 fps with 2 instances of my program open.
« Last Edit: March 28, 2012, 07:48:51 pm by Disastorm »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Running multiple instances of program slow?
« Reply #3 on: March 28, 2012, 09:04:28 pm »
The engine is not responsible for this. Each instance lives in it's own VM and has no direct influence on any other instance. I'm also using Windows 7 64bit and a Radeon HD 5870 with the latest drivers and i can run four instances of the fps-example at a time and they all run @ around 2000fps. I've no idea what's wrong with your setup!?
« Last Edit: March 29, 2012, 08:40:48 am by EgonOlsen »

Offline Disastorm

  • long
  • ***
  • Posts: 161
    • View Profile
Re: Running multiple instances of program slow?
« Reply #4 on: March 29, 2012, 06:56:53 am »
Well is it possible that it has something to do with one of the configuration options in JPCT.  Perhaps if I enable or disable something it will fix this? I'll post my actual program up here soon so you can see if you experience the same issue with it. Also Ill check out the Fps example and see how many I can run.

Offline Disastorm

  • long
  • ***
  • Posts: 161
    • View Profile
Re: Running multiple instances of program slow?
« Reply #5 on: March 29, 2012, 09:49:58 am »
It looks like its the Shadow Helper. If I lower the maxSize the lag decreases (with multiple instances).  Without the ShadowHelper the speed only decreases a little bit.

Here is a link to a rar with both the version with shadowhelper(using 8192 maxValue) and version without.  They both suffer speed decrease with multiple instances, but one is more severe than the other.  Just run Project3D.jar .


http://disastorm.com/files/ProjectBuilds.rar

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Running multiple instances of program slow?
« Reply #6 on: March 29, 2012, 11:13:44 am »
No wonder....8192 * 8192 is...insane. You are simply running out offen video memory. A shadow map of that size requires half a gig of video memory. Two instances...and you have filled your video memory with that data alone. Reduce that size and it will run much better.

Offline Disastorm

  • long
  • ***
  • Posts: 161
    • View Profile
Re: Running multiple instances of program slow?
« Reply #7 on: March 29, 2012, 11:49:58 am »
is shadow map not intended to be used for big areas or games, because even at like 2048 it looks a bit pixellated?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Running multiple instances of program slow?
« Reply #8 on: March 29, 2012, 08:52:54 pm »
Then try 4096 instead. When using basic shadow mapping, you'll always have a slightly pixelated look depending on the distance and the fov of the light source.

Offline Disastorm

  • long
  • ***
  • Posts: 161
    • View Profile
Re: Running multiple instances of program slow?
« Reply #9 on: April 01, 2012, 04:56:57 am »
Ok thanks.  I'm just trying to figure out exactly how shadow map should or can be used.  If I wanted each character to have a shadow for example, would it be best to have one projector source or is it possible to actually have a projector on top of each character and then have the shadowmap switch to each one and render them all in the main loop? Can you use multiple projectors or shadowHelpers?  Or is the best thing to do to have a single shadowHelper that follows relative to the camera.
« Last Edit: April 01, 2012, 10:11:57 am by Disastorm »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11748
    • View Profile
    • http://www.jpct.net
Re: Running multiple instances of program slow?
« Reply #10 on: April 01, 2012, 09:25:28 pm »
Multiple shadow helpes won't work. Just use one and make it follow the camera.