首页 > 解决方案 > 如何在 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);

标签: charglsl

解决方案


GLSL 中不存在字符串和字符文字。您可以制作整数数组,其中数组值表示某种字符,但仅此而已。


推荐阅读