虚幻4渲染编程(材质编辑器篇)【第七卷:Modify RenderPipeline in ME】

My blog directory

小IVan:专题概述及目录​zhuanlan.zhihu.com图标

Introduce:

As we all know, we can't modify the main render pipeline of unreal engine 4。We can only edit our shader in the material editor. If we want to do something special which material editor can't meet our needs, Using c++ to modify the engine is currently the only viable method. My previous article has detailed implementation steps for this method.

小IVan:虚幻4渲染编程(材质编辑器篇)【第二卷:自定义光照模型】

However, Using c++ to modify the engine is not a good way. Because This method is very inconvenient. Below I will introduce a way to modify the rendering pipeline directly in the material editor.


Main Content:

Let's see the results first.

v2-8ad070d8aeb7ff0693cf469a3f3f87ab_b.jpg
v2-921e1006ee368b2ecb98517abc3cc6b2_b.jpg

The code shown above is relatively simple, but the goal of modifying the rendering pipeline directly in the material editor has been achieved.

First we need to modify the source code of CustomNode。

v2-bc2cba798f82beec59095031b48044af_b.jpg
v2-53ba1cf41d8dac3c3f883fd4e35e52fc_b.jpg

Compile the engine, then open the material editor to add a CustomNode and you will see the following result.

v2-6be58a948a17cd882ae3cc55f17a3cde_b.jpg

If you write a macro to def, the macro will be pushed into the shader, and the rendering pipeline will get the macros.

v2-6805e6df9c555cd8cd80d2ca13dbf9a7_b.jpg

Then we can write our code into the engine shader, which can be easily enabled using the material editor.

v2-4e6e10bfbd5213a21bb3fd728cbe9498_b.jpg

Summary and outlook:

Enjoy it !


Next:

YivanLee:虚幻4渲染编程(材质编辑器篇)【第八卷: BillBoardMaterialForInstance】

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

cpongo11

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值