opengl-es-2.0

Is Opengl Development GPU Dependant?

亡梦爱人 提交于 2019-11-28 09:26:31
I am developing an android application in opengl ES2.0.In this Application I used to draw multiple lines and circles by touch event in GL surfaceView. As opengl depends on GPU, Currently it works fine in Google Nexus 7(ULP GeForce). In Samsung Galaxy Note 2(MALI 400MP) I'm trying to draw more than one line, but it clears the previous line and draw current line as new. In Sony Xperia Neo V(Adreno 205) I'm trying to draw a new line, it crashes the surface as shown in below image. Is it possible to make it work on all devices or do I need to write code for Individual GPU? Source code MainActivity

GLSurfaceView displaying black on Nexus 7 with Android 4.2

家住魔仙堡 提交于 2019-11-28 07:56:17
问题 I have an OpenGL ES2.0 app that is working on devices running various Android versions from 2.2 up to 4.1. However I have been told that when running it on a Nexus 7 with Android 4.2 the 3D graphics in the App are all black. The Action Bar and dialogs work fine though. I have tried it on an emulated Nexus 7 with Intel Atom processor, HAX and GPU enabled running 4.2.2 and that works OK. I would have preferred to run the ARM image but that doesn't seem to include Open GL ES2.0 Does anyone have

OpenGL ES Android Matrix Transformations

本秂侑毒 提交于 2019-11-28 07:02:57
I have a renderer implementing GLSurfaceView.Renderer interface; a subclass of GLSurfaceView and some classes representing my objects I want to draw. I have the code from http://developer.android.com/training/graphics/opengl/motion.html I want to expand this and add some moving along axes and can't manage it. The object is only rotated. and here is my code: public class NotMyCoolRenderer implements GLSurfaceView.Renderer { public GLShip mTriangle; private GLBackgroundStar mSquare; private final float[] mMVPMatrix = new float[16]; private final float[] mProjMatrix = new float[16]; private final

Writing to gl_FragColor causes INVALID_OPERATION on Android

大兔子大兔子 提交于 2019-11-28 05:35:59
问题 I'm trying to master OGLES2 for NDK and stuck with GLSL shaders. The situation is similar to the one already highlighted here, but it seems the reason behind it is somewhat different. I have the simpliest shaders possible. Vertex: #version 110 attribute vec3 vPosition; void main(void) { gl_Position = vec4(vPosition, 1.0); gl_FrontColor = gl_BackColor = vec4(0.3, 0.3, 0.3, 1); // *** } Fragment: #version 110 void main(void) { gl_FragColor = gl_Color; } Easy and straight-forward. I even define

Android OpenGL ES 2.0 screen coordinates to world coordinates

蓝咒 提交于 2019-11-28 04:44:44
I'm building an Android application that uses OpenGL ES 2.0 and I've run into a wall. I'm trying to convert screen coordinates (where the user touches) to world coordinates. I've tried reading and playing around with GLU.gluUnProject but I'm either doing it wrong or just don't understand it. This is my attempt.... public void getWorldFromScreen(float x, float y) { int viewport[] = { 0, 0, width , height}; float startY = ((float) (height) - y); float[] near = { 0.0f, 0.0f, 0.0f, 0.0f }; float[] far = { 0.0f, 0.0f, 0.0f, 0.0f }; float[] mv = new float[16]; Matrix.multiplyMM(mv, 0, mViewMatrix, 0

Is it possible to draw line thickness in a fragment shader?

ぐ巨炮叔叔 提交于 2019-11-28 04:34:23
Is it possible for me to add line thickness in the fragment shader considering that I draw the line with GL_LINES? Most of the examples I saw seem to access only the texels within the primitive in the fragment shader and a line thickness shader would need to write to texels outside the line primitive to obtain the thickness. If it is possible however, a very small, basic, example, would be great. Quite a lot is possible with fragment shaders. Just look what some guys are doing . I'm far away from that level myself but this code can give you an idea: #define resolution vec2(500.0, 500.0)

Choose OpenGL ES 1.1 or OpenGL ES 2.0?

放肆的年华 提交于 2019-11-28 04:08:40
I'm going to start a new cross-plattform openGL project (primary for iPhone & PC). So theres the main question: targeting for OpenGL ES 1.1 or OpenGL ES 2.0? Or both? So far I read Open GL ES 1.1 isnt really deprecated, isn't it? So what would speak for openGL ES 2.0? Programmable vertex- & fragmentshader - Anything else? I heard about performance decrease with alpha blending or so - can that be true? I assume openGL ES 2.0 code should also run on PC - So is openGL ES 2.0 is really more future aware? The other developers out there are still coding for OpenGL ES 1.1 or 2.0? And why? I assume in

How to draw a texture as a 2D background in OpenGL ES 2.0?

不羁岁月 提交于 2019-11-28 03:43:20
I'm just getting started with OpenGL ES 2.0, what I'd like to do is create some simple 2D output. Given a resolution of 480x800, how can I draw a background texture? [My development environment is Java / Android, so examples directly relating to that would be best, but other languages would be fine.] Even though you're on Android, I created an iPhone sample application that does this for frames of video coming in. You can download the code for this sample from here . I have a writeup about this application, which does color-based object tracking using live video, that you can read here . In

How to save SurfaceTexture as bitmap

本小妞迷上赌 提交于 2019-11-28 00:09:38
When I decode a video to a surface I want to save the frames i want as bitmap/jpeg files. I don't want to draw on the screen and just want to save the content of the SurfaceTexture as an image file. You have to render the texture. If it were a normal texture, and you were using GLES 2 or later, you could attach it to an FBO and read directly from that. A SurfaceTexture is backed by an " external texture ", and might be in a format that the GL driver doesn't support a full set of operations on, so you can't do that. You need to render it, and read the result. FWIW, the way you go about saving

OpenGL ES 2.0 Vertex Transformation Algorithms

前提是你 提交于 2019-11-27 22:20:44
问题 I'm developing an image warping iOS app with OpenGL ES 2.0. I have a good grasp on the setup, the pipeline, etc., and am now moving along to the math. Since my experience with image warping is nil, I'm reaching out for some algorithm suggestions. Currently, I'm setting the initial vertices at points in a grid type fashion, which equally divide the image into squares. Then, I place an additional vertex in the middle of each of those squares. When I draw the indices, each square contains four