use_pygame=True
I added it, but then got a problem starting the example
$ python Particles.py
Traceback (most recent call last):
File "Particles.py", line 52, in <module>
display = pi3d.Display.create(background=(0.1, 0.1, 0.1, 1.0), frames_per_second=FPS, use_pygame=use_pygame)
File "/mnt/data/home/stu/projects/external/pi3d/pi3d/Display.py", line 546, in create
display.opengl.create_display(x, y, w, h, depth=depth, samples=samples, layer=layer, display_config=display_config)
File "/mnt/data/home/stu/projects/external/pi3d/pi3d/util/DisplayOpenGL.py", line 80, in create_display
self.create_surface(x, y, w, h, layer)
File "/mnt/data/home/stu/projects/external/pi3d/pi3d/util/DisplayOpenGL.py", line 191, in create_surface
assert r
AssertionError
3d stu beez
p = pi3d.PexParticles('pex/fire.pex', camera=cam2D, z=500, emission_rate=40)
...
p.draw()
p.update()
...
if k == ord('w'):
p.sourcePosition['y'] += 10.0.
n = 0
while display.loop_running():
n += 1
back.draw()
text.draw()
for p in particles:
p.draw()
if n % 2 == 0:
p.update()The new version does not seem to provide better performance in my case. I was at 8ms and with the new 8ms too.
Strangely, when I try your method to update less frequently I see no noticeable difference also.
But, when I try your method with the new version : 3/4ms ! Huge improvement :-)
https://photos.app.goo.gl/UGrfjhqDmiawF7z23
I need to go deeper in my investigations....
Thanks for the help Paddy, that's really good !
that should have been 'update every second frame' and 'just the call to PexParticles.update() less frequently'. Put batching argument and pushed to develop (not a massive improvement but measurable)
--
You received this message because you are subscribed to a topic in the Google Groups "pi3d" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pi3d/dCQGk-2H62I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pi3d+uns...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
There is something strange. Without changing a line of code, sometime I got good performance and sometime not. With 20 particles I can have 10ms, and on the other end with 120 I can have 3/4 ms like here : https://photos.app.goo.gl/GbFEFqwaPVRuU7yE3
Waiting a long time between tests seems to help, but it's not really reliable. Problem with the GPU ?
import pi3d
p = pi3d.PexParticlesLite(...) # wont work yet, you have to do
from pi3d.util.PexParticlesLite import PexParticlesLite
p = PexParticlesLite(...)--
I find the solid version even prettier :-)
Sadly the performances are fluctuating. See here : https://photos.app.goo.gl/1i95fio4jjOLmIyi1
Without particles, it runs 6.50ms +-30. At the beginning the pexparticles is really quick at updating consuming less than a ms. But after.. it sometime doubles. I'm only updating x,y and gravity x,y.
--