opengl-es

How to read depth texture attached to FBO in WebGL2

做~自己de王妃 提交于 2019-12-08 13:52:08
问题 I'm now working on the deferred shading using WebGL2.0. One primary problem I'm now facing is that I can't read the depth value from the DEPTH_ATTACHMENT. Actually I creat my own GBuffer with a DEPTH24_STENCIL8 texture as DEPTH_ATTACHMENT, then I bind this texture to the sampler and try to read the value in my fragment shader in deferred shading part like this: uniform sampler2D u_depthSampler; vec4 depthValue = texture(u_depthSampler, v_uv); Then I set the depthValue as output in my shading

How can i convert an oval to circle openGL ES2.0 Android

心已入冬 提交于 2019-12-08 13:46:11
问题 I have been working on an openGL ES 2.0 Android project. My objective is to create a circle. From the help that i got from online, i managed to run this code which is suppose to give a circle in the view,but instead i got an oval. I tried many ways to make it circle. Any help shal appreciated Thanks import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import android.opengl.GLES20; import android.util.Log; public class Circle { private int mProgram,

Rotating Android Camera Preview by 90 degrees on GLSurfaceView using OpenGL 2.0 APIs

余生长醉 提交于 2019-12-08 13:36:44
问题 Note I am new to both Android and OpenGL. I using the code to display Android Camera Preview on the screen. I would like to rotate the Camera angle by 90 degrees using OpenGL 2.0 (to match my camera in portrait resolution since my App is in portrait mode) in the class ' MainRenderer' below. I have looked into Android camera rotate but it did not execute rotation. Setting "android:rotation='90'" in layout xml rotates surface view but yields black surface - no camera preview. Since I am using

Decoding video directly into a texture in separate thread

为君一笑 提交于 2019-12-08 13:13:20
问题 Is it possible to decode video using ffmpeg capabilities directly into texture asynchroniously? I need to output the video onto a geometry. There is mpv video player, which can output video directly into framebuffer and uses other close to metal features, but is there minimalistic example, which suitable for embedded devices (OpenGL ES 2.0 or 3.0)? It would be nice if texture won't leave GPU memory during whole the frame time. 回答1: I currently use sws_scale to trim the edges off mpegts

Ray Tracing a scene with triangle meshes with webgl 2.0, deferred shading, framebuffers [closed]

人走茶凉 提交于 2019-12-08 13:11:07
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago . after my original post was flagged as "too broad" by other stack overflow users. I will rephrase my question in less lines. I have implemented a ray marcher in shadertoy, and i understood all the math about the ray-object intersection. And i want to make the next step to ray

OpenGL debugging

大兔子大兔子 提交于 2019-12-08 12:48:13
问题 When I write OpenGL (1.0) programs for Android, I found it not easy to debug my programs. OpenGL is just a fixed pipeline of several steps which process vertex coordintates. Is there any way to peek and see what are results of consecutive steps of the pipeline? Added: Mad Scientist, thanks for your advice. However, I tried to use Tracer for OpenGL ES (following instructions from http://developer.android.com/tools/help/gltracer.html ) and I'm still not sure on how do I find the information I

OpenGL ES 2.0: How to improve frame rate of drawing sprites?

≡放荡痞女 提交于 2019-12-08 12:45:08
问题 I have an animated background layer that is built on top of OpenGL ES 2.0 and I am using GLKView as graphics container and GLKViewController as controller. For drawing I use GLKBaseEffect. I introduced a sprite class that can load png-files as textures, manipulate the sprite (SRT) and some additional properties like alpha blending and so on. I am wondering how I could optimise my program, since the frame-rate drops on my iPhone 4S to about 25 FPS when displaying 50 sprites (all with the same

Iphone OpengGL ES: detecting clicks on a primitive

天涯浪子 提交于 2019-12-08 12:18:52
问题 I have created a 3d environment full of 3D cubes, does anyone have any idea how you would detect a touch on one of these Cubes. I thinking if I could get the cubes screen position (coords start from bottom left) then it would be pretty easy UPDATE: I added the function -(CGPoint)getScreenCoorOfPoint:(IMPoint3D)_point3D which seems to give me my items position in the world but the bit I am now stuck on is: I have objects that have a position I have my position in the world (gluLookAt eye[0],

how to add 3d models dynamically in glsurface view renderer in android

扶醉桌前 提交于 2019-12-08 12:13:13
问题 In my Augmented reality application I need to render 3D model over a marker. with predefined/ initialized 3d model i can show teapot over a marker detecion. but now I want to replace it with another 3d model dynamically from sd card on some trigger event like button click. is there any suggestion or guideline how i can implement it? I am using JPCT-AE for 3d models. Thanx 回答1: After so much research and trial and errors finally i got it to work. When I asked this question I wanted to display

OpenGL byte-buffer with OpenCV face detection

血红的双手。 提交于 2019-12-08 11:58:11
问题 I am trying to overlay stickers on face using OpenCV and OpenGL. I am getting the ByteBuffer inside the onDrawFrame: @Override public void onDrawFrame(GL10 unused) { if (VERBOSE) { Log.d(TAG, "onDrawFrame tex=" + mTextureId); } mSurfaceTexture.updateTexImage(); mSurfaceTexture.getTransformMatrix(mSTMatrix); byteBuffer.rewind(); GLES20.glReadPixels(0, 0, mWidth, mHeight, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, byteBuffer); mat.put(0, 0, byteBuffer.array()); if (mCascadeClassifier != null) {