Most appropriate sub-area of p5.js?
p5.js version
2.2.3
Web browser and version
chrome
Operating system
mac
Steps to reproduce this
Steps:
- run https://editor.p5js.org/neill0/sketches/dfBPlTGnb
- observe error:
"An error occurred compiling the fragment shader: ERROR: 0:321: 'HOOK_getFinalColor' : Function does not return a value"
The generated glsl is:
vec4 HOOK_getFinalColor(vec4 color) {
}
Snippet:
set a 4-element array with setUniform
myShader = buildMaterialShader(prepShader);
shader(myShader);
myShader.setUniform("c", [1, 0, 0, 1]);
then in the shader setup, trying to pass it straight to .set() doesn't work
let c = uniformVec4("c");
finalColor.begin();
finalColor.set(c);
finalColor.end();
}
...but this would work:
let c = uniformVec4("c");
finalColor.begin();
finalColor.set(c.xyzw);
//or
// finalColor.set([c.x, c.y, c.z, c.w]);
finalColor.end();
}
(We get the same for filterShader's filterColor.set())
I'm just reporting. I don't think I can work on this.
Most appropriate sub-area of p5.js?
p5.js version
2.2.3
Web browser and version
chrome
Operating system
mac
Steps to reproduce this
Steps:
"An error occurred compiling the fragment shader: ERROR: 0:321: 'HOOK_getFinalColor' : Function does not return a value"
The generated glsl is:
Snippet:
set a 4-element array with setUniform
then in the shader setup, trying to pass it straight to .set() doesn't work
...but this would work:
(We get the same for filterShader's
filterColor.set())I'm just reporting. I don't think I can work on this.