opengl-es

How to render multiple solid cut planes?

ⅰ亾dé卋堺 提交于 2019-12-08 03:29:59
问题 I'm rendering some cut planes to do solid capped clipping using stencils in OpenGL. Each cut plane works fine by itself, but I want to be able to create multiple cut planes at the same time. The problem I'm running into is when I cut an object with a second cut plane, in certain view orientations there are no back faces to use to create a stencil to draw the capping plane. I know there must be some way to work with multiple stencil buffers to get what I want, but I just can't think of the

fast method to get RGB data from UIImage (photo library)

时光怂恿深爱的人放手 提交于 2019-12-08 03:17:24
问题 I would like to get a data array containing the RGB representation of a picture stored in the photo library (an ALAsset) on iOS (ios8 sdk). I already tried this method : get the a CGImage from ALAsset with [ALAssetRepresentation fullScreenImage] draw the CGImage to a CGContext. That method works, I get a pointer to rgb data, but this is really slow (there are 2 conversions). The final goal is to load the image quickly in a OpenGL texture. My code to get an image from Photo library ALAsset*

Mask and Clip GLSurfaceView

大憨熊 提交于 2019-12-08 03:09:56
问题 I work with an SDK that provides a rectangular glsurfaceview through a callback. I want to be able to render this view in a circular layout. (i.e.) I would like to display the view on a circular view I have tried using masking layout such as using a maskable layout https://github.com/christophesmet/android_maskable_layout (works great for images, not so much for videos) How do I go about clipping and rendering this as a circle? (The background is constantly changing, so i cant overlay a

OpenGL ES 2.0 Context in Android

给你一囗甜甜゛ 提交于 2019-12-08 03:02:27
问题 I'm new to OpenGL on Android and I have read heavily documented samples, and I kinda understand it. But before trying to do anything complex, I want to draw a simple 2D white rectangle on a black bacground. Nothing else. I'm stuck at this error: call to OpenGL ES API with no current context , which seems to be that I'm calling something from the non-OpenGL Thread . The thing is that I'm not sure what is called from the OpenGL Thread . So here's my code //============== Activity ==============

SpriteKit and UIKit compatibility: OpenGL error when migrating to Swift 2?

匆匆过客 提交于 2019-12-08 02:45:00
问题 I just don't understand what is going on since I migrated to Swift 2. I have a Tabbed application and I am getting this error: <CAEAGLLayer: 0x7fb2e053fb40>: calling -display has no effect. Assertion failed: (length + offset <= _length), function commit_data, file /BuildRoot/Library/Caches/com.apple.xbs/Sources/Jet_Sim/Jet-1.50/Jet/jet_types_OpenGL.h, line 863. I know it is really vague but I don't know where to start looking for bugs. Thanks. Edit: I just realized it might be related to the

android - How do I draw a wireframe over object in opengl 2.0?

时间秒杀一切 提交于 2019-12-08 02:39:35
问题 I have a tetrahedron object created in openGL ES 2.0. What I'm trying to achieve is to show the actual wireframe of the polygon over its base color. Is there a method for achieving this effect? Also, my tetrahedron is pink. How can I change its color? 回答1: In addition to what Jave said. Instead of enlarging the whole object (whose optimal amount always depends on the object and the current view) to prevent z-fighting artefacts, you can also use the polygon offset (using glPolygonOffset),

mat3 attribute in WebGL

时光毁灭记忆、已成空白 提交于 2019-12-08 02:09:22
问题 I'm attempting to use the ANGLE_instanced_arrays extension in WebGL to render multiple instances of an object with different mat3 transformation matrices. This is the code related to the buffer for my matrices: //setup this.shaderProgram.transformAttribute = gl.getAttribLocation(this.shaderProgram, "transform"); ext.vertexAttribDivisorANGLE(this.shaderProgram.transformAttribute, 1); this.transformBuffer = gl.createBuffer(); //each render gl.enableVertexAttribArray(this.shaderProgram

opengl es api with no current context

泪湿孤枕 提交于 2019-12-08 01:34:35
问题 I have looked through the solutions and haven't really found one. I am getting this error because it seems like the execution happens outside of the gl thread. However I am not sure how to fix this. The code is as follows: public shape() { super(); vertexShader = Shader.loadShader(GLES20.GL_VERTEX_SHADER, vertexShaderCode); //<============ fragmentShader = Shader.loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentShaderCode); ByteBuffer buffer = ByteBuffer.allocateDirect(getCoordinates().length *

Problem reading data by glreadpixel() while using depth buffer and anti-aliasing technique

心不动则不痛 提交于 2019-12-08 01:26:59
问题 I want to capture the screen of my game using glreadpixel(). it works fine over simulator also on 2g iphone with ios version 3.1.1 . but on ipad with ios version 4.2.1 it doesnt . i came to know the issue regarding this. for ios version 4.0 above on a particular device (ipad) we bind depth buffer and use anti-aliasing technique. And when we use glreadpixel() of opengl that capture data from frame buffer returns all 0 in the destination buffer... if we dont bind the depth buffer to frame

SurfaceView or TextureView combination

吃可爱长大的小学妹 提交于 2019-12-08 01:12:14
问题 I am trying to apply real-time effects to camera preview and show in multiple views , how can I do? (just like the camera2) (snapshot) I know 2 approaches to show real-time effects on camera preivew if no ScrollView involved on the left side. Use GLSurfaceView and setRenderer. Bind SurfaceTexture as GLES external texture, and use GLSL(OpenGL Shading Language) to apply effects. Use TextureView. It is more complex because need to setup EGLContext/EGLSurface and do thread management. However, I