opengl-es

How to get OpenGL version using Javascript?

余生颓废 提交于 2019-12-10 02:09:47
问题 Is there any way to let the browser returns the opengl version string? I know that opengl is not executed by the browser, this is why in the code, the shaders are written as string to not make javascript syntax errors, So, if the browser can interract with the GPU, then there must be some code that returns a string to the console instead of shaders? 回答1: The short answer is, you can't. You can ask for the standard GL versions. const gl = document.createElement("canvas").getContext("webgl");

Writing to then reading from an offscreen FBO on iPhone; works on simulator but not on device?

时间秒杀一切 提交于 2019-12-10 02:06:34
问题 I'm trying to do some image manipulation on the iPhone, basing things on the GLImageProcessing example from Apple. Ultimately what I'd like to do is to load an image into a texture, perform one or more of the operations in the example code (hue, saturation, brightness, etc.), then read the resulting image back out for later processing/saving. For the most part, this would never need to touch the screen, so I thought that FBOs might be the way to go. To start with, I've cobbled together a

Draw a line over UIViewController

℡╲_俬逩灬. 提交于 2019-12-10 00:32:55
问题 I have my app on iPhone with a UIViewController with some stuff inside.. image, textbox, etc... is there a way to draw a line or something like this using opengl directly inside the UIViewController? thanks in advance 回答1: Are you sure about the OpenGL? I believe it will be impossible to use OpenGL above regular views. You might add a custom view (inherit from UIView) above all the other views and draw anything you want on that view. This view should have a transparent background color. In

Issue in passing Egl configured surface to native and push the data

余生颓废 提交于 2019-12-09 23:53:53
问题 First, thanks to fadden for your wonderful examples. I tried following this ContinuousCapture.java example, and produced the below program. 1) I am trying to display the image into TextureView in the native layer by getting its ANativeWwindow reference, and using ANative lock and unlockpost methods to acquire the BufferQueue and to fill the data. Ie: ANativeWindow_lock(*window, &buffer, NULL) ANativeWindow_unlockAndPost(*window); 2) At the same time i want to retrieve the data from this

open GLES or canvas? (android)

天大地大妈咪最大 提交于 2019-12-09 22:34:46
问题 I am making an app that is going to be on the market soon but i'm wondering, should I use Canvas or Open GLES? right now i have no idea about how to use open GLES. I am using canvas for about have a year and I heard that open GLES is better than canvas. I am making a 2d game and not a 3d game. should i use canvas or open GLES? if i should use the open GLES, can you give me a good tutorial on how to use it? and also how to do basic things like control the x and y in there or is it just like

Unexpected pixel data layout when reading from GraphicBuffer

白昼怎懂夜的黑 提交于 2019-12-09 22:17:04
问题 I am currently working on a platform in the native Android framework where I use GraphicBuffer to allocate memory and then create an EGLImage from it. This is then used as a texture in OpenGL which I render to (with a simple fullscreen quad). The problem is when I read the rendered pixel data from the GraphicBuffer, I expect it to be in a linear RGBA format in memory but the result is a texture which contains three parallell smaller clones of the image and with overlapping pixels. Maybe that

Android opengl issue (weird)

半腔热情 提交于 2019-12-09 17:48:25
问题 this is a weird one. I have a basic application (dashboard, ...) and a GLSurfaceview in which I draw 3D objects and textures. All runs pretty but when I go back in other activities, hmm well a screenshot is better than words: This is the dashboard before this is the opengl: And this is my dashboard when I press back: As you can see, the images are gone and text too. I run on 4.0+ so I suppose this is because android draws elements with opengl, as it doesn't do that on my 2.2 device. Do you

iPhone opengl es alpha-blending. I have black color in edge

只谈情不闲聊 提交于 2019-12-09 17:18:16
问题 I am developing iPhone game. I have the below Source image to draw it to the background. The Source image has alpha 0x00 and gradation around edge and the background's alpha is 0xff. When I draw the source image to the background, I have black color like you could see the Result image. I am using OpenGL ES glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) method. I have changed every possible arguments, but every time it is not moved. Why do I have the black color in the edge of the source

Textured points in OpenGL ES 2.0?

為{幸葍}努か 提交于 2019-12-09 15:46:21
问题 I'm trying to implement textured points (e.g. point sprites) in OpenGL ES 2.0 for a particle system. Problem I'm having is the points all render as solid black squares, rather than having the texture properly mapped. I have verified that gl_PointCoord is in fact returning x/y values from 0.0 to 1.0, which would map across the entire texture. The texture2D call always seems to return black though. My vertex shader : attribute vec4 aPosition; attribute float aAlpha; attribute float aSize;

OpenGL ES Simple Undo Last Drawing

只愿长相守 提交于 2019-12-09 14:07:27
问题 I am trying to figure out how to implement a simple "undo" of last drawing action on the iPhone screen. I draw by first preparing the frame buffer: [EAGLContext setCurrentContext:context]; glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); I then prepare the vertex array and draw this way: glVertexPointer(2, GL_FLOAT, 0, vertexBuffer); glDrawArrays(GL_POINTS, 0, vertexCount); glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer); [context presentRenderbuffer:GL_RENDERBUFFER_OES