2025-05-18 00:19:45 +08:00
|
|
|
|
# 程序内嵌材质/Shader
|
2025-05-18 00:28:06 +08:00
|
|
|
|
# Material/Shader embedded in program code
|
2025-05-18 00:19:45 +08:00
|
|
|
|
|
2025-05-18 00:28:06 +08:00
|
|
|
|
问题(Question):
|
|
|
|
|
|
|
|
|
|
```
|
2025-05-18 00:19:45 +08:00
|
|
|
|
即然可以从文件中加载材质了,那为什么还需要有程序代码中内嵌的材质/Shader呢?
|
|
|
|
|
|
2025-05-18 00:28:06 +08:00
|
|
|
|
I can load a material from a file. Why do we need a few materials/shaders embedded in the code?
|
|
|
|
|
```
|
|
|
|
|
|
2025-05-18 00:19:45 +08:00
|
|
|
|
这个问题很好,答案也很简单:
|
|
|
|
|
|
2025-05-18 00:28:06 +08:00
|
|
|
|
Good question, the answer is straightforward:
|
|
|
|
|
|
2025-05-18 00:19:45 +08:00
|
|
|
|
```
|
2025-05-18 00:28:06 +08:00
|
|
|
|
我们需要在资产损坏或丢失的情况下,依然可以渲染一些内容, 比如: 一个报错对话框。
|
|
|
|
|
|
|
|
|
|
We need to be able to render some content, such as an error dialog box, even if the asset is damaged or lost.
|
2025-05-18 00:19:45 +08:00
|
|
|
|
```
|