opengl-es-2.0

Multi-textured Point Sprites in OpenGL ES2.0 on iOS?

℡╲_俬逩灬. 提交于 2019-12-07 11:34:29
问题 I am trying to make a multi-textured point sprite for an iphone application using OpenGL ES 2.0. I can't find any examples of this on web, and it doesn't seem to be working. Is there some built-in limitation where gl_PointCoord can't be used on multiple textures when using GL_POINTS mode for point sprites? uniform sampler2D tex; uniform sampler2D blur_tex; vec4 texPixel = texture2D( tex, gl_PointCoord ); vec4 blurPixel = texture2D( blur_tex, gl_PointCoord ); I'm sure I am passing in the

In OpenGL ES 2.0, how can I draw a wireframe of triangles except for the lines on adjacent coplanar faces?

旧巷老猫 提交于 2019-12-07 11:27:31
问题 I vaguely remember seeing something in OpenGL (not ES, which was still at v1.0 on the iPhone when I came across this, which is why I never used it) that let me specify which edges of my polygons were considered outlines vs those that made up the interior of faces. As such, this isn't the same as the outline of the entire model (which I know how to do), but rather the outline of a planar face with all its tris basically blended into one poly. For instance, in a cube made up of tri's, each face

iPhone iOS 5.0 OpenGl ES 2.0

给你一囗甜甜゛ 提交于 2019-12-07 11:24:10
问题 Seriously i've been looking for weeks, even months for some serious help with OpenGl on the iPhone with XCode 4.2, I need a good tutorial on how to begin with the 'OpenGL Game' template with the new XCode 4.2 and then progress from there to actually understand how to make my game come to life. I have a lot of experience with Windows and XNA with shaders and all the maths involved and i already have an app on the App Store that doesn't use OpenGL but i just can't get started with it, please

iPhone OpenGL ES 2.0 blending with Cocos2D gives unexpected results

Deadly 提交于 2019-12-07 10:24:52
问题 I have very simple CCScene with ONLY 1 CCLayer containing: CCSprite for background with standard blending mode CCRenderTexture to draw paint brushes, with its sprite attached to root CCLayer above background sprite: _bgSprite = [CCSprite spriteWithFile:backgroundPath]; _renderTexture = [CCRenderTexture renderTextureWithWidth:self.contentSize.width height:self.contentSize.height]; [_renderTexture.sprite setBlendFunc:(ccBlendFunc){GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}]; [self addChild:_bgSprite

How do you get rajawali to work (tutorial 1 on git)

…衆ロ難τιáo~ 提交于 2019-12-07 06:58:22
问题 I am quite new to android development, I know the basics activities, maps, sqlite, etc. I would like to be able to implement some 3D objects to be able to interact with within my apps. After a bit of searching I found that rajawali seems to be the best method. As you do I started with the first tutorial and reading the source code from the example docs. Where I have become lost is I have followed the tutorial word for word and and I cant run the application due to errors in the script. If

Using OpenGL ES texture caches instead of glReadPixels to get texture data

喜欢而已 提交于 2019-12-07 05:34:32
问题 In iOS 5, OpenGL ES Texture caches were introduced to provide a direct way from the camera video data to OpenGL without the need of copying the buffers. There was a brief introduction to texture caches in session 414 - Advances in OpenGL ES for iOS 5 of WWDC 2011. I found an interesting article which abuses this concept further in the end and circumvents a call to glReadPixels by simply locking the texture, and then accessing the buffer directly. glReadPixels is really slow due to the tile

onSurfaceChanged called twice

别来无恙 提交于 2019-12-07 05:23:43
问题 I'm creating an Android application using openGL ES, and I have following problem: When I minimize the application, then reopen it, onSurfaceChanged in my GLSurfaceView.Renderer is called 2 times. I have the following code in onSurfaceChanged (and similar code in onSurfaceCreated,onDrawFrame): Log.e("onSurfaceChanged",Integer.toString(width)+" "+Integer.toString(height)); So I get the following log: onSurfaceCreated onSurfaceChanged 480 800 onDrawFrame onSurfaceChanged 480 800 onDrawFrame

iOS OpenGL ES Logical Buffer Loads

喜夏-厌秋 提交于 2019-12-07 03:16:43
问题 Slogging through the list of OpenGL API usage performance warnings given by the Analyze instrument, I am finding that we are generating several logical buffer loads per frame - places where we are not clearing a buffer because a draw call completely overwrites it. Counterintuitively, introducing glClear() calls for these cases simply moves the location of the warning to the glClear() calls. Apple implement GL_EXT_discard_framebuffer , however using this on its own is also not sufficient to

How to draw a texture into a quad with OpenGL ES 2?

杀马特。学长 韩版系。学妹 提交于 2019-12-07 03:10:01
问题 Quads are not included in OpenGL ES 2.0 as they were in 1.1. With the programmable pipeline offered by OpenGL ES 2.0, how can I simply draw a texture (originally a png file) into 4 defined points? Do I need a VBO? Do I need to compute a perspective matrix? All these things are messy for me... The platform used is the iPhone. 回答1: I found the answer. It is mandatory to use a perspective matrix and a shader, even for such a simple task. This answer helped me to do it. Here is the code I used,

OpenGL ES black texture on Nexus S

有些话、适合烂在心里 提交于 2019-12-07 02:51:57
问题 OpenGL code that works on the Nexus One will not work properly on the Nexus S. Textures don't seem to render and I'm left with just black where textures should be. Anyone got any ideas? 回答1: The accepted answer given here addresses this issue in slightly more depth than I will, but while this black screen issue does arise from the Nexus S (and some other devices) being strict about power-of-two textures, it does not mean that textures need to have dimensions that are a Po2 . In the texture