opengl-es-2.0

Three.js: forcing loop to unroll

自闭症网瘾萝莉.ら 提交于 2019-12-24 03:48:15
问题 When using normally three.js I get this error at Firebug: gl.getProgramInfoLog() (54,6): warning X3557: loop only executes for 1 iteration(s), forcing loop to unroll Even all the rest looks like working properly and not giving any problem. Trying with some examples from the net I see the same error message, you can find it for example at some examples in the net like this one When it uses three.min.js appears at line: 537 and with three.js it appears at line: 25909. 回答1: Which version of

Texture wrap mode repeat is not working

杀马特。学长 韩版系。学妹 提交于 2019-12-24 02:41:07
问题 I am using the Android mobile platform, with OpenGL ES 2.0. When I make a texture like so, the textures in my scene draw correctly //Generate there texture pointer GLES20.glGenTextures(1, textureHandle, 0); // parameters - we have to make sure we clamp the textures to the edges!!! GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureHandle[0]); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S,GLES20.GL_CLAMP_TO_EDGE); GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL

Preserving egl context, created via native code

≯℡__Kan透↙ 提交于 2019-12-24 02:23:27
问题 I am porting my game to android and decided to go with NativeActivity instead of Java activity and JNI calls (I am not avoiding JNI, just though it would be more convenient to set up callbacks and opengl context creation/destruction purely in c/c++). I know that GLSurfaceView has a setPreserveEGLContextOnPause function, but that is in Java, not in native app. I create my context with the following code: EGLConfig config; EGLSurface surface; EGLContext context; EGLDisplay display =

failed to bind EAGLDrawable in CADisplayLink render loop

纵然是瞬间 提交于 2019-12-24 02:22:20
问题 i use CADisplayLink render-loop callback to render a serial of image textures with openGLes. after CADisplayLink's first callback called, i just get these error output Failed to bind EAGLDrawable: <CAEAGLLayer: 0x946bb40> to GL_RENDERBUFFER 2 Failed to make complete framebuffer object 8cd6 i setup the renderBuffer&frameBuffer and call glFramebufferRenderbuffer in controller's viewDidLoad stage, the return of glCheckFramebufferStatus is fine in that stage. this is the code I'm using. /

Problem glTexGen in Open GL ES 2.0

江枫思渺然 提交于 2019-12-24 01:01:43
问题 I have a problem somehow similar to this post : glTexGen in OpenGL ES 2.0 I've looked up on the web a couple of other websites without finding out how to solve my issue. Basically, I want to map a texture onto a 2D quad after having set up an orthographic projection. The problem I have is that the texture is distorted as you can see on this picture where I used a coloured pattern instead of a texture: I would like the lines of the texture to stay straight on the quad, but as you can see, they

How to discover if OpenGL ES frame rate is stuttering - without Instruments?

时光怂恿深爱的人放手 提交于 2019-12-24 00:56:19
问题 A friend just asked me this interesting question and I had no answer to this. He's making a game and sometimes he experiences lags in the frame rate. As if 10 or more frames get dropped. The run loop function is called by CADisplayLink. Is there a way to tell programmatically if frame rate was lagging? I'd just measure the time in the run loop function and then check if it's bigger than supposed to be. And if it is, remember that there was a lag. Could be useful to test on various devices on

iPhone glShaderBinary

我与影子孤独终老i 提交于 2019-12-23 23:25:08
问题 Does anyone have an example of how to compile a shader, save the shader binary, and use glShaderBinary to later load the shader with iPhone/iOS (OpenGL ES 2.0)? 回答1: It's not possible to do this (at least with iOS 4 and below). iOS doesn't support any precompiled binary shaders. If you query OpenGL for the number of binary shader formats it supports, you get back zero. You're forced to compile the shaders every time you start the app. (Answered my own question.) 回答2: The best place to start

opengl es 2.0 android c++ glGetTexImage alternative

若如初见. 提交于 2019-12-23 21:07:58
问题 when testing on windows the code works as expected, but on android the glGetTexImage api doesn't exist, is there an other way of getting all the pixels from OpenGL without caching them before creating the texture? this is the code: void Texture::Bind(int unit) { glActiveTexture(GL_TEXTURE0 + unit); glBindTexture(GL_TEXTURE_2D, mTextureID); } GLubyte* Texture::GetPixels() { Bind(); int data_size = mWidth * mHeight * 4; GLubyte* pixels = new GLubyte[mWidth * mHeight * 4]; glGetTexImage(GL

opengl texture mapping off by 5-8 pixels

爱⌒轻易说出口 提交于 2019-12-23 20:56:21
问题 I've got a bunch of thumbnails/icons packed right up next to each other in a texture map / sprite sheet. From a pixel to pixel relationship, these are being scaled up from being 145 pixels square to 238 screen pixels square. I was expecting to get +-1 or 2 pixel accuracy on the edges of the box when accessing the texture coordinates, so I'm also drawing a 4 pixel outline overtop of the thumbnail to hide this probable artifact. But I'm seeing huge variations in accuracy. Sometimes it's off in

Use hardwareAcceleration flag with Canvas.clipPath

寵の児 提交于 2019-12-23 20:32:57
问题 I'm porting a project made for the Galaxy Tab 1, for Galaxy Tab 2, but the apk runs slowly so I added the hardwareAccelerated flag on the AndroidManifest.XML of the new application. But running give me the following error: java.lang.UnsupportedOperationException at android.view.GLES20Canvas.clipPath(GLES20Canvas.java:287) at br.com.iba.view.PageCurlView.drawCurl(PageCurlView.java:284) at br.com.iba.view.PageCurlView.onDraw(PageCurlView.java:353) at android.view.View.draw(View.java:9291) 回答1: