opengl-es-3.0

Directional lighting is not constant in OpenGL ES 2.0/3.0

筅森魡賤 提交于 2021-01-28 13:42:46
问题 Problem: The direction of the directional light changes when the position of the object changes. I watched posts with a similar problem: Directional light in worldSpace is dependent on viewMatrix OpenGL directional light shader Diffuse lighting for a moving object Based on these posts, I tried to apply this: #version 300 es uniform mat4 u_mvMatrix; uniform mat4 u_vMatrix; in vec4 a_position; in vec3 a_normal; const vec3 lightDirection = vec3(-1.9, 0.0, -5.0); ... void main() { vec3

Directional lighting is not constant in OpenGL ES 2.0/3.0

柔情痞子 提交于 2021-01-28 13:42:23
问题 Problem: The direction of the directional light changes when the position of the object changes. I watched posts with a similar problem: Directional light in worldSpace is dependent on viewMatrix OpenGL directional light shader Diffuse lighting for a moving object Based on these posts, I tried to apply this: #version 300 es uniform mat4 u_mvMatrix; uniform mat4 u_vMatrix; in vec4 a_position; in vec3 a_normal; const vec3 lightDirection = vec3(-1.9, 0.0, -5.0); ... void main() { vec3

Android Emulator and OpenGL ES3: EGL_BAD_CONFIG

烂漫一生 提交于 2021-01-02 08:02:37
问题 I am running an Android Virtual Device on my Ubuntu host. It is using the CPU/ABI Intel Atom (x86) and I am using the host GPU. The emulator is using a Kernel-based Virtual Machine. This works splendidly as long as I use an OpenGL ES2 context. If my app attempts to create an OpenGL ES3 context however, using... const EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE }; context = eglCreateContext(display, config, NULL, contextAttribs); ...then I get an EGL_BAD_CONFIG error: I

Android Emulator and OpenGL ES3: EGL_BAD_CONFIG

我的梦境 提交于 2021-01-02 07:59:40
问题 I am running an Android Virtual Device on my Ubuntu host. It is using the CPU/ABI Intel Atom (x86) and I am using the host GPU. The emulator is using a Kernel-based Virtual Machine. This works splendidly as long as I use an OpenGL ES2 context. If my app attempts to create an OpenGL ES3 context however, using... const EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE }; context = eglCreateContext(display, config, NULL, contextAttribs); ...then I get an EGL_BAD_CONFIG error: I

Android Emulator and OpenGL ES3: EGL_BAD_CONFIG

不问归期 提交于 2021-01-02 07:58:21
问题 I am running an Android Virtual Device on my Ubuntu host. It is using the CPU/ABI Intel Atom (x86) and I am using the host GPU. The emulator is using a Kernel-based Virtual Machine. This works splendidly as long as I use an OpenGL ES2 context. If my app attempts to create an OpenGL ES3 context however, using... const EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE }; context = eglCreateContext(display, config, NULL, contextAttribs); ...then I get an EGL_BAD_CONFIG error: I

OpenGLES 3.0 Shader Compile error on Android Device for in and out storage qualifiers

梦想的初衷 提交于 2020-03-23 07:34:12
问题 So I am updating my app to use OpenGLES 3.0 to take advantage of transform feedback, but the shader isn't compiling. error: 06-27 17:29:43.299 18593-18627/com.harmonicprocesses.penelopefree E/MyGLRenderer﹕ Could not compile shader 35633: 06-27 17:29:43.299 18593-18627/com.harmonicprocesses.penelopefree E/MyGLRenderer﹕ ERROR: 0:1: 'in' : Syntax error: syntax error INTERNAL ERROR: no main() function! ERROR: 1 compilation errors. No code generated. Here is the vertex shader code: private final

OpenGLES 3.0 Shader Compile error on Android Device for in and out storage qualifiers

心不动则不痛 提交于 2020-03-23 07:34:06
问题 So I am updating my app to use OpenGLES 3.0 to take advantage of transform feedback, but the shader isn't compiling. error: 06-27 17:29:43.299 18593-18627/com.harmonicprocesses.penelopefree E/MyGLRenderer﹕ Could not compile shader 35633: 06-27 17:29:43.299 18593-18627/com.harmonicprocesses.penelopefree E/MyGLRenderer﹕ ERROR: 0:1: 'in' : Syntax error: syntax error INTERNAL ERROR: no main() function! ERROR: 1 compilation errors. No code generated. Here is the vertex shader code: private final

sRGB Framebuffer on OpenGL ES 3.0

巧了我就是萌 提交于 2020-03-03 02:59:16
问题 I am working on a OpenGL ES 3.0 Android project using Java. I need to implement gamma correction and somewhere I've read that sRGB textures would be supported in OpenGL ES 3.0. So my intention was to call glEnable(GL_FRAMEBUFFER_SRGB) before rendering into the default framebuffer. However, when I try to call GLES30.glEnable(GLES30.GL_FRAMEBUFFER_SRGB) it turns out, there is no GLES30.GL_FRAMEBUFFER_SRGB, but there are some constants for sRGB texture formats like GLES30.GL_SRGB. So, my

sRGB Framebuffer on OpenGL ES 3.0

扶醉桌前 提交于 2020-03-03 02:57:48
问题 I am working on a OpenGL ES 3.0 Android project using Java. I need to implement gamma correction and somewhere I've read that sRGB textures would be supported in OpenGL ES 3.0. So my intention was to call glEnable(GL_FRAMEBUFFER_SRGB) before rendering into the default framebuffer. However, when I try to call GLES30.glEnable(GLES30.GL_FRAMEBUFFER_SRGB) it turns out, there is no GLES30.GL_FRAMEBUFFER_SRGB, but there are some constants for sRGB texture formats like GLES30.GL_SRGB. So, my

sRGB Framebuffer on OpenGL ES 3.0

浪尽此生 提交于 2020-03-03 02:56:47
问题 I am working on a OpenGL ES 3.0 Android project using Java. I need to implement gamma correction and somewhere I've read that sRGB textures would be supported in OpenGL ES 3.0. So my intention was to call glEnable(GL_FRAMEBUFFER_SRGB) before rendering into the default framebuffer. However, when I try to call GLES30.glEnable(GLES30.GL_FRAMEBUFFER_SRGB) it turns out, there is no GLES30.GL_FRAMEBUFFER_SRGB, but there are some constants for sRGB texture formats like GLES30.GL_SRGB. So, my