I'm not sure how you're compositing your colors, but the function
you're using is not associative or commutative (I checked at lunch,
mmm), so I don't think you can reverse order.

It's:
 a + b = (b1 + a1 (1 - b2), a2)

Your function might need to be something like

 a + b = (b1*(1 - a2) + a1 (1 - b2), a2 b2), which is trivially commie
and assoc, but doesn't feel right.

Simply multiplying the alphas like this:
 a + b = (b1 + a1 (1 - b2), a2 b2)

might make it associative, plus it 'feels' more natural to multiply
the alphas.. but I'm not sure exactly from what model you derived your
blending function so I could be really wrong. However, the behaviour
of simply passing along the alpha of the first object seems
suspicious.

Anyways, hope you figure it out, really I'd derive a new function for
the top down approach unless it had to be within tolerance of the
results of you bottom up approach... then you'd have to analyze and
find out what are the cases where you can drop bottom layers without
losing end precision. Of course you can't drop the bottom (0,0),
because that's what gives you your final alpha, which will always be
0. But maybe intermediate layers can be removed given that you find
layers above them that are completely opaque. Then your optimization
conditions could be simply filtering out all elements beneath such a
layer.

Sorry if this contains errors, but I gotta get back to work grinding
the metals!
-max
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to