opengl-es

How can I use a binary image to mask augmented reality with OpenGL and ARcore?

蓝咒 提交于 2020-01-16 08:35:51
问题 I need to render only some part of virtual object like in this image where part of Android Robot is hidden For doing this I use "Stencil Testing" and i draw with OpenGL a simple rectangle. The problem is that now I need the part "hidden" to be not static but dynamic and I have to choose the part to hidden from a binary image like this one where the black part needs to "hide" (like in the example before) the virtual object and virtual plane. The "mask" will be changed for every frame. 来源:

Specifying OpenGL Desktop instead of ES for Qt5

[亡魂溺海] 提交于 2020-01-16 05:35:33
问题 I am finally trying to wrap my head around shaders, using a tutorial I found. I decided to start with Qt5 (Windows) since I'm familiar with it and can focus on learning GLSL itself to start with. The only difference between what I'm doing and the tutorial is that I'm working with a QOpenGLWidget rather than a QOpenGLWindow (I just have a form with one widget on it, nothing special). To get started with a fragment shader, in Qt I added a new desktop (not ES) fragment shader to my project, and

Trying to set a texture from Java plugin in Unity 4.6

筅森魡賤 提交于 2020-01-15 15:34:32
问题 What i'm trying to do: Pull an image from sd-card on phone using Java Plugin. Unity passes a texture ID to plugin. Plugin uses opengl to assign the image to the texture in Unity through the ID. Will (eventually) be used to play a video clip from the phone in Unity, for now, it's just trying to change a texture outside of unity. My issue: When i call the method in the plugin, passing texture.GetNativeTextureID() into it, the texture does not change. I'm currently only using a simple black

Trying to set a texture from Java plugin in Unity 4.6

◇◆丶佛笑我妖孽 提交于 2020-01-15 15:33:44
问题 What i'm trying to do: Pull an image from sd-card on phone using Java Plugin. Unity passes a texture ID to plugin. Plugin uses opengl to assign the image to the texture in Unity through the ID. Will (eventually) be used to play a video clip from the phone in Unity, for now, it's just trying to change a texture outside of unity. My issue: When i call the method in the plugin, passing texture.GetNativeTextureID() into it, the texture does not change. I'm currently only using a simple black

Adding GLSurfaceView in layout

牧云@^-^@ 提交于 2020-01-15 13:19:59
问题 I am trying to run android samples http://developer.android.com/training/graphics/opengl/index.html I have to add some controls like text and buttons to the view which will look like How to use GLSurfaceView in Android layout? Main Activity (skipped some auto generated code) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mGLSurfaceView = (myGLSurfaceView) findViewById(R.id.glSurfaceViewID); //crashes }

Android video decoder not drawing to gles surface on lollipop only

不问归期 提交于 2020-01-15 12:17:11
问题 Briefly, I'm combining two open source apps into a new VR app, so this only runs on the Note 4 and S6 using the GearVR headset. My app works on kitkat, but the video is black on lollipop. The two source apps both work fine on lollipop. I have a surface created from a gl texture: glGenTextures( 1, &textureId ); glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureId); glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameterf(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG

Android Opengl Graphical Glitch

你离开我真会死。 提交于 2020-01-15 11:53:27
问题 Using Opengl 2.0 on android I am trying to create a class to help me draw square sprites from a texture atlas. I'm getting some weird graphical glitches(sometimes lines/ squares missing form textures), especially when the device is brought from sleep. Here is how it should look: Here is an example of the problem after waking the phone from sleep: and my code for the Renderer. package com.krazy.androidopengl; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer;

Spherical Impostors in three.js

强颜欢笑 提交于 2020-01-15 11:26:10
问题 I'm working to port a native OpenGL application to WebGL by using the three.js framework. I'm stumbling on the implementation of spherical impostors. Spherical Impostors are basically quads (or two triangles) that are rendered in a way that they always face the camera (much alike billboards). By employing custom vertex and fragment shaders, for every point on the rendered quad, a new position and normal are generated in a way that emulates a sphere. For a more detailed description you can

How to give 3D effects to UIImageView/uiview using OpenGL looks like a 3D CUBE

别来无恙 提交于 2020-01-15 10:17:11
问题 I am new to OpenGL and don't much have knowledge in it. I want to add a 3D effect to a UIImageView . How can I achieve this using OpenGL? I want to do something like seen in this image: I have searched and found that it is possible using OpenGL. I have referred to this link With OpenGL . I have created a cube, and got some effect with glDrawElements(GL_TRIANGLES, sizeof(Indices)/sizeof(Indices[0]), GL_UNSIGNED_BYTE, 0); But I come to know with glDrawRangeElements we can make a 3d cube, But I

CVOpenGLESTextureCacheCreateTextureFromImage failed

谁都会走 提交于 2020-01-15 06:22:32
问题 I had extract Y U V data from video frame separately and saved them in data[0],data[1],data[2];The frame size is 640*480;Now I creat the pixelBuffer as below: void *pYUV[3] = {data[0], data[1], data[2]}; size_t planeWidth = {640, 320, 320}; size_t planeHeight = {480, 240, 240}; size_t planeBytesPerRow = {640, 320, 320}; CVReturn renturn = CVPixelBufferCreateWithPlanarBytes(kCFAllocatorDefault, 640, 480, kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange, nil, nil, 3, pYUV, planeWidth,