opengl-es-3.0

OpenGL ES 3 (iOS) texturing oddness - want to know why

我们两清 提交于 2019-12-13 02:16:12
问题 I have a functioning OpenGL ES 3 program (iOS), but I've having a difficult time understanding OpenGL textures. I'm trying to render several quads to the screen, all with different textures. The textures are all 256 color images with a sperate palette. This is C++ code that sends the textures to the shaders // THIS CODE WORKS, BUT I'M NOT SURE WHY glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, _renderQueue[idx]->TextureId); glUniform1i(_glShaderTexture, 1); // what does the 1 mean

opengl GL.GetUniformLocation always returns ZERO (0)

元气小坏坏 提交于 2019-12-12 05:51:02
问题 Am using OpenGL ES30 with Xamarin/C#. My issue is that no matter what I do, when I call: OpenTK.Graphics.ES30.GL.GetUniformLocation(progID, "varName"); It ALWAYS returns ZERO. (not -1). The following statements all return 0: int RRRRRRRR = GL.GetUniformLocation(Terrain3D.TileShader.Id, "NOTVALIDNAME"); RRRRRRRR = GL.GetUniformLocation(-1, "ALSONOTVALID"); RRRRRRRR = GL.GetUniformLocation(-1, "BOGUSZZZZ"); RRRRRRRR = GL.GetUniformLocation(-1, ""); These are all bogus values (even for Program

Opengl ES 3.0 shader functions unimplemented on Nexus 5/KitKat 4.4

送分小仙女□ 提交于 2019-12-11 06:26:13
问题 I'm having no luck using any of the OpenGL 3.0 shader functions on my Nexus 5 w/ KitKat 4.4, I get "called unimplemented opengl es api" for functions such as glCreateProgram() glShaderSource() glCompileShader() e.t.c. I am performing all calls whilst the OpenGL context is active. I can't imagine that these functions would not be implemented, so believe I must be doing something wrong! I have included the following <GLES3/gl3.h> <GLES2/gl2ext.h> <GLES3/gl3platform.h> and am using -lGLESv3 in

Qt: All Canvas3D rendering is broken when GL ES 3.0 is requested

时间秒杀一切 提交于 2019-12-11 05:15:06
问题 I've distilled this to a completely trivial testcase. In main() I request a GL ES 3.0 context. In the Canvas3D code I first I setup all low-level stuff like shaders, vertex buffers and matrices. Then I draw a white triangle. The results is a window that alternates between all black and white (flickers) at a high frequency. I.e. completely buggy. Changing the 3.0 version I request to 2.0 fixes it, and, in my real app, and lets all other GL functionality work fine. Note that QML items other

glMapBufferRange() returns all zeros in Android OpenGLES 3.0 using TrasnformFeedback

旧时模样 提交于 2019-12-11 03:29:06
问题 UPDATE: This is working and up on gist now! Thanks Reto I am working on an Android implementation of transform feedback following this example. runs pretty well without any errors, but I am getting all zeros out when reading the TransformFeedback buffer with glMapBufferRange() import android.opengl.GLES30; import android.util.Log; import java.nio.ByteBuffer; import java.nio.FloatBuffer; /** * Created by izzy on 6/24/15. */ public class TransformFeedback { private final String TAG =

glMapBufferRange returning all zeros in Android

房东的猫 提交于 2019-12-11 03:09:02
问题 I am having trouble reading out from a buffer mapped with glMapBufferRange If I simply put some data in a buffer // Create input VBO and vertex format int bufferLength = 5 * 4; //5 floats 4 bytes each FloatBuffer data = ByteBuffer.allocateDirect(bufferLength) .order(ByteOrder.nativeOrder()).asFloatBuffer(); float[] floatData = { 1.0f, 4.0f, 9.0f, 16.0f, 25.0f }; data.put(floatData).position(0); Generate a Array Buffer in GL and fill it with the data int[] vbo = new int[1]; GLES30.glGenBuffers

Luminance histogram calculation in GPU-android opengl es 3.0

余生长醉 提交于 2019-12-10 17:28:58
问题 For Luminace histogram calculation I have used the code from the project GPU image ios by Brad Larson. He has used blending for Histogram calculation. Attaching the Vertex and Fragment shader Vertex shader #version 300 es in vec4 position; out vec3 colorFactor; const vec3 W = vec3(0.299, 0.587, 0.114); void main() { float luminance = dot(position.xyz, W); colorFactor = vec3(1.0, 1.0, 1.0); gl_Position = vec4(-1.0 + (luminance * 0.00784313725), 0.0, 0.0, 1.0); gl_PointSize = 1.0; } ; Fragment

OpenGL ES3 Shadow map problems

馋奶兔 提交于 2019-12-04 18:13:51
I work on C++ project for Android with OpenGL ES3, so I try to implement the shadow map with directional light, I understand the theory well but I never get it successfully rendered. first I create the framebuffer which contains the depth map: glGenFramebuffers(1, &depthMapFBO); glBindFramebuffer(GL_FRAMEBUFFER, depthMapFBO); glGenTextures(1, &depthMap); glBindTexture(GL_TEXTURE_2D, depthMap); glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, SHADOW_WIDTH, SHADOW_HEIGHT, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL

Android 4.3 PBO not working

让人想犯罪 __ 提交于 2019-12-04 18:13:50
I am using PBO to take screenshot. However, the result image is all black. It works perfectly fine without PBO . Is there any thing that I need to take care before doing this ? I even tried by rendering to a FBO and then use GLES30.glReadBuffer(GLES30.GL_COLOR_ATTACHMENT0) , no hope public void SetupPBO(){ GLES30.glGenBuffers(1, pbuffers, 0); GLES30.glBindBuffer(GLES30.GL_PIXEL_PACK_BUFFER, pbuffers[0]); int size = (int)this.mScreenHeight * (int)this.mScreenWidth * 4; GLES30.glBufferData(GLES30.GL_PIXEL_PACK_BUFFER, size, null, GLES30.GL_DYNAMIC_READ); checkGlError("glReadBuffer"); GLES30

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