opengl-es-2.0

Editing frames and encoding with MediaCodec

白昼怎懂夜的黑 提交于 2019-12-12 19:37:34
问题 I was able to decode an mp4 video. If I configure the decoder using a Surface I can see the video on screen. Now, I want to edit the frame (adding a yellow line or even better overlapping a tiny image) and encode the video as a new video. It is not necessary to show the video and I don't care now about the performance.(If I show the frames while editing I could have a gap if the editing function takes a lot of time), So, What do you recommend to me, configure the decoder with a GlSurface

glFenceSync alternative in OpenGL ES 2.0

懵懂的女人 提交于 2019-12-12 18:54:07
问题 I see that glFenceSync does not exist in OpenGL ES 2.0, it was added only in OpenGL ES 3.0. Does OpenGL ES 2.0 offer any alternative of syncing between CPU and GPU, aside from the brutal force glFinish ? 回答1: In glext.h . GL_API GLsync glFenceSyncAPPLE(GLenum condition, GLbitfield flags) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); I am pretty sure this is what you want. Anyway available only on iOS 6.0 or later. 回答2: You have different calls in OpenGL ES 2.0 that give some insight into

iOS Simulator GL_OES_standard_derivatives

北城以北 提交于 2019-12-12 18:31:36
问题 On iOS4 GL_OES_standard_derivatives is only supported on the device (from what I see when I output the extensions), is there a way to be able to: Detect in the fragment shader if the extension is supported or not If not supported, does anyone have a the code for the dFdx and dFdy? Can't seems that find anything on google. TIA! 回答1: I had the same issue for antialiasing SDM fonts. You can calculate a similar dfdx/dfdx by Translating 2 2d vectors using the current transform matrix : vec2 p1(0,0

A Depth buffer with two different projection matrices

久未见 提交于 2019-12-12 18:13:48
问题 I am using the default OpenGL values like glDepthRangef(0.0,1.0);, gldepthfunc(GL_LESS); and glClearDepthf(1.f); because my projection matrices change the right hand coordinate to the left hand coordinate. I mean, My near plane and the far plane z-values are supposed to be [-1 , 1] in NDC. The problem is when I draw two objects at the one FBO including same RBOs, for example, like this code below, glEnable(GL_DEPTH_TEST); glClearDepthf(1.f); glClearColor(0.0,0.0,0.0,0.0); glClear(GL_DEPTH

Add static prebuilt libraries and GLESv2 support to NDK app in Android Studio using CMake

醉酒当歌 提交于 2019-12-12 17:18:49
问题 This is a 2 part question. I'm currently in the process of converting our current build setup (Eclipse; ndk-build) to (hopefully) a better one (Android Studio; cmake). I'm going down the cmake path because I read that that is the only way to get decent debugging to work properly without the need for the experimental gradle plugin (if you are sure this is false, please let me know). Ok so first issue I'm having is simply linking static prebuilt libraries such as a prebuilt version of boost

Optimizing performance of a heavy fragment shader

青春壹個敷衍的年華 提交于 2019-12-12 14:06:16
问题 I need help optimizing the following set of shaders: Vertex: precision mediump float; uniform vec2 rubyTextureSize; attribute vec4 vPosition; attribute vec2 a_TexCoordinate; varying vec2 tc; void main() { gl_Position = vPosition; tc = a_TexCoordinate; } Fragment: precision mediump float; /* Uniforms - rubyTexture: texture sampler - rubyTextureSize: size of the texture before rendering */ uniform sampler2D rubyTexture; uniform vec2 rubyTextureSize; uniform vec2 rubyTextureFract; /* Varying

Binding a second vertex buffer seems to spoil my first vertex buffer, OpenGL OES ios 5.1

♀尐吖头ヾ 提交于 2019-12-12 11:22:04
问题 I'm creating two different vertex buffers, that use two different shaders to render them . As soon as I bind the second vertex buffer, the data I parked in the first vertex buffer seems to be corrupted or lost. If I generate and draw one vertex buffer only, like so: glGenBuffers( 1, &vb1 ) ; glBindBuffer( GL_ARRAY_BUFFER, vb1 ) ; // fill it.. glBufferData( .. ) Then, in the draw() loop, glUseProgram( shader1 ) ; glBindBuffer( vb1 ) ; // make sure it is bound glDrawArrays( ... ) // draw it

How do you implement glOrtho for opengles 2.0? With or without tx,ty,tz values from the glOrtho spec?

怎甘沉沦 提交于 2019-12-12 11:07:43
问题 Im trying to implement my own glOtho function from the opengles docs http://www.khronos.org/opengles/documentation/opengles1_0/html/glOrtho.html to modify a Projection matrix in my vertex shader. It's currently not working properly as I see my simple triangles vertices out of place. Can you please check the code below and see if i'm doing things wrong. I've tried setting tx,ty and tz to 0 and that seems to make it render properly. Any ideas why would this be so? void ES2Renderer::_applyOrtho

OES_vertex_array_object and client state

自古美人都是妖i 提交于 2019-12-12 10:58:42
问题 I want a vertex array object in OpenGL ES 2.0 to hold two attributes from different buffers, the second buffer being read from client memory ( glBindBuffer(GL_ARRAY_BUFFER, 0) ) But I get a runtime error: GLuint my_vao; GLuint my_buffer_attrib0; GLfloat attrib0_data[] = { 0, 0, 0, 0 }; GLfloat attrib1_data[] = { 1, 1, 1, 1 }; void init() { // setup vao glGenVertexArraysOES(1, &my_vao); glBindVertexArrayOES(my_vao); // setup attrib0 as a vbo glGenBuffers( 1, &my_buffer_attrib0 ); glBindBuffer

Simple textured quad rotation in OpenGL ES 2.0

半世苍凉 提交于 2019-12-12 09:29:54
问题 Edit 6 - Complete re-write in relation to comments/ongoing research Edit 7 - Added projection / view matrix..... As I'm not getting far with this, I added view/projection matrix from the Google demo - please see code below: If anyone can point out where I'm going wrong it really would be appreciated, as I'm still getting a blank screen when I put ""gl_position = a_position * uMVPMatrix;" + into my vertex shader (with "gl_position = a_position;" + my quad is displayed at least.......) Declared