syphon max alpha

Home Forums Syphon Syphon Implementations – User syphon max alpha

  • This topic has 10 replies, 2 voices, and was last updated 9 years ago by vade.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #4949
    hcgilje
    Participant

    I am wondering if maxmsp is interpreting the alpha values from syphon differently than other syphon environments?
    If I use the standard simple server as source, it looks the same in simple client, but in the jit.gl.syphonclient it looks much darker. Only by turning blendmode to 0 makes it look the same, but that just turns off the alpha channel so that is not ideal.
    This does not occur with syphon sources made in max, so sending syphon from max to vpt for instance works as expected with the alpha information intact.

    I had a user report the same alpha issue with sending syphon from his processing sketch to vpt. However for me, the included syphontest example works fine.

    #4950
    vade
    Keymaster

    Looks about the same here. One thing Simple Client is doing is using color sync automatically to match to the output device (thanks to Quartz Composer). Jitter is not. However, I don’t see it darker.

    Post a pic? I’ve never heard of this complaint before. Perhaps its specific to certain hardware?

    #4951
    hcgilje
    Participant

    Im on a 2010 macbook pro with nvidia graphics card.
    Here is a link to a pic:
    http://nervousvision.com/down/syphon_hc.png

    #4952
    vade
    Keymaster

    Hrm. I cannot re-create:

    View post on imgur.com

    I am on a 2010 MBP (MacBookPro6,2), NVidia GT 330M (512MB) running 10.7.2

    I am running in Max 6. Are you on 10.6.x, under Max 5 ? Mind giving us a little more to go on ? 😉

    Could be a color space issue with 10.6.x, Quartz Composer (which is what Simple Client and Server are using behind the scenes) does color management. Jitter, etc, does not. So there may be a slight difference, but it should not be as drastic as in your shot.

    #4953
    vade
    Keymaster

    Ah, I can re-create it if I disable another layer in Simple Servers QC comp. I see the issue. It has to do with how jitter clears the back-buffer.

    Jitter defaults to a erase color of 0, 0, 0, 1. If you clear with 0, 0, 0, 0, it looks correct. This has to do with the blend mode math, default being over, aka 6, 7.

    Since the erase color alpha component is 1, not 0, it looks different from every other app. Most applications do not do a clear the same way jitter does, as far as I can tell. (Erasing to 0, 0, 0, 0 does not leave artifacts like it does in Jitter in any other app).

    #4954
    hcgilje
    Participant

    I am still stuck in 10.6 and max 5, yes, I pride myself in not being an early adopter 🙂
    And it looks the same with either the geforce 9400 or 9600 graphic cards.

    If I clear it with 0,0,0,0 I get the typical jitter trail effect, so that wouldnt work very well on a moving source.

    So why does the syphon processing example look correct, is it because it has a white background?

    #4955
    vade
    Keymaster

    This is totally a Jitter specific issue. I’ve opened a Q/A on their forum. Stay tuned for a reply from Cycling. From now, this is near as I can tell, a Jitter specific issue. They are not clearing the same way as most other GL apps. Its not a “wrong” thing to do, but a choice (how the trails happen). Now, you could probably fiddle with the blend mode to get something appropriate, but not having GL_COLOR_BUFFER_BIT cleared when erase color is transparent black is going to cause compositing issues regardless.

    http://cycling74.com/forums/topic.php?id=36463&replies=2#post-176982

    #4956
    vade
    Keymaster

    Change your blend mode to 1 7. That should do it. Most apps use an “over” blend mode as default (the 1 7), but Jitter uses Mix, which is also fine. Its just a choice. Now because they don’t clear the color buffer when erase is 0, 0, 0, 0, you see issues you may not normally see.

    Blending to 1 7 should fix that.

    #4957
    hcgilje
    Participant

    blendmode 1 7 solves the issue when working with a single layer, but it breaks everything else when working with multiple layers, transparency and alpha masks, so I guess there is a slight incompatibility when combining syphon sources with alpha masks and jitter alpha.

    To illustrate, I made two layers. Bottom layer is just a solid red, top layer is set to 50% opacity with a circular alpha mask.

    #4958
    vade
    Keymaster

    Over blend mode (GL_ONE, GL_ONE_MINUS_SRC_ALPHA) should be able to composite that fine. If you are having jitter issues, its really nothing we can do about it. This problem has nothing to do with Syphon, but is an issue specific to Jitter. Post in the thread I linked to on the C74 forums.

    #4959
    vade
    Keymaster

    It totally works. You just have to account for alpha pre-multiplication. Lower the colors brightness as you drop opacity (multiply the rgb values by the a value). Works fine here in Jitter. Two video planes on top of one another, one offset with low alpha, from Syphon:

    View post on imgur.com

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.