Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Versioned shader doesn't work when setup from source #6235
I posted this on the forum, but I now think it's a bug, so I'm filing here.
If I load my #versioned 150 shaders from file, it works fine. If I setup from source via stringify or R", it compiles & links fine, but I see nothing. I dump the strings to the console to compare, and they look fine. I couldn't track down the issue. (Actually it seems to be displaying something, maybe it's related to the default uniforms like modelViewProjectionMatrix etc not being passed correctly or something?)
I did try:
This is openFrameworks 0.10.1 on ubuntu 18.04.1 with Qt Creator 4.6.2
when loading shaders from source in gl 3+ there's an extra step that needs to be done to bind the default attribute locations by calling
This is done so in case you don't want to use the default OF attribtues and uniforms for position, normal, color, matrices... you can set your own. when loading we do it by default but if you are using the more manual
This could be a parameter to
doh, I spend almost a day trying to debug a problem, turns out it was because the shader was setupFromSource :)
yes making this more transparent could help. an argument to
@memo sorry didn't saw your last message before. This is something that needs to happen before linking so it couldn't be an argument to bind.
I'll look into deprecating bindDefaults and add a second version of link without defaults or a parameter...
going to reopen this so i can keep track of the issue