opengl-es

Trouble with simple VBO example

扶醉桌前 提交于 2019-12-12 05:03:02
问题 I'm trying to get a super simple GLFW and VBO example running, but I'm stuck. I've used glBegin and glEnd for other projects, but I'm trying to update my code to work with OpenGL ES 2, but for now I just want to be as forward compatible as possible. From some examples online, I've come up with the following code: #include <stdlib.h> #include <GL/glfw3.h> #include <stdio.h> #define bool int #define true 1 #define false 0 const int width = 800; const int height = 600; bool opened = true; GLuint

Error switching from vector<float> to vector<short>

99封情书 提交于 2019-12-12 04:45:09
问题 I have an app I'm making where I would like to change a vector I'm creating from float to short. My code is in a header file like this: vector<float> vertices; and it works fine, but if I switch it to this: vector<short> vertices; and compile, it crashes with the following error: malloc: *** error for object 0x1035804: incorrect checksum for freed object - object was probably modified after being freed. *** set a breakpoint in malloc_error_break to debug I have no idea what's going on. If it

How does GLPaint work

好久不见. 提交于 2019-12-12 04:38:18
问题 Ok completely OpenGL-ES noob question. If anyone could explain how apple does GLPaint or better yet the VERY BASIC code of how they accomplished that, I would be thrilled. I am honestly not trying to ask for you to write my program, but trying to understand the basics of how apple accomplished the GLPaint drawing feature. P.S: I don't need the color conversion, just the drawing (obviously) Please help 回答1: I don't know why someone would produce simpler code than that which already exists for

How does OpenGL ES for android work?

狂风中的少年 提交于 2019-12-12 04:33:10
问题 I am doing a project where I'm creating my own 3D graphics using android studio. I have so far created a rotating sphere using a perspective projection and my own classes of shapes that contain the shapes vertices and faces. Each face is drawn as a triangle to a bitmap, which an ImageView updates itself with. However the program is slow as I guess all the calculations run in software and not hardware. I have now seen that I can use OpenGL ES to use hardware to perform the calculations needed,

gl_FragCoord doesn't match the size of the screen in three.js

廉价感情. 提交于 2019-12-12 04:31:14
问题 I've been having this issue where using gl_FragCoord shows the texture from the render texture of the previous pass on the bottom left part of the screen at a smaller size. It's as if the size of the window doesn't match the size of the render target but I've double checked they do. 回答1: I finally figured it out, the problem is that the canvas wasn't the same size as the camera and the render targets. You want to make sure these match: var winW = window.innerWidth; var winH = window

OpenGL ES 2.0 Shader on Texture not working

隐身守侯 提交于 2019-12-12 04:25:19
问题 I copied the example from this site click It is working well after fixing some minor things and extending the shader for my purpose. Now i want to move/translate the texture to the right side of the screen. For that case i have to add a ModelViewProjection Matrix to my code and as well to the shader, right? After doing this the Texture is not showing up anymore :-( What am I doing wrong? So the code is working until i change in my shader gl_position from : gl_Position= a_position to gl

Clipping object in openGL ES

て烟熏妆下的殇ゞ 提交于 2019-12-12 04:24:46
问题 I want to crop and object my openGL ES application, it should be done in the following manner: The left is the initial image, middle is the stencil buffer matrix, and right is the result. From what i have read here: Discard with stencil might have performance issues, and since the model that will be clipped is going to be rotated and translated, i honestly don't know if the drawn model will be clipped out in the wrong places after these actions. will it? So, i thought about depth buffer.

Load bitmap from SD card don't work

自作多情 提交于 2019-12-12 04:14:00
问题 I have some problem show images from sd card, i try to load bitmap into imageview. This is the code to load image: BitmapFactory.Options options = new BitmapFactory.Options(); options.inSampleSize = 8; options.inPreferredConfig = Bitmap.Config.ARGB_8888; File imagen1 = new File(ruta + contratoActual.getImgDoc1()); if (imagen1.exists()) { try { bmap = BitmapFactory.decodeStream(new FileInputStream(imagen1), null, options); ByteArrayOutputStream out = new ByteArrayOutputStream(); bmap.compress

WebGL. Is it creating a buffer in GPU?

♀尐吖头ヾ 提交于 2019-12-12 04:09:55
问题 Looking for a decision about a realtime plotting of rather a large data stream. I would like to process it via a GPU to reduce memory costs. I have found a WebGL example: // Fill the buffer with the values that define a triangle. function setGeometry(gl) { gl.bufferData( gl.ARRAY_BUFFER, new Float32Array([ 0, -100, 150, 125, -175, 100]), gl.STATIC_DRAW); } And would like to clarify something: Does gl.ARRAY_BUFFER create a buffer inside a GPU, not inside a RAM? Is WebGL stable on linux? UPDATE

Qt iOS: how to return QVideoFrame with type GLTextureHandle from QVideoFilterRunnable

佐手、 提交于 2019-12-12 03:55:17
问题 I'm trying to capture camera output frame and process it further in GPU pipeline. For this reason returing frame as a GPU texture is the best option. After inheriting from QVideoFilterRunnable class received by run method QVideoFrame objects has type which is not equal to QAbstractVideoBuffer::GLTextureHandle. It's equal to NoHandle and I need to do map/unmap and load texture manually by glTexImage , which is not good for performance. Is there any control options that can be used to return