opengl-es

Android OpenGL ES shader compiler support

可紊 提交于 2019-12-13 10:16:14
问题 The OpenGL ES 2.0 Specs state that "[s]hader compiler support is optional" (see "Notes" here). Are there any Android devices that do not support shader compilation? If so, is there some shader compiler that I can include with my app to generate a binary instead? Or is the format of the binary also standardized so that I can precompile my shaders before hand and ship the binary with my app if needed? Or is there a requirement I can put into my app so that it isn't offered to devices without

Using gluUnProject to map touches to x,y cords on z=0 plane in Android OpenGL ES 2.0

Deadly 提交于 2019-12-13 08:16:19
问题 I've drawn a grid at z=0 in OpenGL 2.0 ES, and just want to convert touch inputs to x/y coordinates on that plane. It seems like this is best done through ray tracing, which involves running gluUnProject on 0 and 1, then creating a ray, solving that ray for z=0? I found this code, but it is OpenGL ES 1.0: i-schuetz / Android_OpenGL_Picking Screenshot of app running so you can see camera distortion. My code on Github, only 4 files. The unproject function I'm trying to write is in MyGLRenderer

Javascript - sort Array by reference

≯℡__Kan透↙ 提交于 2019-12-13 08:09:53
问题 I'm trying to sort a JavaScript Array by the reference to another object. I have An array of Mesh. Each mesh contains an attribute named " texture ", which contains the reference to a WebGLTexture object. WebGLTexture objects doesn't contains any readable attribute, I can only compare it by reference ( == ). toString method isn't defined. Here is an example of the initial situation : var texture1 = gl.createTexture(/* blah */); // Returns a WebGLTexture object var texture2 = gl.createTexture(

Android OpenGL ES 2: Introduction to VBOs

瘦欲@ 提交于 2019-12-13 08:02:07
问题 Can someone offer a tutorial for using vertex buffer objects (VBOs) in Android? I am working on a 2D HUD which is drawn using OpenGL ES 2 on Android. 回答1: The best OpenGL ES tutorials are not specifically for Android, but the way VBOs are used will be directly portable. The best OpenGL ES examples are in the PowerVR SDK. There is also a collection of relevant articles on my blog that will help too. 回答2: Here's some: Most basic working vbo example http://www.opengl.org/wiki/VBO_-_just_examples

Opengl ES diffuse shader not working

笑着哭i 提交于 2019-12-13 07:06:42
问题 I'm implementing simple ray tracing for spheres in a fragment shader and I'm currently working on the function that computes color for a diffusely shaded sphere. Here is the code for the function: vec3 shadeSphere(vec3 point, vec4 sphere, vec3 material) { vec3 color = vec3(1.,2.,3.); vec3 N = (point - sphere.xyz) / sphere.w; vec3 diffuse = max(dot(Ldir, N), 0.0); vec3 ambient = material/5; color = ambient + Lrgb * diffuse * max(0.0, N * Ldir); return color; } I'm getting errors on the two

How compose multiple thumbnails of GLES scenes into a scrolling list on Android?

独自空忆成欢 提交于 2019-12-13 06:36:18
问题 Our app generates a number of scenes using GLES 2. Making a picker (scrolling list of images) to select which scene to go to. The scenes are not available as pre-made images; using GL rendering at the time they are needed. On iOS, we created the scenes in an offscreen pbuffer, as they became visible while the list scrolled. Attempt #1: On Android, the code equivalent to our iOS code yields GL Errors, because there is no current EGLContext (or it is not a valid time or thread to render to

Do the Android and iOS versions of OpenTK have the same API?

你说的曾经没有我的故事 提交于 2019-12-13 06:19:26
问题 I'm trying to get into mobile game development with Xamarin; I am using OpenTK for rendering. My plan is the following: 1. Make a shared library that is actually the game (and has all openTK code). 2. Make a a runnable project for iOS and Android that handles platform specific stuff (e.g. popping up alerts) and uses my shared library. Is this possible with openTK? Does it have exactly the same API on iOS and on Android, just the linked library is different? If yes, how to avoid code

Modify and update camera frame via GLSurfaceView

丶灬走出姿态 提交于 2019-12-13 05:50:56
问题 I am working with a GLSurfaceView activity to display the camera frame on an android device. As I am newb in OpenGl Es , I wondered how I can get the image buffer and modify it, then display the modified frame on the phone? In my Renderer class which implements GLSurfaceView.Renderer , I call a native function: public class Renderer implements GLSurfaceView.Renderer { public void onDrawFrame(GL10 gl) { MyJNINative.render(); } ... } The API I am working with, provided a connectCallBack method

Intersection test for ray picking in opengl es for android

半城伤御伤魂 提交于 2019-12-13 05:48:53
问题 Ok so I was able to get the coordinates in 3d space for the touch now I need to test whether that ray intersected a triangle. What I am asking is for help to understand the Test Class. BTW this code came from http://android-raypick.blogspot.ca/2012/04/first-i-want-to-state-this-is-my-first.html. I know to pass in the ray and an empty float array into intersectRayAndTriangle() but the Test T is the V0[], V1[], and V2[] but where do I get those at? Are they the converted coordinates of my

GlSurfaceView Renderer not being called

こ雲淡風輕ζ 提交于 2019-12-13 05:48:45
问题 I'm learning OpenGL on Android. I've written an app where the GlSurfaceView is declared in the layout XML (fragment...) <FrameLayout android:id="@+id/framelay" android:layout_width="fill_parent" android:layout_height="fill_parent"> <com.nelsondev.myha3ogl.M3View android:id="@+id/m3SurfView" android:layout_width="fill_parent" android:layout_height="fill_parent"/> </FrameLayout> ... and in its constructor the renderer is being set: public M3View(Context context, AttributeSet attrs) { super