opengl-es-2.0

Images and mask in OpenGL ES 2.0

不想你离开。 提交于 2019-11-29 09:30:03
I'm learning OpenGL ES 2.0 and I'd like to create an App to better understand how it works. The App has a set of filter that the user can apply on images (I know, nothing new :P). One of this filter takes two images and a mask and it mixes the two images showing them through the mask (here an image to better explain what I want to obtain) At the moment I'm really confused and I don't know where to start to create this effect. I can't understand wether I have to work with multiple textures and multiple FrameBuffers or I can just work with a single shader. Do you have any hint to help me in

How can I use a 3-D texture in iOS?

纵然是瞬间 提交于 2019-11-29 09:13:46
问题 I can't find the glTexImage3D() function from OpenGL in OpenGL ES 2.0. So how can I use a 3-D texture, eg: a .tga file? Does someone know how to use a 3-D texture in OpenGL ES 2.0? 回答1: OpenGL ES 1.x and 2.x doesn't mandate support for 3d textures — see e.g. the canonical man page for glBindTexture, which lists only GL_TEXTURE_2D and GL_TEXTURE_CUBE_MAP as targets — and the iOS hardware doesn't provide any suitable extension. The best solution I've been able to come up with is packing a 3d

Android OpenGL demo “No config chosen”

大兔子大兔子 提交于 2019-11-29 09:06:15
I'm having a real problem with the Google's OpenGL demo for Android . I set it up in Eclipse but can't get it to execute. It builds with no problems, but then stops at "java.lang.IllegalArgumentException: No config chosen" right before it opens. I've been up and down Google searches and Stack threads with no solution. I did find what I thought was a lead here: OpenGL ES 2.0 Support for Android? It uses a command gLSurfaceView.setEGLConfigChooser(8 , 8, 8, 8, 16, 0); but alas, I'm new to OpenGL on android and don't know where to put it... Any help would be greatly appreciated. I'm running

Get supported GLSL versions

戏子无情 提交于 2019-11-29 08:47:59
问题 While developing on a laptop with an intel graphics card, while compiling a vertex shader, i got this: 0:1(10): error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES ok, so i adapt the shader to use version 300 ES. Meanwhile, i want to check what GLSL versions the current driver/card supports, so i use this: glGetString ( GL_SHADING_LANGUAGE_VERSION ) Which, to my dismay, returns only "1.30". How can i get the full list? Or even if it's not the full

How do I methodically choose the near clip plane distance for a perspective projection?

夙愿已清 提交于 2019-11-29 06:55:49
问题 I have a 3D scene and a camera defined using gluPerspective. I have a fixed FOV, and I know the minimum distance of any geometry to the camera (it is a first-person view, so that is the minimum distance from the viewpoint to the character's collision volume). How can I choose the farthest near clip plane (for the best depth buffer resolution) which will will not cause any clipping , no matter how the player moves and looks? These distances are not simply equal because the corners of the near

iPhone: Display a semi-transparent video on top of a UIView?

跟風遠走 提交于 2019-11-29 04:48:05
is it possible to have semi-transparent video (created with blue-screen) playing on top of a UIView ? I was wondering that in case that's not doable with the MPMoviePlayerViewController it might be by using OpenGL ES and a video texture ? Thank you in advance, F. It is possible using the ffmpeg library. Here is the link, where you can download a very good example link Then you just have to set the alpha property to the UIImageView. But i'm not sure about performance, try :) 来源: https://stackoverflow.com/questions/4796626/iphone-display-a-semi-transparent-video-on-top-of-a-uiview

WebGL shaders: maximum number of varying variables

馋奶兔 提交于 2019-11-29 04:21:26
From the OpenGL ES spec section 2.10.4 (Shader Variables: Varying Variables): The number of interpolators available for processing varying variables is given by the implementation-dependent constant MAX_VARYING_VECTORS . This value represents the number of four-element floating-point vectors that can be interpolated; varying variables declared as matrices or arrays will consume multiple interpolators. When a program is linked, any varying variable written by a vertex shader, or read by a fragment shader, will count against this limit. A program whose shaders access more than MAX_VARYING

OpenGL ES 2.0 Vertex Transformation Algorithms

送分小仙女□ 提交于 2019-11-29 04:19:52
I'm developing an image warping iOS app with OpenGL ES 2.0. I have a good grasp on the setup, the pipeline, etc., and am now moving along to the math. Since my experience with image warping is nil, I'm reaching out for some algorithm suggestions. Currently, I'm setting the initial vertices at points in a grid type fashion, which equally divide the image into squares. Then, I place an additional vertex in the middle of each of those squares. When I draw the indices, each square contains four triangles in the shape of an X. See the image below: After playing with photoshop a little, I noticed

How do I blend two textures with different co-ordinates in OpenGL ES 2.0 on iPhone?

帅比萌擦擦* 提交于 2019-11-29 04:06:17
I can blend two textures with different blending modes in the fragment shader when both the textures covers the same rectangles. But now my problem is, one texture is a plain rectangle with no rotation and the other texture is another rectangle with a rotation/scale and translation. How do I merge these textures in the way I want? (In the picture) I know how to do this... But not sure how to do this... For blending textures in one rectangle (the first image), I used the following code.. Objective C code... - (void) display { [EAGLContext setCurrentContext:context]; glBindFramebuffer(GL

Polygon triangulation into triangle strips for OpenGL ES

房东的猫 提交于 2019-11-29 03:09:29
问题 I am looking for a fast polygon triangulation algorithm that can triangulate not very complex 2D concave polygons (without holes) into triangle strips ready to be sent to OpenGL ES for drawing using GL_TRIANGLE_STRIP . I am aware of some algorithms but I couldn't find one that will fit my needs: http://www.flipcode.com/archives/Efficient_Polygon_Triangulation.shtml this algorithm works ok but the problem is it returns simple triangles which you can't draw with GL_TRIANGLE_STRIP , you need to