SNL: Mappers cannot share lookup tables and change opacity.
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
We ran into a very bizarre bug recently. We have an application that has several actors, and we want to be able to toggle the opacity if each one individually. We found that sometimes the opacity was usually not being restored to completely opaque correctly.
After much hunting, we discovered that it is because all the actors are sharing the same lookup table. What happens is that the mapper takes the opacity from the actor's property and then passes that to the alpha ivar of the lookup table. It also compares the property's opacity against the lookup table's alpha ivar to see if the colors need to be remapped.
Oops. If there are multiple actors, the lookup tables alpha ivar is not necessarily the same from the last time the render occurred. So if actor1 is opaque and actor2 just had its opacity changed from 0.5 to 1.0, then actor1 will set the lookup table's ivar to 1.0 and actor2 will assume that its opacity was always 1.0 and fail to update the colors.
The attached code demonstrates the bug.