scriptorum
![]() |
I'm having trouble getting the IF component to produce expected results when colors are involved. Specifically, colors other than the THEN and other than the ELSE are showing up in the result.
The attached example shows some color bands fed into SOURCE A and the color purple (1, 0, 1, 1) fed into SOURCE B. It successfully turns the purple area into the grey specified by THEN, however, the non-purples are turned into a strange mix of SOURCE A, THEN and ELSE rather than just the ELSE color. If you alter the gradient to use only grey colors and change SOURCE B to a matching grey, the IF works as expected -- for the most part. However, even in this case, the alpha on the ELSE will be ignored, and the alpha on the THEN will affect the alpha of the whole output, not just the matching color. ![]() |
|||
Posted: August 18, 2010 10:56 pm | ||||
Sphinx.
![]() |
Initially I also thought that was a bug, but actually..
.. help |
|||
Posted: August 19, 2010 12:51 am | ||||
scriptorum
![]() |
Ah, thanks for the clarification. Although I can see some uses for the IF component as it is implemented, I think one that worked the way we both expected would be more useful. It would be nice if there was a checkbox to allow us to use either behavior. This seems like an easy Map Script to whip up.
|
|||
Posted: August 19, 2010 9:13 am | ||||
scriptorum
![]() |
Here is a map script performing the per-pixel behavior I was expecting from the RGB Math: IF component. If SOURCE A and SOURCE B have the same color pixel, it outputs THEN otherwise it outputs ELSE. It does this on the whole pixel color, not per-channel. Alpha channels are implemented. It only supports an A = B operation, but that is easily modifiable in the code.
Per-Color IF Component.ffxml |
|||
Posted: August 19, 2010 5:17 pm |
Filter Forge has a thriving, vibrant, knowledgeable user community. Feel free to join us and have fun!
33,713 Registered Users
+19 new in 30 days!
153,537 Posts
+6 new in 7 days!
15,348 Topics
+72 new in year!
27 unregistered users.