increasing Frames Per Second

17 views
Skip to first unread message

Gemayel Lira

unread,
Sep 21, 2011, 10:37:02 AM9/21/11
to PYGGEL-dev
hello everyone am new to the list, it is a pleasure.
desenpenho'm trying to improve my program, because I have a few
objects in the scene and has no reason to be with the average of
15FPS, I want to achieve 30FPS or more,
here is some information that can help http://postimage.org/image/2y8j3x8sk/full/
I generated using http://code.google.com/p/jrfonseca/wiki/Gprof2Dot
any help is welcome.
I believe I improve glReadPixels, a small demonstration of the
environment I'm creating http://dl.dropbox.com/u/41834317/demonstracao_monitoramento.swf
watching the video you may have an idea that code is small with few
objects in the scene and I should not have problems with slow

Robert Ramsay

unread,
Sep 21, 2011, 12:28:59 PM9/21/11
to PYGGEL-dev
Hi Gemayel Lira,

That graph certainly shows glReadPixels as taking a large portion of
time. Looking at the code (http://code.google.com/p/pyggel/source/
browse/trunk/pyggel/scene.py) it shows that glReadPixels is called to
determine if the current mouse position is on a "pickable" object and
sorting the objects by depth. This could certainly be optimized.
Especially in your case, because it appears that you aren't really
using 3D all of your objects sit along one plane. If you think you can
code a patch and submit it that would be great. Otherwise I'm not sure
how soon our busy developers can get to it. I'm sure RB will chime in
soon.

Thanks,
Robert

On Sep 21, 10:37 am, Gemayel Lira <gemayell...@gmail.com> wrote:
> hello everyone am new to the list, it is a pleasure.
> desenpenho'm trying to improve my program, because I have a few
> objects in the scene and has no reason to be with the average of
> 15FPS, I want to achieve 30FPS or more,
> here is some information that can helphttp://postimage.org/image/2y8j3x8sk/full/
> I generated usinghttp://code.google.com/p/jrfonseca/wiki/Gprof2Dot
> any help is welcome.
> I believe I improve glReadPixels, a small demonstration of the
> environment I'm creatinghttp://dl.dropbox.com/u/41834317/demonstracao_monitoramento.swf

RB[0]

unread,
Sep 21, 2011, 12:42:31 PM9/21/11
to pygge...@googlegroups.com
Indeed - I saw this and moderated so it showed up - just didn't have the chance to look at it closely yet :S

I'm trying to recall which system for picking i finally settled on - but I believe what it does is just grab a single pixel (where the mouse is) for each object rendered to figure out which one was last rendered - which had a lot of advantages (including speed) over other methods I tried - short of going geometric which is much more work to implement.
However, it has to be used correctly - and I wonder if on some systems if glReadPixels is a lot slower than what my computer handles.

As Robert said, however, you should always be careful when using picking - if you aren't even using it you should disable it.
So, for your scene:
scene.pick = False
Otherwise, might be a good idea to separate out what objects you want to be picking at any given time, and try to limit it as much as possible...

Hope that helps a bit - can look more later perhaps if needed :)

--
You received this message because you are subscribed to the Google Groups "PYGGEL-dev" group.
To post to this group, send email to pygge...@googlegroups.com.
To unsubscribe from this group, send email to pyggel-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyggel-dev?hl=en.


Ian Mallett

unread,
Sep 21, 2011, 1:22:06 PM9/21/11
to pygge...@googlegroups.com
On Wed, Sep 21, 2011 at 10:42 AM, RB[0] <roe...@gmail.com> wrote:
Indeed - I saw this and moderated so it showed up - just didn't have the chance to look at it closely yet :S

I'm trying to recall which system for picking i finally settled on - but I believe what it does is just grab a single pixel (where the mouse is) for each object rendered to figure out which one was last rendered - which had a lot of advantages (including speed) over other methods I tried - short of going geometric which is much more work to implement.
I was going to ask whether it was grabbing the whole frame, but it appears that you're grabbing just the one pixel (which is good).  Data readback from the GPU is notoriously annoying to get right.  I'm not an expert on PYGGEL, so I'll just suggest that you try to do as little data in/out on the GPU as possible.

RB[0]

unread,
Sep 21, 2011, 1:24:30 PM9/21/11
to pygge...@googlegroups.com
Yep - exactly :S
But is indeed a cool tool it looks like - never seen that before...

--

Gemayel Lira

unread,
Sep 21, 2011, 1:32:58 PM9/21/11
to PYGGEL-dev
is true and I have disabled scene.pick speed gain was satisfactory,
when I go to select some object I turn on the pick
Reply all
Reply to author
Forward
0 new messages