diff --git a/demos/gl/src/main/assets/bitmap_overlay_video_processor_fragment.glsl b/demos/gl/src/main/assets/bitmap_overlay_video_processor_fragment.glsl index e54d0c256d..17fec0601d 100644 --- a/demos/gl/src/main/assets/bitmap_overlay_video_processor_fragment.glsl +++ b/demos/gl/src/main/assets/bitmap_overlay_video_processor_fragment.glsl @@ -32,4 +32,3 @@ void main() { gl_FragColor = videoColor * (1.0 - overlayColor.a) + overlayColor * overlayColor.a; } - diff --git a/demos/gl/src/main/assets/bitmap_overlay_video_processor_vertex.glsl b/demos/gl/src/main/assets/bitmap_overlay_video_processor_vertex.glsl index e333d977b2..0c07c12a70 100644 --- a/demos/gl/src/main/assets/bitmap_overlay_video_processor_vertex.glsl +++ b/demos/gl/src/main/assets/bitmap_overlay_video_processor_vertex.glsl @@ -11,11 +11,10 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -attribute vec4 a_position; -attribute vec3 a_texcoord; +attribute vec2 a_position; +attribute vec2 a_texcoord; varying vec2 v_texcoord; void main() { - gl_Position = a_position; - v_texcoord = a_texcoord.xy; + gl_Position = vec4(a_position.x, a_position.y, 0, 1); + v_texcoord = a_texcoord; } - diff --git a/demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/BitmapOverlayVideoProcessor.java b/demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/BitmapOverlayVideoProcessor.java index 063b660751..89bea32581 100644 --- a/demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/BitmapOverlayVideoProcessor.java +++ b/demos/gl/src/main/java/com/google/android/exoplayer2/gldemo/BitmapOverlayVideoProcessor.java @@ -88,18 +88,9 @@ import javax.microedition.khronos.opengles.GL10; GlUtil.Uniform[] uniforms = GlUtil.getUniforms(program); for (GlUtil.Attribute attribute : attributes) { if (attribute.name.equals("a_position")) { - attribute.setBuffer( - new float[] { - -1.0f, -1.0f, 0.0f, 1.0f, 1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 1.0f, - 1.0f, 0.0f, 1.0f, - }, - 4); + attribute.setBuffer(new float[] {-1, -1, 1, -1, -1, 1, 1, 1}, 2); } else if (attribute.name.equals("a_texcoord")) { - attribute.setBuffer( - new float[] { - 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, - }, - 3); + attribute.setBuffer(new float[] {0, 1, 1, 1, 0, 0, 1, 0}, 2); } } this.attributes = attributes; diff --git a/demos/gl/src/main/res/layout/main_activity.xml b/demos/gl/src/main/res/layout/main_activity.xml index ec3868d6a8..4728dc2d49 100644 --- a/demos/gl/src/main/res/layout/main_activity.xml +++ b/demos/gl/src/main/res/layout/main_activity.xml @@ -27,4 +27,3 @@ app:surface_type="none"/> -