[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Dirty rect overlapping optimizations
- To: "pygame-users@xxxxxxxx" <pygame-users@xxxxxxxx>
- Subject: [pygame] Dirty rect overlapping optimizations
- From: René Dudfield <renesd@xxxxxxxxx>
- Date: Sun, 26 Mar 2017 21:50:20 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Sun, 26 Mar 2017 15:50:24 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=fZ9RxwiltvK4z4jIQxzYt8/QxVVigMlQP7cVqqIf2Fg=; b=QfQ/MDFsV9lfudq/o7vqrrm8nZjbL7JmAn2g+Ig6rT4K+jc4g3v3blmiQxJ/1EFgiy pthSoZzcA2roQYjKc/pXwdod/D1qhW1J1vPlsupMbbHNRQ11XaVyuJehCJcz3M/bzfbz ubOUUmm2NadoD+LxdWQ/ArX7gIPGpYevgwhrQQ2By22K9owb61iYrxR1ViPNW5JXDlW2 YTB9RFeTxOPzr690Qi+lPoPeKqro8Kka1yKAc6RavT/dwS90gzG4Daw/p7nFucwvzWsl l/OhXK6roqa/zLe6bbBI706QcV5dHOhRQTAI/8XEIbFc+/PvarwRn6NrsLKPXEHoOrE/ U2RA==
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Because rectangles can overlap, it's possible to reduce the amount drawing done when using them for dirty rect updating. If there's two rectangles overlapping, then we don't need to over draw the overlapping area twice. Normally the dirty rect update algorithm used just makes a bigger rectangle which contains two of the smaller rectangles. But that's not optimal.
But, as with all over draw algorithms, can it be done fast enough to be worth it?
It's not an embarrassingly parallel problem... I think. But I haven't thought on it much at all. Maybe there is a use for multi core here.
Anyone done any other work like this? Or know of some good algos for this?