opengl-es

OpenGL ES 2.0: Commands required just before glDrawElements with VBO [closed]

喜夏-厌秋 提交于 2019-12-11 15:18:42
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I've setup a Vertex Buffer Object (VBO) with vertex and index data. I've also created a GLprogram to use custom shaders, so I call glUseProgram within my code. My vertex data changes every frame, so I've supplied

Setting texture on 3D object using image from photo gallery (OpenGL ES 2.0)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 14:49:25
问题 I am new in Android development and trying to use OpenGL ES 2.0 to display a 3D object and map texture on it. Everything worked fine when I used texture obtained from a resource image. As next step, I was trying to use an image from Photo gallery to change texture dynamically. Here is what I did: public class DesignTab extends Fragment implements OnMenuItemClickListener { private static final int SELECT_PHOTO = 100; private GLSurfaceView mGLView; // onCreate, onCreateView here where mGLView

openGL features in view based application

核能气质少年 提交于 2019-12-11 14:35:39
问题 Can we use OpenGles Features in a viewbased application on iphone?? i mean in view based application when i button pressed it will goes to OpenGLes view and displays the image processing application... please help me.... 回答1: Sure, you can freely mix OpenGL and UIKit code in one app. The only thing that identifies a view as being OpenGL-based in iOS is that its backing layer is an instance of CAEAGLLayer , i.e. you have to override +layerClass in your OpenGL view class and have it return

function with bool return type in OpenGL ES shader using GPUImage

房东的猫 提交于 2019-12-11 14:33:35
问题 I'm working on an iOS project, using GPUImage framework. I cannot get my shader complied. There's a function in my fragment shader: const vec2 boundMin = vec2(0.0, 0.0); const vec2 boundMax = vec2(1.0, 1.0); bool inBounds (vec2 p) { return all(lessThan(boundMin, p)) && all(lessThan(p, boundMax)); } Shader compile log: ERROR: 0:1: '_Bool' : syntax error syntax error When I replace all the calls to function inBounds(vec2 p) with all(lessThan(boundMin, p)) && all(lessThan(p, boundMax)) it works

What is the appropriate way of drawing background in opengl es?

跟風遠走 提交于 2019-12-11 14:21:25
问题 I have a tile background with 2400x480 pixels.Also one more far layer for parallax effect.Is that drawing background with a for loop logical? for(int i=0;i<100;i++) { //Drawing code like 0+2400*i ... } 回答1: I hope this gets you started, but I really don't know... I assume in the following that the texture is displayed all at once. Due to the size of the texture -- 2400*480 = (3*800)*480 -- I think this may not be correct, but anyway. For each layer, you have two quads with fixed texture

Implementing a Simple Adaptive Threshold in GPUImage

老子叫甜甜 提交于 2019-12-11 14:00:30
问题 I'm developing an iPhone app to recognize some well known symbols from pictures. I'm basically following these tutorials http://aishack.in/tutorials/sudoku-grabber-with-opencv-detection/ and http://sudokugrab.blogspot.it/2009/07/how-does-it-all-work.html, using OpenCv for template matching and GPUImage for image processing. When all images are with the same luminance level, I can adjust the threshold of GPUImageLuminanceThresholdFilter and all works smooth, but, of course, I can't be sure of

Capture camera frames in background (Android)

二次信任 提交于 2019-12-11 13:34:47
问题 My problem is this: I want a background service, that will obtain frames from the camera in real-time, so that I can analyze them. I've seen a lot of similar topics here that supposedly address this issue, but none of them has really worked in my case. My first attempt was to create an Activity, which started a Service, and inside the service I created a surfaceView, from which I got a holder and implemented a callback to it in which I prepared the camera and everything. Then, on a

How to understand the underneath of setDisplay/setSurface/setPrewviewDisplay/setPreviewTexture for Android

感情迁移 提交于 2019-12-11 13:26:00
问题 Since Android api level 1, We can attach a MediaPlayer or Camera to the Surface with setDisplay or setPrewviewDisplay, then image data can be transfered to gpu and processed much faster. After SurfaceTexture is introduced, We can create our own texture with the target GL_TEXTURE_EXTERNAL_OES and attach the MediaPlayer or Camera to opengl es. These are well known, but what I want to talk about is the underneath which is about Android graphics architecture.(Android Graphics architecture) The

Drawing many unique triangles with a single draw call (for better performance)?

落爺英雄遲暮 提交于 2019-12-11 12:44:42
问题 Here is a fiddle of the simplest case: http://jsfiddle.net/headchem/r28mm/10/ Is there any way to avoid calling this line for every single triangle I wish to draw? gl.drawArrays(gl.TRIANGLES, 0, numItems); As a learning exercise, I'm trying to create a 2D game out of simple colored triangles. I'd like to put several hundred moving triangles on screen each frame, but my framerate is very slow with my current attempts. I suspect it's because of the hundreds of drawArrays() calls I am making

How to draw Buffer[] to a TextureView on Android?

纵然是瞬间 提交于 2019-12-11 12:18:06
问题 I'm using JavaCV's FFmpegFrameGrabber to retrieve frames from a video file. This FFmpegFrameGrabber return a Frame which basically contain a Buffer[] to hold image pixels for a video frame. Because performance is my top priority, I would like to use OpenGL ES to display this Buffer[] directly without converting it into Bitmap . The view to be displayed is only taking less than half of the screen and following the OpenGL ES document: Developers who want to incorporate OpenGL ES graphics in a