Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
aleksandrv
aleksandrv's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Mask Shader with Processing 2.0
[1 Reply]
04-Feb-2013 06:21 AM
Forum:
Programming Questions
Hello,
I am trying to implement alpha mask shader with PShader and keep getting an "shader() called with a wrong shader" error.
Here's the code.
PShader mask;
PImage imgTex;
PImage maskTex;
PImage destTex;
void setup()
{
size(displayWidth, displayHeight, P3D);
setupGL();
}
void draw()
{
drawGL();
}
void setupGL() {
imgTex = loadImage("bg.png");
maskTex = loadImage("mask.png");
mask = new PShader(this, "shaders/SimpleVS.glsl", "shaders/Mask.glsl");
}
void drawGL() {
imageMode(CORNER);
mask.set("mask_factor", 0.0);
mask.set("src_tex_unit0", imgTex);
mask.set("src_tex_unit1", maskTex);
shader(mask);
image(imgTex, 0, 0, width, height);
resetShader();
}
Can you please help?
You can find the whole sketch with shaders and data
here
.
«Prev
Next »
Moderate user : aleksandrv
Forum