Page 2 of 2

Posted: Thu Mar 03, 2005 1:50 pm
by Blade
Reducing the the texture sizes wouldn't help to improve the CPU usage ad it depends on the videocard...

Adding a delay(1) inside the main loop should relax the CPU enough without ruining the smoothness.

Posted: Thu Mar 03, 2005 5:56 pm
by Psychophanta
Guimauve wrote:I have tested my code on my computer. So I have little bit reduced the number of model from 10 to 5. Also I have reduced the texture size from 128 pixels X 128 pixels to 64 pixels X 64 pixels.

This I will probably help your computer to render the scene.
Anyway if you have a small configuration PC will have many problems with this code.
Guimauve, i have no problems. It runs smoothly. But your code "eats" 100% CPU time in any PC
It is inadmissible that a screensaver get all 100% CPU use :!: :!:
Blade wrote:Reducing the the texture sizes wouldn't help to improve the CPU usage ad it depends on the videocard...
No. That's not the problem. The problem is explained here: viewtopic.php?t=12747
And here: viewtopic.php?t=12825 is a quick solution.
Blade wrote:Adding a delay(1) inside the main loop should relax the CPU enough without ruining the smoothness.
Yes. It depends on how fast is the machine. On fast machines Delay(15) instead Delay(1) works nice :)

Posted: Thu Mar 03, 2005 7:00 pm
by Blade
Now I remember that thread... :D
My congrs Psychophanta, great solution.
Something like that should be included natively in PB (a flag in FlipBuffers() ?), so that anyone can easily make CPU free apps...[/u]

Posted: Thu Mar 03, 2005 7:17 pm
by Guimauve
:shock:

I can't understand why the Delay(10) can reduce CPU usage.

Anyways thanks for this small detail.

(Je retourne étudier ça)

Guimauve

Posted: Mon Mar 28, 2005 8:53 am
by dagcrack

Code: Select all

; Index = SpinByte(Index,1,10,1)
?
at least works...
But I was expecting more.

Posted: Mon Mar 28, 2005 2:06 pm
by Rescator
Be carefull if you go higher than 1500.
I tried 2500 and things got really jerky.
At 2000 not half bad. At 1500 it was pretty ok.

Do NOT try 10000 models. I did and Windows went nuts with my swap file *laughs* Some insane memory needs.

Btw! 1500 models * 60 polygons = 90000 polygons.
so it seems that my system don't like more than 100000 polygons at least with this test.

A houndred thousand polygons is quite a lot though.
Most 3D characters in games are only 5000 polygons.
Which in this test would equal 84 or so models.

Posted: Mon Mar 28, 2005 5:15 pm
by Guimauve
Just in case these command can be usefull to your project :

Code: Select all

ProcedureDLL.l SpinLong(No.l, mini.l, maxi.l, increment.l)
     
     No + increment
     
     If No > maxi
          No = mini
     EndIf
     
     If No < mini
          No = maxi
     EndIf
     
     ProcedureReturn No
     
EndProcedure


ProcedureDLL.f SpinFloat(No.f, mini.f, maxi.f, increment.f)
     
     No + increment
     
     If No > maxi
          No = mini
     EndIf
     
     If No < mini
          No = maxi
     EndIf
     
     ProcedureReturn No
     
EndProcedure

ProcedureDLL.b SpinByte(No.b, mini.b, maxi.b, increment.b)
     
     No + increment
     
     If No > maxi
          No = mini
     EndIf
     
     If No < mini
          No = maxi
     EndIf
     
     ProcedureReturn No
     
EndProcedure


ProcedureDLL.w SpinWord(No.w, mini.w, maxi.w, increment.w)
     
     No + increment
     
     If No > maxi
          No = mini
     EndIf
     
     If No < mini
          No = maxi
     EndIf
     
     ProcedureReturn No
     
EndProcedure
Sorry for any inconvenients.

Regards

Guimauve