glsl - 在 glsl 中启用扩展和 fwidth
问题描述
我正在使用 webGL,我想像fwidth
在 Three.js 中那样使用它。在 .glsl 文件中,我添加了这样的扩展名:
#ifndef GL_ES
// Non OpenGL ES devices doesnt support precision qualifiers, so we do
// nothing instead
#define lowp
#define mediump
#define highp
#else
// to have functions like fwidth for OpenGL ES or WebGL, the extension should
// be explicitly enabled.
#extension GL_OES_standard_derivatives : enable
#endif
但我不断收到此错误:
Error compiling FRAGMENT_SHADER: WARNING: 0:14: '
' : extension directive should occur before any non-preprocessor tokens
WARNING: 0:14: 'GL_OES_standard_derivatives' : extension is not supported
ERROR: 0:47: 'fwidth' : no matching overloaded function found
如果有人知道如何解决这个问题 - 很高兴得到提示。
解决方案
推荐阅读
- angular - 根据前端状态的状态对 Angular 记录进行样式化
- c# - 在 .NET Core MVC 中使用 Ajax 处理会话超时
- python - 来自 Flask 应用程序的计划作业
- haskell - 在Haskell中找到给定集合A和通用集合U的补集
- php - 如何解决从 ms-access 到 mysql 的数据传输中的阿拉伯语编码问题?
- typescript - 从推断参数元组中删除项目
- wso2 - 如何从命令提示符运行 siddhi 应用程序?
- azure - 我们能否为在不同区域创建的所有 VMSS 提供一个应用程序网关?
- optaplanner - Optaplanner:求解器中不完整的理由列表
- r - 按组和间隔坐标折叠 data.frame