opengl-es

THREEJS : Vertex Color Baking

落爺英雄遲暮 提交于 2019-12-17 20:27:30
问题 When coloring a mesh using vertex coloration, how does one save the colors as a texture? For example, if a mesh is colored based on its normals (similar to this example), how can one create a .png for the texture? For this purpose, it can be assumed that this mesh has texture coordinates. 来源: https://stackoverflow.com/questions/27697456/threejs-vertex-color-baking

Render Bitmap frames to Surface for encoding

为君一笑 提交于 2019-12-17 20:27:05
问题 My goal is to take in a M4V video file, decode a segment of the video as PNG frames, modify these frames, and re-encode the trimmed video (also to M4V). The workflow is like so: [Input Video] -> Export Frames -> Modify Frames -> Encode Frames -> [Output Video] . For the decode process, I have been referencing the bigflake examples. Using the ExtractMpegFramesTest example code I was able to generate Bitmap frames from an .m4v file and export frames as PNG files. Now I am attempting the re

Blur Effect (Wet in Wet effect) in Paint Application Using OpenGL-ES

回眸只為那壹抹淺笑 提交于 2019-12-17 19:56:10
问题 I am developing Paint application using OpenGL-ES for iPhone and i want to implement Gaussian blur effect(Wet in Wet) for painting. Please have look at the image describing my requirement for Blur effect : I tried to search how for OpenGL function but did not get anything. Can anyone guide me to a right direction in this problem.. Any kind of help or suggestion will be highly appreciated.. Thanks.. 回答1: You should be able to render the same brush stroke many times pixels apart to get the

How to save bitmap from GLSurfaceView (Only bitmap, not whole texture)

牧云@^-^@ 提交于 2019-12-17 18:59:48
问题 I am using this code to give multiple effect on bitmap that is on GlSurfaceView. apply-effects-on-image-using-effects Now, I want to save the bitmap. They have given the code to save the bitmap but with that, whole GlSurfaceView is going to be saved as bitmap image. Instead I want to save only bitmap area to save as Image. There is method that takes pixels and make bitmap from that and also make image. e.g.: public Bitmap takeScreenshot(GL10 mGL) { final int mWidth = mEffectView.getWidth();

Android — GLSurfaceView EGL_BAD_ALLOC

隐身守侯 提交于 2019-12-17 18:27:30
问题 My program switches between two Activities that each inflate a derived GLSurfaceView that uses VBOs. After switching back and forth between the two Activities a few times, the program crashes and throws the following exception. Each time there is a context switch the VBO buffers are deleted, onStop() is called, and a new instance of the next Activity's GLSurfaceView is inflated. I refactored the program to run on only one GLSurfaceView and Activity , and the program seems to run without

Shader for Android OpenGL ES

偶尔善良 提交于 2019-12-17 18:19:00
问题 Is it possible to use vertex or pixel shaders in android app? please give an example if possible of setting up shader. 回答1: If you're targetting andriod 2.x / OpengL ES 2, then yes, it's possible. Here is a code example of how to load a shader: public int createProgram(String vertexSource, String fragmentSource) { int vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vertexSource); int pixelShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentSource); int program = GLES20.glCreateProgram()

How to use an OpenCV rotation and translation vector with OpenGL ES in Android?

六月ゝ 毕业季﹏ 提交于 2019-12-17 17:39:10
问题 I'm am working on a basic augmented reality application on Android. What I did so far is detect a square with opencv and then using cvFindExtrinsicCameraParams2() I calculated a rotation and translation vector. For this I used 4 object points, which are just the corners of a square around (0,0,0) and the 4 corners of the square in the image. This yields me a pretty good rotation and translation matrix. I also calculated the rotation matrix with cvRodrigues2() since using this is easier than

Choose OpenGL ES 1.1 or OpenGL ES 2.0?

北城余情 提交于 2019-12-17 17:36:18
问题 I'm going to start a new cross-plattform openGL project (primary for iPhone & PC). So theres the main question: targeting for OpenGL ES 1.1 or OpenGL ES 2.0? Or both? So far I read Open GL ES 1.1 isnt really deprecated, isn't it? So what would speak for openGL ES 2.0? Programmable vertex- & fragmentshader - Anything else? I heard about performance decrease with alpha blending or so - can that be true? I assume openGL ES 2.0 code should also run on PC - So is openGL ES 2.0 is really more

Warp \ bend effect on a UIView?

余生颓废 提交于 2019-12-17 17:34:28
问题 I'm trying to get a similar effect to the one described in the pictures. The white area on the left isn't on the original photo, it pushes the pixels away. I've tried using Core Image (which offered a few close effects to this) but it was too slow for my needs. I need the effect to be snappy so I can make it responsive to touch. Is there a close effect \ animation in the iOS sdk that does something similar to this with a UIVIew? ( I couldn't find anything close) If not, can someone offer how

What does `precision mediump float` mean?

大城市里の小女人 提交于 2019-12-17 17:34:02
问题 In the learningwebgl tutorial1 I've found an interesting line in the fragment shader. precision mediump float; I've found an article about it here, but I still can't understand what does it mean? And if I remove this line, nothing changes. Everything is the same. So what does precision mediump float mean? 回答1: This determines how much precision the GPU uses when calculating floats. highp is high precision, and of course more intensive than mediump (medium precision) and lowp (low precision).