1
Graphics / Re: binding vertex array with both texture and shaders
« on: August 15, 2023, 09:09:12 pm »The fragment shader determines the final colour for the pixel.
If it doesn't know about the texture, the texture cannot be included.
You need to pass the texture to the shader and then use the texture colour (for that fragment) and combine it with your fragment colour.
Also note that OpenGL use an opposite y direction from SFML (OpenGL fragments have 0,0 at bottom-left and SFML has 0,0 at top-left - by default) so you need to invert the y co-ordinate; this is why the radial gradient shader requires the window height.
and how do I pass the texture to the shader? to which one I should pass it to, the vertex or the fragment?