-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Document] enhance material document #2546
[Document] enhance material document #2546
Conversation
Caution Review failedThe pull request is closed. WalkthroughThis pull request updates the Chinese graphics documentation by modifying JSON metadata, removing outdated documentation files, and adding new guides. Modifications include the removal of obsolete keys and files, the replacement of metadata keys for materials, and updates to hyperlinks and titles. Additionally, a minor code change in the post-process module now disables depth testing and writing in the constructor. Changes
Sequence Diagram(s)sequenceDiagram
participant CP as CustomPass Constructor
participant DS as DepthState
CP->>DS: Set enabled = false
CP->>DS: Set writeEnabled = false
Note over CP,DS: Blit operation now ignores depth info
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (31)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2546 +/- ##
==========================================
+ Coverage 68.58% 69.03% +0.44%
==========================================
Files 961 961
Lines 100219 100219
Branches 8591 8591
==========================================
+ Hits 68739 69189 +450
+ Misses 31220 30770 -450
Partials 260 260
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
||
参考[模型的导入和使用](/docs/graphics/model/use/)教程,我们可以先将模型导入到编辑器,一般情况下,模型已经自动绑定好材质,用户可以不用做任何操作; | ||
|
||
### 2.1. Remap 材质 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- remap 材质这部分可以写得更详细一些
- 增量修改这块需要补充一篇新的文档,此处指向增量修改的文档
{ | ||
"create": { "title": "创建材质" }, | ||
"builtin": { "title": "使用内置着色器" }, | ||
"custom": { "title": "自定义着色器" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要么把下面改成「使用自定义着色器」,要么把上面改成「内置着色器」
整体缺少一篇「调试材质效果」的文档,介绍如何整体的步骤,内容应该是我们推荐他们如何去快速排查着色器的错误,以及调试得到自己想要的效果 |
src="https://gw.alipayobjects.com/zos/OasisHub/6351fa81-5159-4469-bd95-8f21a8f2f4ac/image-20250124162909194.png" | ||
style={{ zoom: "50%" }} | ||
/> | ||
|
||
默认的 Unlit 模板已经内置了蒙皮计算和 Shadow Pass,可以看到骨骼动画和阴影都能正常渲染: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分文字内容有点难啃,如果是用表格展示则会简单很多,Unlit 内置的能力,PBR 内置的能力,开发者一眼就能知道自己要用哪种模版
|
||
## 语法标准 | ||
|
||
`ShaderLab` 语法骨架如下: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
总览要说明这个东西是什么,干啥用的,
- 这里直接丢两段代码,体验不太好
- 总览需要有启下的作用,这里和后文的关系太含蓄了
|
||
## UsePass | ||
|
||
如果一个 `SubShader` 包含多个 `Pass`,可以通过 `UsePass` 指令复用其他 `Pass` 对象,比如引擎内置的 PBR Pass: `UsePass "pbr/Default/Forward"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
其实可以更开放点,
- 比如文档名就是如何在 ShaderLab 中写多 pass
- 如何定义渲染状态,全局的,局部的
比这样扎堆写一起,让开发者查字典要好很多
@@ -53,7 +53,7 @@ vec3 u_lightDir; | |||
|
|||
## varying 变量声明 | |||
|
|||
通过定义顶点着色器出参[结构体](/docs/graphics/shader/shaderLab/syntax/shader/#结构体函数)和片元着色器入参结构体指定 | |||
通过定义顶点着色器出参[结构体](/docs/graphics/material/shaderLab/shader/#结构体函数)和片元着色器入参结构体指定 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同理,如何声明变量
- 声明 varying 变量
- ……
title: 内置变量 | ||
--- | ||
|
||
Shader 代码中会经常用到内置变量,一种是**逐顶点**的 `attribute` 变量,另一种是**逐 shader** 的 `uniform` 变量。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里描述的其实是,引擎中有哪些内置变量?
可以加一下如何使用内置变量,那么这篇文档的名字就变成了,着色器中如何使用内置变量
|
||
## Tags | ||
|
||
ShaderLab 中可以通过 `Tags` 指令直接声明和指定,无须通过 `SubShader.setTag` api 方式手动指定。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉说了又好像没说
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
enhance #2540
Summary by CodeRabbit