How can i make a custom decal shader graph?

Hello,
I tried to use a custom decal shader with shadergraph but doesn’t work, i tried using HDRP decal projector with a material with the custom shader. I just made a shadergraph with a texture to test the shader but nothing is projected, how can i make a shader in shadergraph that works like the default HDRP/decal shader which works perfectly with the decal projector?

A shadergraph decal shader should just work, like the regular decal shader, with the exception that it doesn’t project on transparent objects.

I am trying to project on a opaque terrain, the HDRP decal projector works fine with the default decal shader but not when i create a decal shader with shader graph with just one texture connected to base color
This is my shader

I don’t know what to say, It just works for me :confused:

Are you using the material inside HDRP decal projector?

Yes

Found the problem the decal projector had already set a 45 tiling value and i added to my shader also 45 so was so small i couldnt see it, and also was a semi transparent image

In shader graph the position node represents the position of the object where is projected or the position of the projector?
I want the shader just draws from certain height to another height in the terrain to make caustics

IIRC, for a decal the position node is the position relative in the decal’s coordinates.
I don’t remember if when set to world space it’s the pixel world position.
But you can also reconstruct the position from the depth buffer if needed.

Yes, i mean position set to world. But what other shaders make is calculating the depth subtracting the camera depth to the screen position of the water plane, in this case camera is underwater, so can’t calculate the water depth in that way but subtracting a fixed water plane height to the world pixel position of the decal so that is rendered the caustics just near the shore and then lower in intensity as there is more depth

It would be more useful to elaborate your message. Custom functions work with shadergraph in general, but because it relies on using shader includes, it can lead to conflictual function/variables declarations.

So unless you explain your specific case of failure from where we can start to have a constructive discussion, this critic is useless.

@KCGames47

Just compare your two previous messages : one is a 3 liner complain without details and criticizing the whole software for a single specific failure, where the last one is giving arguments with links to other threads where the issue is exposed.
This is what I was talking about when saying “useless critic”.

With that said, I did try to use a dead simple custom function with a hlsl file in a decal shadergraph, and it worked, on latest 2022 LTS :

So, giving a general status on the “hlsl include and custom functions in decal shadergraphs” doesn’t seem to be that simple, and it might depend on the content of the include itself, without further informations on your specific issue it might get hard to help you.