ue4-shader相关
ue4-shader相关
前篇
- Shader Development - https://docs.unrealengine.com/latest/INT/Programming/Rendering/ShaderDevelopment/index.html
- HLSL - https://wiki.unrealengine.com/HLSL_Shaders
- Graphics Programming - https://docs.unrealengine.com/latest/INT/Programming/Rendering/index.html
- UE4 shader plugin demo - https://github.com/Temaran/UE4ShaderPluginDemo
- UE4需要自己写shader吗,要用到HLSL么? - https://www.zhihu.com/question/50884693
- HLSL初级教程 - http://www.cppblog.com/liangairan/articles/57952.html
- 深度 与 模板 不错的实例 - https://www.parallelcube.com/2017/12/05/outline-effect-part-1/
常用节点
vector 分量 分割与合并
参考: vector 相关操作文档 - https://docs.unrealengine.com/en-us/Engine/Rendering/Materials/ExpressionReference/VectorOps
分割, split component
合并, append vector
Examples: Append of 0.2 and 0.4 is (0.2, 0.4); Append of (0.2, 0.4) and (1.0) is (0.2, 0.4, 1.0).
A,B 可以使 vector1,2,3,4
拾取指定通道, component mask
深度图使用
- Occlusion Outlines - https://www.youtube.com/watch?v=rL7VUeZzRyQ
关于 step 函数
没有这个 step 节点, 可以用自定义节点返回一个 HLSL 的 step 函数, 但是貌似官方不推荐自定义节点.
可以用另外两种方式实现 :
if
subtract
->sign
->saturate