-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mask does not appear in syphon feed. #32
Comments
Ensure both apps agree on premultiplied vs unpremultiplied alpha. No idea what Processing's mask option does but my guess is your alpha is not premultiplied in Processing. |
Ensure your target app and destination app both use premultiplied or unpremulitplied alpha. Syphon doesn't care what you use but you do have to agree.
…Sent from my iPhone
On Sep 22, 2017, at 6:07 AM, Jonathan Blair ***@***.***> wrote:
I have an alpha mask that I'm using on the canvas. It works fine in the processing image, but when viewing the syphon feed, I only see the base layer. The mask and anything after are not rendered.
import processing.video.*;
import codeanticode.syphon.*;
PGraphics canvas;
SyphonServer server;
PImage mask;
PImage lines;
PImage backdrop;
Movie background;
void setup() {
size(1920,1080, P3D);
canvas = createGraphics(1920, 1080, P3D);
mask = loadImage("alpha_mask.png");
backdrop = loadImage("white_backdrop.png");
background = new Movie(this, "finalimage_1.mov");
background.loop();
// Create syhpon server to send frames out.
server = new SyphonServer(this, "Processing Syphon");
}
void draw() {
canvas.beginDraw();
canvas.background(100);
//canvas.image(background, 420, 0);
//canvas.mask(mask);
canvas.image(backdrop, 0, 0);
canvas.endDraw();
image(canvas, 0, 0);
server.sendImage(canvas);
}
void movieEvent(Movie m) {
m.read();
}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I thought this sounded like it might be a real issue, but I can't get canvas.mask() to have any effect within Processing. If you can attach a minimal sketch folder with images to demonstrate the problem, I'll take a look. |
Revising very old issues, just for fun :-) In this case, what's happening is that the texture that's backing the rendering surface (either onscreen or offscreen) is not updated with the output from the filter (mask() in P2D/P3D internally calls filter()), for some reason (it should, so opened a bug about this in the main processing4 repo: processing/processing4#449). But, it gets full updated in the next frame, so one temporary workaround is to move the server.sendImage(canvas) call to the top of the draw() function. A shorter example demonstrating the workaround. Original code (filter output does not show up in the receiveFrames sketch)
Modified code (it works as expected):
Also worth noting that the issue affects both the filter() function that takes only predetermined filters and the one with the PShader argument. |
I have an alpha mask that I'm using on the canvas. It works fine in the processing image, but when viewing the syphon feed, I only see the base layer. The mask and anything after are not rendered.
Processing Window:
![screen shot 2017-09-22 at 12 07 44 am](https://user-images.githubusercontent.com/3649828/30728989-287e439a-9f2a-11e7-87d8-b8173190fa43.png)
MadMapper:
![screen shot 2017-09-22 at 12 07 55 am](https://user-images.githubusercontent.com/3649828/30728997-3464b75c-9f2a-11e7-8691-910e616dc69d.png)
The text was updated successfully, but these errors were encountered: