opengl-es-2.0

OpenGL Fixed function shader implementation

让人想犯罪 __ 提交于 2020-01-01 11:56:08
问题 Is there any wrapper which emulates the OpenGL ES 1.1 API on top of OpenGL ES 2.0? I was searching quite a bit but could not find any actual implementation. 回答1: I'm currently investigating same question, just stumbled upon this project: https://github.com/p3/regal#readme (OpenGL portability layer for OpenGL 2.x, 3.x, 4.x, Core contexts and ES 2.0). Only going to try it myself, but after reading the article http://www.gamasutra.com/view/news/177233/Indepth_Bringing_Regal_OpenGL_to_Native

Transpose a mat4 in OpenGL ES 2.0 GLSL

孤人 提交于 2020-01-01 03:14:13
问题 I'd like to transpose a matrix in my OpenGL ES 2.0 vertex shader, but apparently my iPad 3 doesn't support GLSL #version 120 , which is needed for the built-in function transpose(mat4) . I know there are options to work around that, like transposing the matrix on the CPU before passing it to the graphics chip, but it would make my shader a lot simpler if I could transpose it there. So, is there an option to transpose a mat4 in a shader on an iOS 6 device? Another thing: The question What

Android: Understanding OnDrawFrame, FPS and VSync (OpenGL ES 2.0)

二次信任 提交于 2020-01-01 02:28:10
问题 For a while now I've experienced an intermittent 'stuttering' of the sprites that are in motion within my Android Game. It's a fiarly simple 2D OpenGL ES 2.0 game. (This is an ongoing problem which I have re-visited many times). In my game loop, I have 2 'timers' - one which will log the number of frames in the previous second, and another which counts the time (in Milliseconds) from the end of the current onDrawFrame iteration to the start of the next. This is what I've found: When not

Android: Understanding OnDrawFrame, FPS and VSync (OpenGL ES 2.0)

点点圈 提交于 2020-01-01 02:28:07
问题 For a while now I've experienced an intermittent 'stuttering' of the sprites that are in motion within my Android Game. It's a fiarly simple 2D OpenGL ES 2.0 game. (This is an ongoing problem which I have re-visited many times). In my game loop, I have 2 'timers' - one which will log the number of frames in the previous second, and another which counts the time (in Milliseconds) from the end of the current onDrawFrame iteration to the start of the next. This is what I've found: When not

How do you apply light sources using OpenGL ES 2.0?

本小妞迷上赌 提交于 2020-01-01 00:50:14
问题 I am trying to find any tutorial or sample code which explains and shows the usage of lights in OpenGL ES 2.0. Most of the material I have seen online refers to Opengl ES 1.1. Can anyone provide any links or documentation on how to do lighting in OpenGL ES 2.0? 回答1: The difficulty with OpenGL ES 2.0 is that since you can write your own shaders pretty much how you want, there's no one set way to provide lighting to an object. It will depend on how you want to present your content. That said,

How to efficiently copy depth buffer to texture on OpenGL ES

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 00:43:13
问题 I'm trying to get some shadowing effects to work in OpenGL ES 2.0 on iOS by porting some code from standard GL. Part of the sample involves copying the depth buffer to a texture: glBindTexture(GL_TEXTURE_2D, g_uiDepthBuffer); glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, 0, 0, 800, 600, 0); However, it appears the glCopyTexImage2D is not supported on ES. Reading a related thread, it seems I can use the frame buffer and fragment shaders to extract the depth data. So I'm trying to

Creating blur filter with a shader - access adjacent pixels from fragment shader?

て烟熏妆下的殇ゞ 提交于 2019-12-31 22:39:46
问题 I want to create a blur effect using a fragment shader in OpenGL ES 2.0. The algorithm I am interested in is simply an averaging blur - add all adjacent pixels to myself and divide by 9 to normalize. However I have 2 issues: 1) does this require me to first render to a framebuffer, then switch rendering targets? Or is there an easier way 2) assume I bind my "source" image to blur as texture 0, and I'm outputting my blurred texture. How do I access the pixels that aren't the one I'm current

Android EGL/OpenGL ES Frame Rate Stuttering

痴心易碎 提交于 2019-12-31 14:55:37
问题 TL;DR Even when doing no drawing at all, it seems impossible to maintain a 60Hz update rate on an OpenGL ES rendering thread on an Android device. Mysterious spikes frequently crop up (demonstrated in the code at bottom), and every effort that I've made to figure out why or how has lead to a dead end. Timing in more complicated examples with a custom rendering thread has consistently shown eglSwapBuffers() to be the culprit, frequently coming in over 17ms-32ms. Help? More Details This is

Differences between GLSL and GLSL ES 2

会有一股神秘感。 提交于 2019-12-31 08:45:32
问题 Two questions really... Is GLSL ES 2 a totally separate language, or a special version of GLSL? What are the differences between them, in terms of "standard library" functions, syntax and capabilities? I am writing shaders for an application targeted at Windows, Mac and iPad and I would prefer not to have to add more versions of each shader - well simpler shaders anyway. 回答1: Is GLSL ES 2 a totally separate language, or a special version of GLSL? Every version of GLSL is ultimately a "totally

How to draw a star in iOS OpenGL ES 2.0

大兔子大兔子 提交于 2019-12-31 07:18:21
问题 This question has been asked before but the quite a few years ago in my searches. The answer was always to use texture mapping but what I really want to do is represent the star as a single vertex - you may think I'm copping out with a simplistic method but in fact, a single point source of light actually looks pretty good and realistic. But I want to process that point of light with something like a gaussian blur too give it a little more body when zooming in or for brighter stars. I was