Hey all,
Running into an odd error when trying to set up a transform feedback particle system. I was running into issues where my vertex shader code simply wasn’t doing anything; after a little while of trying to debug, it seems like the issue might be in how I’m trying to load the transform feedback shader itself.
Not sure if it’s a bug or me just being dumb but as a simple test case
std::vector<std::string> feedbackVaryings({
"position",
"phi",
"theta",
"a",
"b"
});
gl::GlslProg::Format tfmt;
tfmt.vertex(app::loadAsset("simulation.glsl"));
tfmt.feedbackFormat(GL_SEPARATE_ATTRIBS);
tfmt.feedbackVaryings(feedbackVaryings);
gl::GlslProgRef shader = gl::GlslProg::create(tfmt);
lets imagine simulation.glsl looks like this
layout (location = 0) in vec3 iPosition;
layout (location = 1) in float iPhi;
layout (location = 2) in float iTheta;
out vec3 position;
out float phi;
out float theta;
void main(){
position = iPosition;
phi = iPhi;
theta = iTheta;
position = vec3(0.);
}
Since “a” and “b” aren’t declared as varyings in the simulation.glsl, compilation should fail correct? Believe it or not, this still compiles for me and I can launch my app regardless.
At first I thought it was something in my app setup but after trying things in a fresh project, I’m seeing the same result (╯°□°)╯︵ ┻━┻
Strangely enough, if I take out “b” from my varyings vector, I get a compilation error as expected.
any ideas? Maybe something I forgot to do?
Many thanks!