Unity学习笔记 vol.94 URP ShaderGraph贴花
https://www.youtube.com/watch?v=f7iO9ernEmM
创建URP项目,在UniversalRenderPipelineAsset设置中将Depth Texture设置打勾。

创建Shader > Unlit Graph,命名为Decals。创建两个参数,Texture2D命名为MainTexture,另一个命名为AlphaClip,设置为0.01。

按下图设置。红框需要注意修改。

按下图设置。红框需要注意修改。

Transformation Matrix设置为Inverse View Projection。



这里我创建一个Metal的材质,将Metal选择Decals着色器,将Cube赋予Metal材质,我用了一张钢锈的图片,可以看到贴花的纹理映射到地面上。
