opengl-es

GLES20.glReadPixels gets all zero in android

老子叫甜甜 提交于 2019-12-10 18:14:15
问题 Hello guys~I want the screen can show what color of the pixel we touched, then I use GLES20.glReadPixels as follow. As shown on logcat, it always reads 0 0 0 0 no matter where I clicked. I also changed index according to width and height of the screen, but still getting all zeros. I know it should be very easy to do that, but I really have no idea on how to solve it. Can anybody give me a hand? Thank you so much! public String getFace(float angleX, float angleY, float positionX, float

GPUImage2: passing gl texture to shader

♀尐吖头ヾ 提交于 2019-12-10 17:53:38
问题 I'm trying to modify GPUImage2 Crosshair generator to replace default crosshairs with gl texture made of UIImage, my image is 128x128 png file. I'm using GPUImage2 PictureInput for converting UIImage to gl texture and it returns the instance of PictureInput without any issues/warnings. Next I'm modifying CrosshairVertexShader to add support of the new texture: uniform sampler2D inputImageTexture; attribute vec4 position; varying vec2 centerLocation; varying float pointSpacing; void main() {

Render 3d Objects into Cameraview

一笑奈何 提交于 2019-12-10 17:49:02
问题 I tried to develop a mobile cardboard application, which renders 3d objects into a camera view (some kind of ar). I used this project and tried to render a simple cube in the camera: https://github.com/Sveder/CardboardPassthrough/ I didn't get it working, the background is always black or the app wrecked. I would be very grateful for any help or suggestions. Thanks Thats what i have Origin CardboardPassthrough here is the working code, with the cubes import android.content.Context; import

IllegalArgumentException from gluUnProject

怎甘沉沦 提交于 2019-12-10 17:42:20
问题 I get this error message 08-30 19:20:17.774: ERROR/AndroidRuntime(4681): FATAL EXCEPTION: GLThread 9 08-30 19:20:17.774: ERROR/AndroidRuntime(4681): java.lang.IllegalArgumentException: length - offset < n 08-30 19:20:17.774: ERROR/AndroidRuntime(4681): at android.opengl.Matrix.multiplyMV(Native Method) 08-30 19:20:17.774: ERROR/AndroidRuntime(4681): at android.opengl.GLU.gluUnProject(GLU.java:237) 08-30 19:20:17.774: ERROR/AndroidRuntime(4681): at android.app.ui.GLSurfaceRenderer.vector3

WebGL: Declining support for OES_texture_float on Android

纵然是瞬间 提交于 2019-12-10 17:29:59
问题 Does anybody know what the deal is with declining support for the WebGL extension OES_texture_float on Android over the years? https://webglstats.com/webgl/extension/OES_texture_float?platforms=000000000010000400 Is this a data collection error of some sort, or is the support really declining? If you take Android out of the filter then `OES_texture_float is supported on basically 100% of the other mainstream mobile and desktop platforms: https://webglstats.com/webgl/extension/OES_texture

Luminance histogram calculation in GPU-android opengl es 3.0

余生长醉 提交于 2019-12-10 17:28:58
问题 For Luminace histogram calculation I have used the code from the project GPU image ios by Brad Larson. He has used blending for Histogram calculation. Attaching the Vertex and Fragment shader Vertex shader #version 300 es in vec4 position; out vec3 colorFactor; const vec3 W = vec3(0.299, 0.587, 0.114); void main() { float luminance = dot(position.xyz, W); colorFactor = vec3(1.0, 1.0, 1.0); gl_Position = vec4(-1.0 + (luminance * 0.00784313725), 0.0, 0.0, 1.0); gl_PointSize = 1.0; } ; Fragment

How to detect the chipset in android device? [closed]

泄露秘密 提交于 2019-12-10 17:22:51
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I need to detect the chipset of the android device. So I can disable certain functionality on MediaTek chipset. (1080p encoding as discussed in this question MediaCodec Encoded video has green bar at bottom and chrominance screwed up) I have taken a look at http://developer.android.com/reference/android/os/Build

How to implement “circular side-scrolling” in my game?

怎甘沉沦 提交于 2019-12-10 16:49:16
问题 I'm developing a game, a big part of this game, is about scrolling a "circular" background ( the right end of the Background Image can connect with the left start of the Background image ). Should be something like this: ( Entity moving and arrow to show where the background should start to repeat ) alt text http://img89.imageshack.us/img89/9308/circular.jpg This happens in order to allow to have an Entity walking, and the background repeating itself over and over again. I'm not working with

Get some trounble when using drawBuffers in WebGL2

南笙酒味 提交于 2019-12-10 16:44:38
问题 I want to combine my deferred renderer and forward renderer together. In order to share the same depth buffer, I use a single frame buffer object with 4 color attachments, COLOR_ATTACHMENT0-2 for G-buffer rendering, COLOR_ATTACHMENT3 for deferred shading and forward rendering, here's the pesudo code: //**Gbufffer part** Bind G-Buffer FBO gl.drawBuffers([gl.COLOR_ATTACHMENT0, gl.COLOR_ATTACHMENT1, gl.COLOR_ATTACHMENT2]); draw the G buffer //**Lighting part** Bind Lighting buffer FBO //*

Get GPU info on Android without SurfaceView

本秂侑毒 提交于 2019-12-10 16:07:46
问题 On Android, is there a way to get GPU information without creating a SurfaceView? I'm not looking to draw anything using OpenGL, but I just need to get hardware information like vendor, OpenGL ES version, extensions available etc. 回答1: I am sorry I am not sure how to do that with Android but the function glGetString allows you to access the OpenGL information. Here is a sample C++ style code that will output the extensions supported by your hardware that I hope you'll be able to adapt to