问题标签 [opengl-es-3.0]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
864 浏览

ios - iPhone 5S 上的 OpenGL ES 2.0 片段着色器编译速度慢

我有一个使用大量片段着色器的应用程序。着色器都在应用程序启动时编译(在后台队列中)。我最近在 iPhone 5S 上测试了该应用程序,一切正常,但着色器需要更长的时间来编译。在 5 上,编译需要 0.8 秒。在 5S 上,需要 10 多秒。有谁知道这里发生了什么?

在 iPhone 5(运行 iOS 7.0.2)上:

在 iPhone 5S(运行 iOS 7.0.2)上:

编辑更多信息

仔细研究这个问题,iPhone 5S 似乎无法像以前的设备那样处理那么多制服。这实际上不是编译问题。对于我的一个着色器,链接阶段挂起 10 秒,然后失败。对于所有其他着色器,没有问题,编译和链接只需几毫秒。有问题的着色器使用 768 个 vec4 的统一数组,以及三个纹理。如果我删除任何纹理或减小数组的大小,它会毫无问题地链接。

0 投票
1 回答
464 浏览

android - cocos2dx 在 es 3.0 的设备上调用未实现的 OpenGL ES API 错误

我正在 Android 上测试我的 cocos2dx 应用程序,我遇到了一个我无法解决的错误。错误是:

我正在三星 S4 上进行测试,运行 Android 4.3,启用了 Open GL ES 3.0。它在支持 open gl es 2.0 的其他设备上运行良好。有人遇到过类似的问题吗?

我的 AndroidManifest 设置了这两个值:

0 投票
3 回答
5621 浏览

android - Fragment Shader (dFdx, dFdy) 的标准衍生产品在 Android 4.4 中无法正常运行

我正在使用一个片段着色器,它使用 dFdy dFdx 函数来计算面部的法线以在平面外观中查看。此着色器在 gles 2.0 和 3.0 中运行良好。令人费解的是,着色器在 Android 4.4 ( KitKat - gles3.0 ) 中不起作用。

(已解决!! ..每个组件的单独衍生物,解决问题)。

为了检查错误,我准备了这些着色器:

绘制一个立方体,在 Android<4.4 中,每边的颜色保持固定,与相机位置无关(正确,颜色标识每个法线面)。在 Android 4.4 中,如果您移动相机,颜色会有所不同。

分别分析每个派生的:

1.-fragColor=vec4(normalize( fdx ), 1.0);颜色不断变化(错误)

2.-fragColor=vec4(normalize( fdy ), 1.0);颜色保持准稳定(准正常)

在 Android 4.4 中实现这些功能的错误?我们做错了什么?

0 投票
3 回答
2949 浏览

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

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

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

and am using

in my LOCAL_LDLIBS. I noticed that in EGL/egl.h there is no EGL_OPENGL_ES3_BIT, so during context creation if I don't define EGL_RENDERABLE_TYPE, or if I use EGL_OPENGL_ES2_BIT, the results are the same.

A bit more info on where I am in case it helps: I'm porting my OpenGL game engine from Windows to Android using OpenGL ES 3.0 and the NDK. I have everything compiling ok with no errors, and have tested and verified that windowing, GL context management, Android lifecycle integration and the basic running of the engine works ok. I have a basic scene which simply activates the context, performs a glClearColour then swaps buffers, pulsating from black to red every second, and it works the same as it does on Windows.

Any help would be appreciated!

0 投票
1 回答
2088 浏览

android - Android EGL sRGB 默认渲染缓冲区

在 OpenGL ES 中,我可以使用扩展名为 GL_EXT_sRGB 的 OpenGL ES 3.0 或 OpenGL ES 2.0 创建 sRGB 渲染缓冲区。我创建了一个内部格式为 GL_SRGB8_ALPHA8(或 GL_SRGB8_ALPHA8_EXT)的可渲染纹理,它在支持它的 Android 设备上运行良好。

但是,我找不到任何方法让默认渲染缓冲区在 Android 上使用 sRGB。我正在使用 GLSurfaceView,所以它通过 EGL 和 eglChooseConfig,但我找不到控制 sRGB 设置的属性(如果有的话)。

我当然可以通过渲染到一个 sRGB 目标然后在显示之前复制到后台缓冲区来解决它,但这相当浪费。在 OpenGL 和 DirectX 中执行起来要容易得多,但是 OpenGL ES 需要在创建渲染缓冲区/帧缓冲区时应用 sRGB 设置。

有任何想法吗?

0 投票
1 回答
364 浏览

ios - GLKViewDrawableMultisample4X 不工作

如果 GLKView drawableMultisample 是 GLKViewDrawableMultisample4X,我的 iOS 应用程序将停止渲染。GLKViewDrawableMultisampleNone 一切正常,但如果我将其设置为 GLKViewDrawableMultisample4X,那么我只会得到空白的粉红色屏幕。

我已经在 iOS Simulator / iOS 7.0.3 上检查过了

有人知道如何解决这个问题吗?它可能与iOS模拟器有关并且可能在真实设备上运行良好吗?

0 投票
1 回答
550 浏览

ios - Real time OpenGL ES raytracing\raycasting on iOS with transform feedback?

We have an MRI scan and we would like to perform real time raycasting in OpenGL on iOS in order to render the surface from different angles without polygonizing it. In fact we are only interested in the depth map generated by rendering.

Ive seen a number of examples of this in the appstore so Im sure its possible (eg. ImageVis3d). Can we used glTexImage3D to perform rendering? Is there a good online resource for using this function in iOS? Better yet is there a GitHub project or something similar which demonstrates the use of glTexImage3D in iOS?

Now assuming that a 2d or 3d texture exists in OpenGL ES memory is it possible to write to the same memory using a fragment shader and then rerender it without copying it back to the CPU? Im imagining a sculpting scenario that can deform the volume using a fragment shader.

0 投票
3 回答
775 浏览

android - 带有 GL_PIXEL_PACK_BUFFER 的 glBindBuffer 返回枚举错误代码

我正在尝试做:

glBindBuffer(GL_PIXEL_PACK_BUFFER, pbo_id);

在 android 4.3 中,我得到了“枚举错误代码”,尽管文档说我可以使用 GL_PIXEL_PACK_BUFFER。

也许我没有使用“OpenGL ES 3.0”?我需要做什么来强制使用 v3?

OpenGL上下文:

0 投票
1 回答
307 浏览

graphics - gl_FragCoord - ES 着色语言中的定义不足?

在我看来,gl_FragCoord在 ES 着色语言规范中没有充分定义:这里

我认为缺少的是像素中心应该位于何处的规范:在整数坐标处或它们之间。相比之下,常规的着色语言规范明确了gl_FragCoord这一点:这里

更糟糕的是,我在不同平台上得到的结果好坏参半:ARM Mali T604 似乎遵循 .5 约定,而 Adreno 330 似乎将像素中心设置为全整数(均在 Android 4.4.2 上测试)。

有人可以告诉我这里的最佳做法是什么吗?

0 投票
1 回答
1259 浏览

android - 使用 OpenGL ES 3.0 测量时间

是否可以使用 OpenGL ES 3.0 测量 GPU 时间?使用 OpenGL,我可以使用 glQueryCounter,但 OpenGL ES 没有时间查询。