char - 如何在 GLSL 中使用 char 字符串?
问题描述
如何使用 GLSL 中的 char sumbols?在https://www.shadertoy.com/new上进行测试。
int c = int('a'); // Not work
如何获得一个 sumbol 或 string?用于通话功能。
DrawString("Hello world!"); // Example
我可以做到这一点,但这太难了:
#define _H 72
DrawString(_H, _e, _l, _l, _o);
解决方案
GLSL 中不存在字符串和字符文字。您可以制作整数数组,其中数组值表示某种字符,但仅此而已。
推荐阅读
- javascript - 我需要用对象计算数组中列的总和
- javascript - 如果/否则不适用于 event.target 选择器
- reactjs - 作为反应,如何更新 Firebase 中的数据?
- typescript - 在 TypeScript 中从 URL 动态导入远程 ES 模块
- python - python子字符串超出范围
- java - 运行 docker Run 时出现 Docker 容器错误
- python - 使用 pandas 写入 CSV 时单独定义要引用的列
- javascript - 使用 jQuery 打印时最多 25 页
- apache-nifi - Nifi:嵌套的 JSON 记录模式验证
- javascript - express/node:发送到客户端后无法设置标头