带透明通道的贴图:image.png

    1. glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
    1. void main()
    2. {
    3. vec4 texColor = texture(texture1, TexCoords);
    4. if(texColor.a < 0.1)
    5. discard;
    6. FragColor = texColor;
    7. }