opengl-es

How to render OpenGL in Flutter for Android?

谁说胖子不能爱 提交于 2019-12-12 08:53:18
问题 if (call.method.equals("createVideoRenderer")) { TextureRegistry.SurfaceTextureEntry entry = textures.createSurfaceTexture(); SurfaceTexture surfaceTexture = entry.surfaceTexture(); this.surfaceTexture = surfaceTexture; This is my java method call that creates my SurfaceTexture and saves it into my class instance. I've been reading about SurfaceTexture's class and this is how I understand it: I need to call surfaceTexture.setOnFrameAvailableListener(SurfaceTexture.OnFrameAvailableListener

Minimum required Texture Size for compliance with OpenGL-ES 2.0 on Android?

别来无恙 提交于 2019-12-12 08:33:51
问题 is there a minimum texture size a certain hardware needs to support to be compliant with the OpenGL-ES 2.0 specification ? Something like the GL_MAX_TEXTURE_SIZE value has to be at least 1024 or 2048 or something like that ? The reason I would like to know this is because I work on something that uses shaders and as such has to be OpenGL-ES 2.0. Therefore I would like to make the textures as big as possible without having to consider each and every hardware texture limitation (like the old

Why does GLSL's arithmetic functions yield so different results on the iPad than on the simulator?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 08:13:42
问题 I'm currently chasing some bugs in my OpenGL ES 2.0 fragment shader code which is running on iOS devices. The code runs fine in the simulator, but on the iPad it has huge problems and some of the calculations yield vastly different results, I had for example 0.0 on the iPad and 4013.17 on the simulator, so I'm not talking about small differences which could be the result of some rounding errors. One of the things I noticed is that, on the iPad, float1 = pow(float2, 2.0); can yield results

OpenGL-ES 2.0 VS OpenGL-ES 1.1, which is faster?

我怕爱的太早我们不能终老 提交于 2019-12-12 07:56:22
问题 I've written an app using OpenGL-ES 1.1, but am wondering if there are speed gains to be found by switching to 2.0. Has anyone done any tests with large polygon count models? I only want to render triangles that have different colors, nothing fancy. However, I am wanting to render about 1 million triangles for my comparison test. 回答1: OpenGL ES 1.1 and 2.0 provide two very different ways of doing 3-D graphics, so I don't know that direct performance comparisons make much sense. You're

Subtract Blend Mode using ColorMatrixFilter in Android?

[亡魂溺海] 提交于 2019-12-12 07:39:07
问题 I have the following ColorMatrixFilter. But I want to use it as a mask for Subtract-Blend mode, instead of using it directly. How do I go about achieving this? ColorMatrix: colorMatrix[ 0.393, 0.7689999, 0.18899999, 0, 0, 0.349, 0.6859999, 0.16799999, 0, 0, 0.272, 0.5339999, 0.13099999, 0, 0, 0, 0, 0, 1, 0 ]; 回答1: Long story short There is no subtract blending out of the box in Android. However you can achieve desired color blending using OpenGL. Here is the gist, that you can use like this:

zoom out in OpenGL in android

不打扰是莪最后的温柔 提交于 2019-12-12 07:38:39
问题 I m using 3D object and rendering it and showing it by extends GLSurfaceView implementing Renderer, the problem is that how to do zoom out-in with pinch-in and pinch-out. Below is my class package com.example.objLoader; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import android.content.Context; import android.opengl.GLSurfaceView; import android.opengl

How to use GLM in Android NDK Application

一世执手 提交于 2019-12-12 07:31:46
问题 I am currently trying to port my OpenGL application to Android and am stuck on how to import and build GLM http://glm.g-truc.net/ properly. I have no trouble using GLM in standard C++ apps, however I am pretty new to the NDK. I have tried all other solutions posted around the web with no luck. Here is what I have so far: I am using the latest version of GLM (0.9.4) My .cpp file contains: #include <glm\glm.hpp> My Android.mk file looks like: LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS)

Getting default frame buffer id from GLKView/GLKit

被刻印的时光 ゝ 提交于 2019-12-12 07:30:30
问题 I use GLkit/GLKView in my IOS OpenGL ES 2.0 project to manage default FBO/life cycle of my app. In desktop OpenGL in order to bind default FBO (the front buffer) I can just call glBindFrameBuffer(GL_FRAMEBUFFER,0) but this is not the case in IOS app since you have to create the default FBO yourself and it will have a unique ID; The problem is GLKit/GLKView coding style force me to use GLKView's "bindDrawable" function to activate default FBO which make the design of my cross platform

How does glClear() improve performance?

拜拜、爱过 提交于 2019-12-12 07:26:26
问题 Apple's Technical Q&A on addressing flickering (QA1650) includes the following paragraph. (Emphasis mine.) You must provide a color to every pixel on the screen. At the beginning of your drawing code, it is a good idea to use glClear() to initialize the color buffer. A full-screen clear of each of your color, depth, and stencil buffers (if you're using them) at the start of a frame can also generally improve your application's performance. On other platforms, I've always found it to be an

THREE.js - Billboard Vertex Shader

风流意气都作罢 提交于 2019-12-12 07:22:29
问题 I have the need to orientate an instance of THREE.Mesh to always face the camera. I know I could just use the [THREE.Mesh].lookAt() method, but I'm trying to work on my GLSL chops a bit more and want to be able to do this in a vertex shader. I've read through NeHe's Billboarding tutorial, and it makes sense to me. Well, all apart from the bit where one applies these orientation vectors to each vertex. I feel like I'm very close to getting this working, but as it stands at the moment, my