opengl-es-2.0

Texture not applying to mesh - OpenGL

你离开我真会死。 提交于 2019-12-04 06:58:19
问题 I am using OpenGL Es. I have successfully loaded the obj file (mesh) and its displayed well but when I am applying the texture its not displaying. I have added the code below. public void draw(GL10 gl) { // bind the previously generated texture gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); // Set the face rotation gl.glFrontFace(GL10.GL_CW); gl.glVertexPointer(3, GL10.GL_FLOAT, 0,

Texture doesn't draw

佐手、 提交于 2019-12-04 06:30:22
问题 I want to draw a image to the screen, but what I get is the black square but without the texture on it. The image path is correct and loaded, because the rect have the correct size. I have a separate class for loading the texture named Texture and a class for drawing the texture called Sprite. Here is the code: // Class Texture public void loadFromResources(final Context context, int id) { GLES20.glGenTextures(1, mTextureID, 0); final BitmapFactory.Options options = new BitmapFactory.Options(

GL_APPLE_shader_framebuffer_fetch gl_lastFragData

笑着哭i 提交于 2019-12-04 06:26:34
Apple introduced a new shader extension called GL_APPLE_shader_framebuffer_fetch, which allows fully programmable blending. There is also a wwdc video explaining the functionallity. It's the video 513 of wwdc 2012. Sadly this extension doesn’t work for me. F-Shader: #extension GL_APPLE_shader_framebuffer_fetch : require varying lowp vec4 colorVarying; void main(void) { gl_FragColor = gl_lastFragData[0] + vec4(colorVarying.x, colorVarying.y, colorVarying.z, 1.0); } Debug output: extension ‘GL_APPLE_shader_framebuffer_fetch’ is not supported Tried to run it on the iOS 6.0 iPad Simulator ‘n on an

Android openGL ES 2.0 scene scrolling

让人想犯罪 __ 提交于 2019-12-04 06:02:24
问题 I'm working on a simple game for android using openGL es 2.0. Game will be in 2D, something like old supermario, where player can move left-right/up-down but no depth. Level will be larger than screen, so graphics will have to scroll. Here is where the problem comes. I don't know where/when to stop scrolling. Example. Lets say that background is 100x100 sized square with texture. Lets say that on screen there is only 1/4 of the background visible at any time. When I then move screen to the

How can Opengl Es be use for gpgpu implementation

北战南征 提交于 2019-12-04 05:59:39
I want to use Opengl Es for gpgpu implementation of an image processing code. I want to know can I use Opengl Es for this purpose. If I can than which version of Opengl Es will be more appropriate for this purpose (Opengl Es 1.1 or 2.0). OpenGL ES is a graphics technology for embedded systems, and therefor not quite as powerful as it's bigger brother. OpenGL ES was not designed with doing gpgpu processing in mind, but some algorithms, especially those that work on images and require per-pixel processing can be implemented. However for real GPGPU programming you should consider OpenCL, Nvidia

No EGLConfig found

与世无争的帅哥 提交于 2019-12-04 05:25:00
I'm trying to make simple Game in android using AndEngine tutorial Now When I run the project I get the error saying that java.lang.IllegalArgumentException: No EGLConfig found! TowerOfHanoiActivity.java public class TowerOfHanoiActivity extends SimpleBaseGameActivity { private static int CAMERA_WIDTH = 800; private static int CAMERA_HEIGHT = 480; private ITextureRegion mBackgroundTextureRegion, mTowerTextureRegion, mRing1, mRing2, mRing3; @Override public EngineOptions onCreateEngineOptions() { final Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT); return new EngineOptions(true,

Texture partially off screen - performance difference

吃可爱长大的小学妹 提交于 2019-12-04 05:18:26
问题 On the picture is an example of two situations, where a textured polygon is being rendered. All done by Opengl ES2. A) the polygon is partially off the viewport B) the polygon is completely inside it My question: Is situation 'A)' going to consume less system/gpu resources*, because the texture is partially off screen, or will it perform just the same as if i rendered it inside of the viewport and why? *"Resources" - meaning speed, not memory. I know that opengl does calculate vertices first,

Most Efficient way of Multi-Texturing - iOS, OpenGL ES2, optimization

北战南征 提交于 2019-12-04 05:16:24
I'm trying to find the most efficient way of handling multi-texturing in OpenGL ES2 on iOS. By 'efficient' I mean the fastest rendering even on older iOS devices (iPhone 4 and up) - but also balancing convenience. I've considered (and tried) several different methods. But have run into a couple of problems and questions. Method 1 - My base and normal values are rgb with NO ALPHA. For these objects I don't need transparency. My emission and specular information are each only one channel. To reduce texture2D() calls I figured I could store the emission as the alpha channel of the base, and the

What object's state does glEnableVertexAttribArray modify?

我是研究僧i 提交于 2019-12-04 05:08:08
问题 I think I understand what glEnableVertexAttribArray does -- it activates a particular attribute of a program (please correct me if I am wrong). What I don't understand though is which object stores this information. Is it the program object? That is, if I do: glUseProgram(program); glEnableVertexAttribArray(0); and then later on do: glUseProgram(program); glDrawArray(...); will the attribute at location 0 be enabled? Or is it modifying some global state which needs to be reset every time

GLKTextureLoader fails when loading a certain texture the first time, but succeeds the second time

左心房为你撑大大i 提交于 2019-12-04 03:23:35
I'm making an iPhone application with OpenGL ES 2.0 using the GLKit. I'm using GLKTextureLoader to load textures synchronously. The problem is that for a certain texture, it fails to load it the first time. It gives this error: The operation couldn’t be completed. (GLKTextureLoaderErrorDomain error 8.) For this error code, the apple documentation says the following: GLKTextureLoaderErrorUncompressedTextureUpload An uncompressed texture could not be uploaded. Available in iOS 5.0 and later. Declared in GLKTextureLoader.h. (not very much). Could I be trying to load the texture while the opengl