参考
资源
本篇内容
2D和3D混合效果
Unity软件版本
Unity2017.4.15
Nintendo Switch上推出的《超级马里奥》中,有一些关卡混合了2D和3D的画面,这种效果十分让人印象深刻。如何在Unity中实现这个效果呢?

摄像机有一个属性,叫目标纹理(Target Texture)。

在项目窗口依次点击Create -> Render Texture来新建渲染纹理,将它拖到摄像机上的Target Texture属性中。

创建一个新摄像机到场景中,摄像机的Projection属性为Perspective。

在摄像机前添加一个新的3D对象,本例中,我们添加的是圆柱。然后创建新材质,其Shader属性设为Unlit/Texture,再将刚刚创建的渲染纹理拖到这个材质上的Main Texture部分。

最后把创建的材质球 拖给 圆柱

-------OK 完成了 是不是很简单
网友评论