Skip to content
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

扫描边的问题 #1

Open
feixiaku opened this issue Dec 8, 2017 · 2 comments
Open

扫描边的问题 #1

feixiaku opened this issue Dec 8, 2017 · 2 comments

Comments

@feixiaku
Copy link

feixiaku commented Dec 8, 2017

hi,在描边的vertex shader中,关于normal的空间转换是不是不太正规?
normal 先转到view space,normal_ViewSpace = mul((float3x3) UNITY_MATRIX_IT_MV, i.normal),然后再转到clip space, normal = mul((float3x3) UNITY_MATRIX_P, normal_ViewSpace).

我的理解:normal在使用UNTIY_MATRIX_MVP转换之后的结果,有可能和world space中normal的方向不一致

@chenjd
Copy link
Owner

chenjd commented Dec 12, 2017

hi feixiaku.
其实关心的是clip space内的坐标,而非world space。

@feixiaku
Copy link
Author

是呀,但是UNITY_MATRIX_MVP和(UNITY_MATRIX_IT_MV然后在与UNITY_MATRIX_P相乘)这两个矩阵是有可能不一样的,所以normal与两个不同的矩阵相乘结果也应该不一样的吧

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants