I have a texture in a game that clamps to the edge instead of linearly scaling up. These are the parameters I'm providing OpenGL with:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EGDE);
How should I change them in order to make the texture scale up?
These are the vertices I'm giving OpenGL:
typedef struct{
float positionX;
float positionY;
float textureX ;
float textureY ;
} textureVertex;
textureVertex vertices[4] = {
{-3.5f, 3.5f, -1.0f, 1.0f},
{-3.5f, -3.5f, -1.0f, -1.0f},
{ 3.5f, -3.5f, 1.0f, -1.0f},
{ 3.5f, 3.5f, 1.0f, 1.0f}
};
question from:
https://stackoverflow.com/questions/65883483/opengl-make-texture-scale-up-and-not-clamp 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…