realbasic-games
[Top] [All Lists]

Re: trimesh particles demo, version 2

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: trimesh particles demo, version 2
From: Frank Condello <developer at chaoticbox dot com>
Date: Fri, 6 Oct 2006 02:15:22 -0400
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <33cbfa100610051952g4c29b16ep1b8b520e7d03d8c1 at mail dot gmail dot com> <C2B2A078-BF02-405D-855F-7AF91314D9D7 at mindspring dot com>
On 6-Oct-06, at 1:14 AM, Jeff Quan wrote:

On Oct 5, 2006, at 7:52 PM, Lars Jensen wrote:
Question: would it substantially improve performance if each particle
were only one triangle instead of two?

(I'm not sure how UVs work yet so I didn't try this myself.)

While it's true that one triangle is faster to update than two, if you did just use triangles, then in order to fit an image onto that triangle, the triangle would have to be VERY large. Having large triangles that are mostly transparent will present you with another performance bottleneck -- the drawing of transparent objects in front of others. Plus it'd be a bear to try and center the image in a single triangle as it's spinning.

An example: in my earlier tests with the trimesh particles, I could launch about three times as many if the particles were opaque (ie: non-alpha masked) over transparent. More concretely, I have a test where I had 2400 opaque particles on-screen with nary a hiccup in performance.

In Quesa's case fewer larger triangles would probably be better. Quesa does a per-triangle sort for transparent objects and renders using slow immediate mode vertex calls, so fewer triangles is almost always faster. Big, but mostly 100% transparent triangles can also be sped up significantly using early fragment rejection (alpha test) in combination with blending, but I can't recall if it's possible to trick Quesa into using this technique (would likely be a simple hack in the C code however).

The real kicker is that sorting isn't actually needed for scenes like this since additive blends look the same regardless of drawing order. Unfortunately Quesa doesn't have a means to control when and how transparent objects are drawn.

Frank.
<http://developer.chaoticbox.com/>
<http://macgameblog.com/>


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>