opengl-es-2.0

Android : OpenGL 2.0 Rotation/moving the Camera using Matrix.setLookAtM

一曲冷凌霜 提交于 2019-12-11 02:01:01
问题 So this is my second question today, I might be pushing my luck In short making a 3D first Person, where you can move about and look around. In My OnDrawFrame I am using Matrix.setLookAtM(mViewMatrix, 0, eyeX , eyeY, eyeZ , lookX , lookY , lookZ , upX, upY, upZ); To move back, forth, sidestep left etc I use something like this(forward code listed) float v[] = {mRenderer.lookX - mRenderer.eyeX,mRenderer.lookY - mRenderer.eyeY, mRenderer.lookZ - mRenderer.eyeZ}; mRenderer.eyeX += v[0] * SPEED

LibGdx GLES2.0 cube texel stretching

◇◆丶佛笑我妖孽 提交于 2019-12-11 00:25:25
问题 I've been programming OpenGL on Windows/SDL for a few years and am able to do quite a lot of advanced things with it. I've switched over to Android and libgdx and over the past few days have tried to put a simple demo together, just a spinning cube. Using libgdx's ObjLoader and Mesh classes, I loaded a cube mesh exported from blender(with normals and uv coords), and tried to apply a texture, and it draws a cube, but seems to only uses one texel from the texture to cover the whole model. I've

Android, openGL lag in jni when touching screen

廉价感情. 提交于 2019-12-10 20:28:52
问题 I am currently testing out all the features that a need in my game on the Android platform. I have only modified the hello-gl2 sample code, and added some textures, VBO's, FBO's and simple shaders in two rendering passes. The thing is that when I let the app run with out touching the screen, i have about 35-45 fps. But if I start touching the screen continuously, the rendering starts to lag! So is this a problem because input and rendering is in the same thread (as a thinks it is?), is it

Applying a custom SKShader to SKScene that pixelates the whole rendered scene in iOS 8 SpriteKit with Swift

寵の児 提交于 2019-12-10 19:02:22
问题 I'm trying to create a full-screen pixelation effect on SKScene. I've learned that there should be two options to do this: Using a custom SKShader using GLES 2.0. Using Core Image filters. I've tried to add a custom SKShader that should modify the whole screen by pixelating it. I'm not sure that if it's possible, but documentation from SKScene (which is a subclass of SKEffectNode ) suggests it: An SKEffectNode object renders its children into a buffer and optionally applies a Core Image

OpenGL ES 2.0 with iPhone: GL_POINT_SMOOTH draws squares with ES 2.0 but works in ES 1.0

帅比萌擦擦* 提交于 2019-12-10 19:01:25
问题 I'm trying to draw circles by using a Vertex Buffer Object to draw points with GL_POINT_SMOOTH enabled in OpenGL ES 2.0 on iPhone. I've used the following ES 1.0 rendering code to draw circles successfully on iPhone 4: glVertexPointer(2, GL_FLOAT, 0, circleVertices); glEnableClientState(GL_VERTEX_ARRAY); glEnable(GL_POINT_SMOOTH); glPointSize(radius*2); glDrawArrays(GL_POINTS, 0, 1); I'm now trying to achieve the same effect using a set-up VBO followed by this ES 2.0 rendering code: glEnable

OpenGL ES 2.0 only draws the object once

限于喜欢 提交于 2019-12-10 18:59:23
问题 First, let me say I'm sorry for asking so many questions today. So, I have a class for a circle. And I have an arraylist with 3 circle instance, each with a different x coordinate to draw. For whatever reason, OpenGL ES 2.0 is only drawing one of them, even though I call all of them to be drawn. I looked over my code for hours and tried many different things, but to no avail. So, my question is: Is there anything special I have to do to get OpenGL ES 2.0 to draw more than one object? Here is

Difference from eglCreatePbufferSurface and eglCreatePixmapSurface with OpenGL ES(EGL)

末鹿安然 提交于 2019-12-10 18:34:00
问题 I am having a problem where I need to some off-screen work with opengl es2 by software rendering(Only has CPU, no GPU). The question is can I use pbuffer without GPU? Also, how to directly save to a png file after drawing something. Please help and give me a demo. 回答1: First, use EGL to create an off-screen buffer: eglCreatePbufferSurface(display, config, PBufAttribs); Then read the buffer: GLint size; size = esContext->width * esContext->height * 4; GLubyte *data = (GLubyte*)malloc(size);

OpenGL: Circle bevel with fragment shader?

倖福魔咒の 提交于 2019-12-10 18:17:55
问题 I'm trying to make a circular particle that looks like it's got a light shining on the top of it. Here's what I'm trying to get it to look like: And here's what it currently looks like: Not very good. Since I'm using GL_POINTS, I get the gl_PointCoord variable, which should make things easier, except I don't know how to use it properly, which led to this mess: varying lowp vec4 DestinationColor; void main(void) { lowp vec2 circCoord = 2.0 * gl_PointCoord - 1.0; if (dot(circCoord, circCoord) >

Android activity silently exiting

最后都变了- 提交于 2019-12-10 17:39:04
问题 My app has a splash screen activity and that starts an intent for the main activity which has an openGL view in it. Some users are reporting that the game exits and goes back to the splash. I'm certain that it's a bug, but it's failing silently and so I don't get any crash reports back. What can cause it to fail silently like this? in such a way that the app cycles and no Force Close window is seen by the user. Edit: I have stoped the splash screen restarting by putting noHistory="true" in

Diffuse shader for OpenGL ES 2.0: Light changes with camera movement (Vuforia on Android)

烂漫一生 提交于 2019-12-10 16:03:25
问题 As a starting point I use the Vuforia (version 4) sample called MultiTargets which tracks a 3d physical "cube" in the camera feed and augments it with yellow grid lines along the cube edges. What I want to achieve is remove the textures and use diffuse lighting on the cube faces instead, by setting my own light position. I want to do this on native Android and I do NOT want to use Unity. It's been a hard journey of several days of work and learning. This is my first time working with OpenGL