glsurfaceview

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) {

Record GLSurfaceView on < Android 4.3

风流意气都作罢 提交于 2019-12-08 10:36:13
问题 I'm developing an app for applying effects to the camera image in real-time. Currently I'm using the MediaMuxer class in combination with MediaCodec . Those classes were implemented with Android 4.3. Now I wanted to redesign my app and make it compatible for more devices. The only thing I found in the internet was a combination of FFmpeg and OpenCV, but I read that the framerate is not very well if I want to use a high resolution. Is there any possibility to encode video in real-time while

Text only thing visible after pausing GLSurfaceView on Galaxy S3 - Text blur when moved. No button backgrounds

送分小仙女□ 提交于 2019-12-08 07:08:45
问题 I'm getting some STRANGE behavior on a Galaxy S3 (none of my other test devices (not S3s) bug out like the following). Scenario: I'm taking YUV data via JNI from an RTSP stream processed by libffmpeg. I take these values and feed them into C++ code using openGL so they may be mapped to a texture. (Basically, display the video from an RTSP stream in openGL). Issues: I've been trying to add an overlay to the video (with normal Android widgets/views/xml) and I noticed on the Galaxy S3 (nowhere

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

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

Rendering camera into multiple surfaces - on and off screen

北城余情 提交于 2019-12-07 15:24:22
问题 I want to render the camera output into a view and once in a while save the camera output frame to a file, with the constraint being - the saved frame should be the same resolution as the camera is configured, while the view is smaller than the camera output (maintaining the aspect ratio). Based on the ContinuousCaptureActivity example in grafika, I thought the best approach would be to send the camera to a SurfaceTexture and generally rendering the output and downscaling it into a

Android: how to display admob ads on GLSurfaceView

巧了我就是萌 提交于 2019-12-07 14:31:39
问题 I am currently able to get the admob ads on ui view (in separate test project ), but i want to display this ad in GLSurfaceView . I tried to load the ad in onCreate( ) method of activity and in present method of my screen (where all rendering is done) i called MyGameActivity.mAdView.bringToFront(); //thought it will bring the ad in front of all the game objects. now on running the project i can see the message in logcat window Recieved ad url "big url" but i cant see the ad on screen. In my

Image effects with rotation and pinch to zoom using GLSurfaceView Android

此生再无相见时 提交于 2019-12-07 01:24:54
问题 I was developing an application to apply effects/rotation/pinch to zoom in-out functionality on image. I have downloaded demo application from https://github.com/Grishu/ImageEffects. It works well, now my problems/questions are as below: Apply multiple effects on images with progress change value (e.g. First apply brightness effect and result of this apply another effect say "contrast".) - problem: in code effect always apply on original image. So change in code to apply effect on final image

Why is glClear blocking in OpenGLES?

耗尽温柔 提交于 2019-12-06 22:18:33
问题 I'm trying to profile my renderer, and I'm seeing some weird profiling behavior that I can't explain. I'm using a glSurfaceView, which I have set to render continuously. This is how my onDrawFrame() is structured public void onDrawFrame(GL10 unused) { GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT); executeAllDrawCommands(); } This was behaving slowly under light load, so I created a timer class and started to profile this some. I was quite surprised by what I saw. I