opengl-es

ClassCaseException on GL11ExtensionPack. Rendering to texture on OpenGL android

寵の児 提交于 2020-01-25 11:19:09
问题 I'm trying to render to a texture (really thought it would be easier than this!) I found this resource: which seems to be exactly what I want I'm getting a ClassCastException however, on GL11ExtensionPack gl11ep = (GL11ExtensionPack) gl; Can anyone tell me why? public void renderToTexture(GLRenderer glRenderer, GL10 gl) { boolean checkIfContextSupportsExtension = checkIfContextSupportsExtension(gl, "GL_OES_framebuffer_object"); if(checkIfContextSupportsExtension) { GL11ExtensionPack gl11ep =

Trying to use Ortho for drawing 2D

[亡魂溺海] 提交于 2020-01-25 04:06:05
问题 I'm having trouble with setting up an Ortho view for drawing 2D ontop of the 3D scene. I set up my view like this: public void onSurfaceChanged( GL10 gl, int width, int height ) { gl.glViewport( 0, 0, width, height ); gl.glMatrixMode( GL10.GL_PROJECTION ); gl.glLoadIdentity(); GLU.gluPerspective( gl, 45.0f, ( ( float )width / ( float )height ), 0.1f, 100.0f ); gl.glMatrixMode( GL10.GL_MODELVIEW ); gl.glLoadIdentity(); } and I set up my Ortho view like this: public void onSurfaceOrtho( GL10 gl

How to bind texture just to one object in OpenGLES?

白昼怎懂夜的黑 提交于 2020-01-24 19:49:29
问题 I am activating the texture just before the object to draw. But the texture is showing on both objects. Why is that so? Should I unbind the texture before the first object to draw? - I tried with glDisable and glBindTexture but it did not help. Here my code: @Override public void onDrawFrame(GL10 gl) { GLES20.glClear(GL10.GL_COLOR_BUFFER_BIT); synchronized (camerObject) { surfaceTextureCamera.updateTexImage(); cameraUpdate = false; } vertexBuffer.position(0); GLES20.glVertexAttribPointer

OpenGL ES texture problem, 4 duplicate columns and horizontal lines (Android)

久未见 提交于 2020-01-24 19:35:09
问题 I have a buffer of RGB (or RGBA) texture image, and I want to display it on my Android device with the following code. I use OpenGL from NDK. glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, this->pBuffer); I have also set the PixelFormat from the Java side with: this.getHolder().setFormat(PixelFormat.RGBA_8888); this.setEGLConfigChooser(8, 8, 8, 8, 0, 0); setRenderer(new MyRenderer()); The image is displayed but there are four columns (identical and contains

iPhone. Particle system performance

余生长醉 提交于 2020-01-24 17:27:05
问题 I try to draw rain and snow as particle system using Core Graphics . In simulator rendering proceeded fine but when I run my app on real device rendering is slow down. So, advise me please approaches to increase particle system drawing performance on iPhone . May be I should use OpenGL for this or CoreAnimation ? 回答1: OpenGL would be the lowest level to drop to for the rendering, so should offer the best performance (if done right). CoreAnimation would be close enough if there are not too

Problem using stencil mask on 3d object in arcore

旧街凉风 提交于 2020-01-24 17:18:21
问题 I am using a stencil mask on a 3d object using the hello ar java demo however i am running into some unexpected behaviour. My stencil mask correctly occludes the plane renderer but the 3d object (andy) does not seem to react expectedly. Instead he seems to get flipped as shown in the picture. I am not sure how to approach fixing this issue. Attached is the code snippet doing the stencil masking Image of stencil correctly working on plane buffer but failing on 3d model GLES20.glClear ( GLES20

opengl es(iphone) render from file

女生的网名这么多〃 提交于 2020-01-24 13:58:07
问题 sorry for my english I want to display video from a file, where the frames of 4 bytes per pixel, BRGA, 1280x720? on mac I just took out the frame and drew this glDrawPixels, running on a Mac but in opengl es all differently. here's the code from the mac int pos = 0; NSData *data = [[NSData alloc] initWithContentsOfFile:@"video.raw"]; glViewport(0,0,width,height); glLoadIdentity(); glOrtho(0, width, 0, height, -1.0, 1.0); glPixelZoom(1, -1); glClear(GL_COLOR_BUFFER_BIT); //glRasterPos2i(0,

setContentView says source not found

柔情痞子 提交于 2020-01-24 13:54:36
问题 I am trying to have a custom GLSurfaceView with some text over it, to display the score in a game. I have made a uniform xml layout based off of someones post here but when I try to load it with a setContentView the app crashes. after debugging I found that it says "Source can not be found". I have rebuilt the R file but that doesn't help. For reference my class that extends GLSurfaceView is called GLView. Any help would be appreciated. package org.kizik.WLTBO; import android.app.Activity;

setContentView says source not found

a 夏天 提交于 2020-01-24 13:54:11
问题 I am trying to have a custom GLSurfaceView with some text over it, to display the score in a game. I have made a uniform xml layout based off of someones post here but when I try to load it with a setContentView the app crashes. after debugging I found that it says "Source can not be found". I have rebuilt the R file but that doesn't help. For reference my class that extends GLSurfaceView is called GLView. Any help would be appreciated. package org.kizik.WLTBO; import android.app.Activity;

setContentView says source not found

我怕爱的太早我们不能终老 提交于 2020-01-24 13:53:56
问题 I am trying to have a custom GLSurfaceView with some text over it, to display the score in a game. I have made a uniform xml layout based off of someones post here but when I try to load it with a setContentView the app crashes. after debugging I found that it says "Source can not be found". I have rebuilt the R file but that doesn't help. For reference my class that extends GLSurfaceView is called GLView. Any help would be appreciated. package org.kizik.WLTBO; import android.app.Activity;