[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] raycasting engine performances (numpy array)
- To: pygame-users <pygame-users@xxxxxxxx>
- Subject: [pygame] raycasting engine performances (numpy array)
- From: Nathan Biagini <nathan.open@xxxxxxxxx>
- Date: Thu, 26 Apr 2012 14:49:39 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Thu, 26 Apr 2012 08:49:48 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=w2E7yYb3TxKWqpRYjzXnF8C3qECR3WzH2++ySOsP4hM=; b=alxTuRrCt7gBImLzNRUYwindNcJcsZ+gMO1UMvJDnz8zxlL92u7+V3K2dUIV8uBAyE V7wA+TGnirBKQngncO+LJuyyZlyMPOXMARQb/RVU2ZwdgklR3JULmxrl/hXzgqsfz6IF i/dQAPREtwvO5Hx1tfX7ejFw4t+RitC/Is+80prDCED0Fu/U8cJvg0KpPzKq3gP+Ujnw xMW+1KGvcRGkixcGeUtfUQNbiIbHLqPczKC0wk8AR2POqIVFjQsPcpLRF+NzuUV/yeR5 ZUde7iQbbuHSFck2s/mwOHkhZtbKo2aWDYHJxohWj/O9KX8YWbcnwlRn+5Q3RrRP3Rl2 hi8w==
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi.
I have recently started to write a ray casting engine with Pygame and i'm at the very early stage of the engine but i already have performance issues. I use the surfarray module to do all the drawing (actually, i only want to draw lines) but i have issues about performances. When i come closer to a wall (when the lines i draw become bigger), it starts to be a bit laggy. So i think it's all about the draw_verline function that just iters vertically in the array and set the pixels, i dunno if i can do more "optimized" as a drawing line function...
If i totally remove the surfarray implementation i go with simple surfaces and using the draw.line function, is super fluent and there is no lag even if the line are big. But i can't stuck with drawing line this way because it will cause problems when i will try to implement textured walls.
If anyone has an idea. Thanks in advance : )