opengl-es

LibGDX 3D increase perfomance

喜欢而已 提交于 2019-12-21 06:25:24
问题 I'm working on a 3D game. The game requires around 100 cubes to work, all cube have be dynamic. I don't really know how much perfomance is required for a game like this, but i'm testing with a tablet with Mali-400 MP2 GPU, 1 GB ram, 1.5 GHz dual core. I know about rendering all of the cubes in one mesh, but then i can't move all of them separately. This setup gives me a very vacillating fps. Jumping between 20 and 50, mostly under 30. (In emulator 10-15) When the game starts, i build an

Camera frame yuv to rgb conversion using GL shader language

荒凉一梦 提交于 2019-12-21 06:08:08
问题 I am getting the camera frame from the android camera Preview Callback in Byte array and pass it to jni code. As we can't use byte in c++ so i am converting it to the integer array as follows: JNIEXPORT void JNICALL Java_com_omobio_armadillo_Armadillo_onAndroidCameraFrameNative( JNIEnv* env, jobject, jbyteArray data, jint dataLen, jint width, jint height, jint bitsPerComponent) { Armadillo *armadillo = Armadillo::singleton(); jbyte *jArr = env->GetByteArrayElements(data, NULL); int dataChar

Convert an image to a SceneKit Node

老子叫甜甜 提交于 2019-12-21 06:05:04
问题 I have a bit-map image: ( However this should work with any arbitrary image ) I want to take my image and make it a 3D SCNNode. I've accomplished that much with this code. That takes each pixel in the image and creates a SCNNode with a SCNBox geometry. static inline SCNNode* NodeFromSprite(const UIImage* image) { SCNNode *node = [SCNNode node]; CFDataRef pixelData = CGDataProviderCopyData(CGImageGetDataProvider(image.CGImage)); const UInt8* data = CFDataGetBytePtr(pixelData); for (int x = 0;

Compile GLSL shader asynchronously or in a different thread on Android

会有一股神秘感。 提交于 2019-12-21 05:47:10
问题 I'm writing an effect filter for Android devices, which has two-dimension loops in the fragment shader. For most of the devices, the shader can be compiled and run in reasonable time, but some of the devices takes several minutes to compile the shader at the first time. My fragment shader has a heavy two-dimension kernel convolution: const lowp int KERNEL_RADIUS = 19; .... for (int y = -KERNEL_RADIUS; y <= KERNEL_RADIUS; y++) { for (int x = -KERNEL_RADIUS; x <= KERNEL_RADIUS; x++) { .... } }

Draw text in iPhone openGL ES using just objective-c

懵懂的女人 提交于 2019-12-21 05:44:07
问题 A need to draw some text in openGL and then make rotations and translations over it. Need to use just objective-c. Any help? 回答1: Use Photoshop or something to create a texture file like below. |ABCDEFGH| |IJKLMNOP| |QRSTU...| sample.png Calculate UV position of each character. float eachCharHeight = 0.125f; float eachCharWidth = 0.125f; char charToDraw = 'a'; int indexOfChar = charToDraw - 65; // 'a' = 65 float uValueForCharA = (float)(indexOfChar / 8) * eachCharHeight; float vValueForCharA

OpenGL ES(WebGL) rendering many small objects

风流意气都作罢 提交于 2019-12-21 05:38:17
问题 I need to render a lot of small objects (2 - 100 triangles in size) which lies in deep hierarchy and each object has its own matrix. In order to render them I precalculate actual matrix for each object, put objects in a single list and I have two calls to draw each object: set matrix uniform and gl.drawElements(). Obviously it is not the fastest way to go. Then I have a few thousand objects performance becomes unacceptable. The only solution I'm thinking about is batch multiple objects into

Ubuntu 16.04 Unrecognized OpenGL version

烈酒焚心 提交于 2019-12-21 05:21:17
问题 Genymotion freeze with: "Starting virtual device". Ubuntu 16.04.2 LTS Genymotion 2.8.1 -- cleared cache, -- total removed, and install again, -- removed all virtual devices and download and installed new devices -- genymotion.log in .Genymobile folder without errors, -- genymotion-player.log in .Genymobile/Genymotion/deployed/Custom Phone - 7.0.0 - API 24 - 768x1280 folder: bře 6 18:57:08 [Genymotion Player] [warning] Unrecognized OpenGL version bře 6 18:57:08 [Genymotion Player] [warning]

Drawing using Vertex Buffer Objects in OpenGL ES 1.1 vs ES 2.0

為{幸葍}努か 提交于 2019-12-21 05:18:11
问题 i am new to openGL. Iam using apple documentation as my major referens http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/TechniquesforWorkingwithVertexData/TechniquesforWorkingwithVertexData.html#//apple_ref/doc/uid/TP40008793-CH107-SW6 My problem is that i am using openGL ES 1.1 and not 2 thus functions which are used in Listing 9-3 such as glVertexAttribPointer , glEnableVertexAttribArray are not recognized ... :) I trying to make the

eglCreateWindowSurface fails with java.lang.IllegalArgumentException

北慕城南 提交于 2019-12-21 05:05:36
问题 When trying to press the back button quickly during launching some Activities with GLSurfaceView , eglCreateWindowSurface fails with java.lang.IllegalArgumentException . I got the following errors: 10-08 18:05:36.490: E/GLSurfaceView(3440): eglCreateWindowSurface 10-08 18:05:36.490: E/GLSurfaceView(3440): java.lang.IllegalArgumentException: Make sure the SurfaceView or associated SurfaceHolder has a valid Surface 10-08 18:05:36.490: E/GLSurfaceView(3440): at com.google.android.gles_jni

Getting started with OpenGL… in Android

让人想犯罪 __ 提交于 2019-12-21 05:04:28
问题 I'm an experienced Android developer (if such thing exists) who has never worked with OpenGL before. There are various advantages of the Android platform (open-source, open distribution, portable, and so on) that make me think that it might be a great environment to finally get into OpenGL. But I'm also worried that the complexity of working in a environment with limited resources might be too much for someone who has never worked with 3D graphics before. Also, it seems that Android only uses