Search Unity

Question Decal Graph with World Space UVs

Discussion in 'Shader Graph' started by Ryan_Splyan, May 29, 2020.

  1. Ryan_Splyan

    Ryan_Splyan

    Joined:
    Nov 4, 2019
    Posts:
    1
    I'm trying to make an HDRP Decal Graph which blends between a couple of textures tiling in world space and I'm not sure where I'm going wrong but the end result looks like its cutting through the terrain or any mesh I put the decal over, rather than just projecting over it.

    So far what I've done is get the absolute world space position and put that into a tiling and offset node to control the tiling amount, and that's plugging into the UV slot of my sample texture 2D. I'm doing this for my two textures I want to tile as well as a black and white noise texture which I'm using to lerp between them. Then I have a mask texture which I'm plugging into the Base Colour Opacity output so that I can feather the edges of the decal.

    As it is, it works exactly as I'd expect it to if I create a plane and apply the material to that, but when I use a decal projector with the same material I get a different result, so I'm guessing there must be something specific to decal projectors that I've missed.

    In the attached image, on the left is my shader on a plane while on the right is the result form a decal projector.

    DecalProblem.PNG
    And here is my graph

    DecalGraph.PNG
    Thanks!