opengl-es

UIScrollView broken and halts scrolling with OpenGL rendering (related CADisplayLink, NSRunLoop)

早过忘川 提交于 2019-12-19 03:39:17
问题 Solution note, Not a question. UIScrollView suspends OpenGL rendering by preventing firing CADisplayLink tick when CADisplayLink registered with NSDefaultRunLoopMode . But, if you use NSRunLoopCommonModes to solve this, UIScrollView will halt scrolling at burst scrolling. And after once halted, it does not scroll again. (broken) And registering CADisplayLink in other thread/runloop (as described in answer of this question: CADisplayLink stops updating when UIScrollView scrolled) reduces

User uploaded textures in three.js

馋奶兔 提交于 2019-12-19 03:19:43
问题 Here you will find a jsFiddle adaptation of the problem. I would like to create a 3d web application in which the user is able to select an image file on their local machine: <input id="userImage" type="file"/> When a file is selected, the image is loaded as a parameter in a THREE.ShaderMaterial object. A glsl shader is applied to the image and the result is rendered to a container in the browser: $("#userImage").change(function(){ var texture = THREE.ImageUtils.loadTexture( $("#userImage")

How can I read the depth buffer in WebGL?

馋奶兔 提交于 2019-12-19 02:08:41
问题 Using the WebGL API, how can I get a value from the depth buffer, or in any other way determine 3D coordinates from screen coordinates (i.e. to find a location clicked on), other than by performing my own raycasting? 回答1: Several years have passed, these days the WEBGL_depth_texture extension is widely available... unless you need to support IE. General usage: Preparation: Query the extension (required) Allocate a separate color and depth texture ( gl.DEPTH_COMPONENT ) Combine both textures

opengl: how to avoid texture scaling

孤人 提交于 2019-12-18 17:35:30
问题 How do I apply a repeating texture that always maintains its original scale (1 pixel in the texture = 1 pixel on screen), regardless of the vertex data it is applied with. I realize this is not the most usual task, but is it possible to easily set opengl to do this, or do I need to apply some kind of mask to vertex data that respects its original appearance? edit: in my specific case, I'm trying to draw 2D ellipses of different sizes, with the same pixel pattern. The ellipses are made of a

How to detect maximum texture resolution on iPhone?

只谈情不闲聊 提交于 2019-12-18 16:59:13
问题 I'm making an universal openGL based app that should work on ipod/iphone 2G/3G/3GS/4 and iPad. To deliver the best possible graphics I need to switch between different texture resolutions based on what device is running it. For example, iPhone 2G needs textures that is no larger than 1024x1024, while iPhone 3GS can handle larger textures. So, on iPhone 3GS I want to load a texture atlas that's 2048x2048, while iPhone 2G will get the downscaled 1024x1024 texture atlas. Is there a simple and

Fast Gaussian blur at pause [closed]

点点圈 提交于 2019-12-18 16:55:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . In cocos2d-x I need to implement fast gaussian blur and here is how it should looks like( I just found some game on the App Store with already done such blur, in unity): So, it's nice fadeIn - fadeOut blur when user pauses the game. GPUImage already has a fast blur I need, but I can't find solution for cocos2d-x

Using OpenGL to replace Canvas - Android

十年热恋 提交于 2019-12-18 16:09:34
问题 I am attempting to replace the Canvas-based rendering system that I already have with the faster opengl-es surface, however, I can't seem to get an openGL renderer to conform in such a way that it acts as 2d field, rather than a perspective view. My current code for the renderer looks as follows: @Override public void onSurfaceChanged(GL10 gl, int width, int height) { gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glOrthof(0.0f, width, 0.0f,

Using OpenGL to replace Canvas - Android

与世无争的帅哥 提交于 2019-12-18 16:09:15
问题 I am attempting to replace the Canvas-based rendering system that I already have with the faster opengl-es surface, however, I can't seem to get an openGL renderer to conform in such a way that it acts as 2d field, rather than a perspective view. My current code for the renderer looks as follows: @Override public void onSurfaceChanged(GL10 gl, int width, int height) { gl.glViewport(0, 0, width, height); gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glOrthof(0.0f, width, 0.0f,

Why is eglMakeCurrent() failing with EGL_BAD_MATCH?

南笙酒味 提交于 2019-12-18 14:41:24
问题 I am developing for Android using opengl/egl. My app requires a second context for loading textures from a second thread. My code works fine on android 2.3, but when I try the code on a 4.0.3 android device or emulator, eglMakeCurrent() fails with EGL_BAD_MATCH. The initialization of the second context and it's pixel buffer all works fine too, so I am not sure where to begin looking for this error. This is the initialization code: ANativeWindow *window = (ANativeWindow*)displaySurface; EGLint

Constant FPS Android OpenGLES

我与影子孤独终老i 提交于 2019-12-18 13:53:19
问题 Hello android developers, I am developing a simple game for Android in Eclipse using OpenGLES 1.0. I am using Samsung Galaxy S2 Android(2.3) as a device for development. And I have a question about dual core and making frame rate constant. So I have managed creating GLSurfaceView and override onDrawFrame() function where I call LogicUpdate(deltatime) function and Render() function. Yes, all in single thread for now. The problem I am getting is with dual core. If I disable dual core by going