opengl-es

Using GraphicBuffers to fast read from a texture

北城余情 提交于 2019-12-12 09:47:29
问题 I am working on some code that runs some GPGPU code on Android using shaders. Usually a Framebuffer is used so the result of the computation is stored in a texture. Also the input data is usually a texture. To improve performance it would be great to get rid of glTexImage2D and glReadPixels to upload and download images to and from the GPU memory space. All the code related to OpenGL is native. On Android GraphicBuffer can be used on Android for this propose because in mobile devices gpu

Is updating the entire VBO on each frame the most efficient way to draw many changing unique triangles?

假装没事ソ 提交于 2019-12-12 09:39:53
问题 Answers to my previous question suggested that I use a Vertex Buffer Object and merge my position data with my color data into a single array, which I have now done in this simple test case: http://jsfiddle.net/headchem/r28mm/14/ Pseudo code for every frame: function drawFrame() { // clear global vertex[] array containing both position and color // recreate it with new triangles and colors (determined elsewhere) drawShapes(); // put the vertex array into the VBO using gl.bufferData // finish

Loading 3D model in iOS

做~自己de王妃 提交于 2019-12-12 09:39:29
问题 I'm creating a game application from scratch with xcode for iOS, and I've use the OpenGL Game projet template to create mine. I've searched a lot in the past few days, but I can't find any tutorials or example as to how I would load 3D model (via .obj files) in my application. I've found some documentation on loading them onto an app with a console script, but I need to do it programmatically. Any help would be very appreciated Also, my 3D models are created using blender 回答1: The future will

3D rotatable cube with clickable areas on sides

一曲冷凌霜 提交于 2019-12-12 09:24:19
问题 What I want to accomplish is an iPad Application with a 3D rotatable cube, and on each side of the cube I want to define multiple areas where once clicked would take to another view or display a popup. Can this be achieved with some effort using OpenGL ES in Xcode from scratch, or should I use a 3D framework, if so what would be the easiest framework? (I have only heard of Unity and its pretty expensive) Does anyone have a good tutorial for me to learn how to do this? I already tried 3D CSS3

Custom vertex attributes in SceneKit

ε祈祈猫儿з 提交于 2019-12-12 09:23:00
问题 I'm using SceneKit to generate some custom geometry. This is working fine, but I'm struggling to find a way to include custom vertex attributes. Specifically, I'm looking to include an additional SCNVector3 per vertex. I've found plenty of examples which make use of shaderModifiers to include GLSL/Metal code that relies upon custom uniform values, but haven't come across a way of including vertex attributes . Is this possible with SceneKit, or is my thinking backwards? 回答1: there doesn't seem

Android: How do I resize the GLSurfaceView so I can add buttons around the outside?

痞子三分冷 提交于 2019-12-12 09:18:43
问题 I have a 3d model viewer, but I want to modify it, so hear are some questions/issues: (OpenGL ES 2.0) 1. Is it possible to change the GLSurfaceView dimensions (height and width) to something like 600 x 800 and centered on the device (tablet) screen? I want to use the unused area to line buttons around the outside. 2. Is it possible to resize glSurfaceView in XML? 3. Is there a way to set an XML layout on top of the screen? 4. Is it possible to set a background color under the rendering so

Android 2D Game With OpenGL

柔情痞子 提交于 2019-12-12 09:15:45
问题 Recently I worked on a 2D Game using SurfaceView and I learned a lot about game loops and everything. But now I want to make the same game using OpenGL. I read that the GLSurfaceView is the class that would be relative to what SurfaceView was. But I'm not sure about other things as: Using SurfaceView , I used the Bitmap class to load a image resource that would be lets say a character. And that bitmap would be a property of my Character class. And for the gameloop I used a different Thread I

open GLES or canvas? (android)

爷,独闯天下 提交于 2019-12-12 09:09:48
问题 I am making an app that is going to be on the market soon but i'm wondering, should I use Canvas or Open GLES? right now i have no idea about how to use open GLES. I am using canvas for about have a year and I heard that open GLES is better than canvas. I am making a 2d game and not a 3d game. should i use canvas or open GLES? if i should use the open GLES, can you give me a good tutorial on how to use it? and also how to do basic things like control the x and y in there or is it just like

Fastest 2D frame rate possible with android NDK, my try included, better options available?

邮差的信 提交于 2019-12-12 09:05:15
问题 Fastest 2D frame rate possible with android NDK, my try included, better options available? I used the NDK and OpenGL ES 2.0 to display a frame as a texture on a GL_TRIANGLE_STRIP. This was done on a HTC Desire, same hardware as Nexus One. I tried to load multiple GL_RGBA textures and switch between the textures, because the normal fill rate with a single texture was disappointingly low: 1 texture: 4.78 fps 2 textures: 19.68 fps 3 textures: 20.18 fps 4 textures: 28.52 fps 5 textures: 29.01

Screen-to-World coordinate conversion in OpenGLES an easy task?

大憨熊 提交于 2019-12-12 08:54:42
问题 The Screen-to-world problem on the iPhon e I have a 3D model (CUBE) rendered in an EAGLView and I want to be able to detect when I am touching the center of a given face (From any orientation angle) of the cube. Sounds pretty easy but it is not... The problem: How do I accurately relate screen-coordinates (touch point) to world-coordinates (a location in OpenGL 3D space)? Sure, converting a given point into a 'percentage' of the screen/world-axis might seem the logical fix, but problems would