Weird effects chaining filters in Composer

26 views
Skip to first unread message

Fraser

unread,
Oct 4, 2009, 6:47:14 PM10/4/09
to MathMap
I'm using Mathmap 1.3.5 on Ubuntu. I updated my mirror filter to allow
tinting the reflection. It's pasted at the bottom of this post. Used
as a standalone filter is behaves as expected, so the reflection takes
on the selected tint when the tint_alpha is increased above zero.

First weird effect: when I use it in Composer following, say,
geom_translate (but really any other filter), the tint disappears and
instead seems to be replaced by black. That is, cranking the
tint_alpha all the way turns the reflection completely black. Apart
from the colour problem, the reflection still works as expected.

Second weird effect: if I select geom_translate, then mirror and
connect them in Composer, it works as above. If I select mirror first,
then geom_translate but connect them the same way (that is, output of
geom_translate to input of mirror), then the resulting composer
expression contains only the geom_translate. It ignores the mirror
entirely.

Am I doing something wrong or have I found a bug?

Thanks!

---

filter mirror (image in,
float angle: 0-360 (0),
color tint_color,
float tint_alpha: 0-1 (0))
r_angle = deg2rad(angle);
if (r_angle < pi && a >= r_angle && a < r_angle + pi) ||
(r_angle >= pi && (a > r_angle || a <= r_angle-pi)) then
in(ra)
else
lerp(tint_alpha, in(ra:[r, 2*r_angle - a]), tint_color);
end
end

Mark Probst

unread,
Oct 5, 2009, 4:43:29 AM10/5/09
to mat...@googlegroups.com
On Mon, Oct 5, 2009 at 12:47 AM, Fraser <fraserm...@gmail.com> wrote:
> First weird effect: when I use it in Composer following, say,
> geom_translate (but really any other filter), the tint disappears and
> instead seems to be replaced by black. That is, cranking the
> tint_alpha all the way turns the reflection completely black. Apart
> from the colour problem, the reflection still works as expected.

Passing colors, gradients and curves to filters within a filter isn't
implemented in the compiler, yet, so you'll only get the default,
which is black in this case. I've neglected this for too long - I'll
put it on the to-do list for 1.3.6.

> Second weird effect: if I select geom_translate, then mirror and
> connect them in Composer, it works as above. If I select mirror first,
> then geom_translate but connect them the same way (that is, output of
> geom_translate to input of mirror), then the resulting composer
> expression contains only the geom_translate. It ignores the mirror
> entirely.

My best guess is that you didn't select the mirror node as the output.
The output node is the one with the thick border - you can make any
node the output by double-clicking it.

Mark

Fraser McCrossan

unread,
Oct 5, 2009, 9:13:40 AM10/5/09
to mat...@googlegroups.com
2009/10/5 Mark Probst <mark....@gmail.com>:

>
> On Mon, Oct 5, 2009 at 12:47 AM, Fraser <fraserm...@gmail.com> wrote:
>> First weird effect: when I use it in Composer following, say,
>> geom_translate (but really any other filter), the tint disappears and
>> instead seems to be replaced by black. That is, cranking the
>> tint_alpha all the way turns the reflection completely black. Apart
>> from the colour problem, the reflection still works as expected.
>
> Passing colors, gradients and curves to filters within a filter isn't
> implemented in the compiler, yet, so you'll only get the default,
> which is black in this case.  I've neglected this for too long - I'll
> put it on the to-do list for 1.3.6.

Thanks, that explanation makes sense. Glad it's not me. :-)

>
>> Second weird effect: if I select geom_translate, then mirror and
>> connect them in Composer, it works as above. If I select mirror first,
>> then geom_translate but connect them the same way (that is, output of
>> geom_translate to input of mirror), then the resulting composer
>> expression contains only the geom_translate. It ignores the mirror
>> entirely.
>
> My best guess is that you didn't select the mirror node as the output.
>  The output node is the one with the thick border - you can make any
> node the output by double-clicking it.

Again, thanks, that's exactly what was happening. Double-clicking
fixes it nicely! My mistake.

Reply all
Reply to author
Forward
0 new messages