I have a few questions about shaders and there use with a 2d game.
If I have a basic basic basic sprite batcher.
I mean it only uses vertex arrays and texture coord arrays, data in the array is used by calling glDrawArrays based on GL_QUADS,
and the draw function loads the vertex position and texture coords into the array.
drawGame function
//Clear the GL_COLOR_BUFFER_BIT and set up for the use of vertex and texture coord arrays
batcher.begin();
//Place a sprites data into the vertex and texture coord array
// By passing in : x position, y position, sprite Width, sprite Height, and the texture coords
batcher.draw(10, 10, 64, 64, 0, 0, 1, 0, 1, 1, 0, 1);
//call the render function which holds the glDrawArrays call then disable the use of vertex and texture coord arrays
batcher.end()
What is the benefit of using a shader program or is there even any benefit if I’m only using 2D?
And honestly
What is exactly is a shader program?
What is its purpose?
Why should I care to use them?
What can I even do with it I I am to implement one?
Thanks! Also please thorough explanations would be great as I’m new to openGL / graphics programming and have no idea what any of this is