opengl-es

How do I rotate an object using OpenGL ES 2.0?

喜你入骨 提交于 2019-12-13 12:35:49
问题 In OpenGL ES 1.1, you can use glRotatef() to rotate a model, but that function doesn't exist in OpenGL ES 2.0. Therefore, how do you perform rotation in OpenGL ES 2.0? 回答1: To follow on what Christian's said, you'll need to keep track of the model view matrix yourself and manipulate that to perform the rotations you need. You'll then pass in the matrix as a uniform to your shader, and do something like the following: attribute vec4 position; uniform mat4 modelViewProjMatrix; void main() { gl

Get orientation device in the iPhone for Opengl Es

≯℡__Kan透↙ 提交于 2019-12-13 12:20:36
问题 I'm trying to convert the geomagnetic and accelerometer to rotate the camera in opengl ES1, I found some code from android and changed this code for iPhone, actually it is working more or less, but there are some mistakes, I´m not able to find this mistake, I put the code, also the call to Opengl Es1: glLoadMatrixf((GLfloat*)matrix); - (void) GetAccelerometerMatrix:(GLfloat *) matrix headingX: (float)hx headingY:(float)hy headingZ:(float)hz; { _geomagnetic[0] = hx * (FILTERINGFACTOR-0.05) +

How to transform an Android bitmap to wrap a cylinder and change perspective

核能气质少年 提交于 2019-12-13 12:20:14
问题 I wrote a sample app that allows the Android user to take a picture and have the text content from a view as an overlay on the image and saved to a gallery album: What I would like to to is transform the text bitmap before joining the two images. Specifically, I'd like to make the text curve up on the sides (simulating wrapping around a cylinder), and make it larger at the top than the bottom (simulating a top down perspective), as illustrated here: There is no need to interpret the camera

Rendering Static and Dynamic Graphics OpenGL

六月ゝ 毕业季﹏ 提交于 2019-12-13 12:19:07
问题 I am working on an IOS game using the OpenGL pipeline. I have been able to render the graphics I want to the screen, however, I am calling glDrawElements too many times and have some concerns about running into performance issues eventually. I have several static elements in my game that do not need to be render on every render cycle. Is there a way I can render static elements to one frame buffer and dynamic elements to another? Here's the code I have tried: static BOOL renderThisFrameBuffer

Why FreeImage loads image in BGR format?

青春壹個敷衍的年華 提交于 2019-12-13 12:16:17
问题 I write game using Android NDK and FreeImage library to load images into my game. It loads images in BGR format. It is possible to load in RGB format? Or I need to swap R and B components manualy? Edited My device is Samsung Galaxy S4(armv7 archtecture). Here is code` FIMEMORY* fiStream = FreeImage_OpenMemory((BYTE*)data, size); FREE_IMAGE_FORMAT fif = FreeImage_GetFileTypeFromMemory(fiStream); if (FreeImage_FIFSupportsReading(fif)) { dib = FreeImage_LoadFromMemory(fif, fiStream, 0); } if (

Android OpenGL-ES VBO support or not?

一个人想着一个人 提交于 2019-12-13 12:09:52
问题 Android OpenGL-ES VBO support or not? How can i check this? Thanks 回答1: Some phones support it, some do not. Generally, VBOs are mandatory in OpenGL 1.1, so if the device reports gl.glGetString(GL10.GL_VERSION); as 1.1 or higher (you can also write the app manifest file so that 1.1 is required for the installation) then they are supported. If the device support OpenGL ES 1.0 only, you should check the return value of gl.glGetString(GL10.GL_EXTENSIONS); whether it contains ARB_vertex_buffer

Instanced drawing with OpenGL ES 2.0 on iOS

左心房为你撑大大i 提交于 2019-12-13 11:51:03
问题 In short: Can anyone confirm whether it is possible to use the built-in variable gl_InstanceID (or gl_InstanceIDEXT ) in a vertex shader using OpenGL ES 2.0 on iOS with GL_EXT_draw_instanced enabled? Longer: I want to draw multiple instances of an object using glDrawArraysInstanced and gl_InstanceID, and I want my application to run on multiple platforms, including iOS. The specification clearly says that these features require ES 3.0. According to the iOS Device Compatibility Reference ES 3

Full screen background texture with OpenGL performance issue (iPad)

試著忘記壹切 提交于 2019-12-13 11:44:19
问题 I am quite puzzled with the poor performance I'm seeing when drawing a full screen background using a textured triangle mesh in OpenGL: drawing just the background and nothing else maxes out at 40 fps using the most basic shader, and 50 fps using the default pipeline. While 40 fps doesn't seem too bad, adding anything else on top of that makes the fps drop, and considering I need to draw 100-200 other meshes on top of that, I end up with a paltry 15 fps that is simply not usable. I have

CVOpenGLESTextureCacheCreateTextureFromImage on iPad2 is too slow ,it needs almost 30 ms, too crazy

我与影子孤独终老i 提交于 2019-12-13 11:34:50
问题 I use opengl es to display bgr24 data on iPad, I am new about opengl es ,so in display video part I use code from RosyWriter one APPLE sample. It works, but the CVOpenGLESTextureCacheCreateTextureFromImage function cost more than 30ms, while in RosyWriter its cost is negligible. what I do is first transform BGR24 to BGRA pixel format, then use CVPixelBufferCreateWithBytes function create a CVPixelBufferRef, and then get a CVOpenGLESTextureRef by CVOpenGLESTextureCacheCreateTextureFromImage.

What does this error message mean, it's caused by the rokonandroid game engine

谁说胖子不能爱 提交于 2019-12-13 10:52:12
问题 I'm having problems with an app engine now that I have my whole game set up, it kind of sucks. What's this error message mean? I really don't understand what the problem is. Is the problem with one of my sprites that is causing the game engine to get mad? 12-13 12:48:15.389: ERROR/Rokon(1776): addToActive(1505553220) 12-13 12:48:15.389: WARN/System.err(1776): java.lang.Exception: addToActive(1505553220) 12-13 12:48:15.389: WARN/System.err(1776): at com.stickycoding.rokon.Debug.error(Debug