1
Graphics / Re: Why is my scene getting rendered in the top-right corner, multiple times?
« on: June 07, 2019, 08:27:09 pm »
Figured it out.
OpenGL shaders compiled the shaders differently and assigned different locations.
My post-fx shaders have these attributes;
And the locations on my computer after the shader compiled is:
pos = 0
tex = 1
And on his computer, these two were flipped.
tex = 0
pos = 1
Which results in that weird double in top corner pattern.
I was using (layout = 0) before, but when I downgraded all my shaders to OpenGL 3.2 I forgot to make a system to make sure the locations were correct for attributes. Fuck me.
But very interesting.
OpenGL shaders compiled the shaders differently and assigned different locations.
My post-fx shaders have these attributes;
// some_post_fx.glsl
#version 150
in vec2 inputPosition; // 0
in vec2 inputTexCoords; // 1
int main() {
//
}
#version 150
in vec2 inputPosition; // 0
in vec2 inputTexCoords; // 1
int main() {
//
}
And the locations on my computer after the shader compiled is:
pos = 0
tex = 1
And on his computer, these two were flipped.
tex = 0
pos = 1
Which results in that weird double in top corner pattern.
I was using (layout = 0) before, but when I downgraded all my shaders to OpenGL 3.2 I forgot to make a system to make sure the locations were correct for attributes. Fuck me.
But very interesting.