[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] is there a way to optimize this code?

On Mon, Aug 17, 2009 at 1:42 PM, Hugo Arts <hugo.yoshi@xxxxxxxxx> wrote:
How about writing a fragment shader?
Well, vertex shaders and fragment shaders go together.  Sometimes a geometry shader can be added between them.  Together they're a "shader".  
I don't know whether this would
work or what performance would be like,
The performance would be amazing.  Basically, it would take two texture samples and move one into the other, if applicable.  So few operations would run in the hundreds of frames/second.  
In any case an FBO is probably fast enough
for whatever amount of particles you want to throw at it.
Well, a FBO is basically a screen--now you need something to draw on it ;-)
You can use the traditional pipeline, but what's wiser is to use the shader, because the instructions for doing this sort of thing are very specific. 

I might make a little example of this based on my upcoming shader library--a completely renovated edition of some of my earlier work--if anyone's interested.