Draw a 2D Image using OpenGL ES 2.0

前端 未结 5 1580
盖世英雄少女心
盖世英雄少女心 2021-01-31 09:57

I\'ve been struggling to draw a 2D image from jpg/png files using openGL ES 2.0 for Android. Everywhere I look the tutorials are for texturing 3D images so its been rough figuri

5条回答
  •  南旧
    南旧 (楼主)
    2021-01-31 10:23

    There is a mistake with variable vColor naming (or using) in fragmentShaderCode. Here your variable has name vColor:

    uniform vec4 vColor;
    

    and in this line it has name v_Color

    gl_FragColor = (v_Color * texture2D(u_Texture, v_TexCoordinate));
    

提交回复
热议问题