Your comments

For those curious about implementation.


Allegorithmic Substance:


Shader Forge Shader:

That UV on the left (feeding into the relay) is what needs to be replaced with projection UVs but I was unable to figure that part out using Shader Forge :(

It turns out it was just too much work & near impossible to get a projection shader working in Shader Forge, which is sad, but it doesn't mean Shader Forge didn't help me. In the end the best route was to create the shader, and then edit the output result manually and turn it into a projection shader by hand. I'm hoping it'll be supported some time in the future, but for now, at least, I managed to get my blood splatter projection shader working.


Tools: Allegorithmic Substance (procedural textures making random splat shapes in-game) -> Shader Forge base custom shader -> manually edited and turned into a projection shader


Result:

Apologies I'm still learning shader forge. How do I use "v.vertex" as an input to matrix multiplier? That's where I got stuck.

I'm attempting the same:


what you need is:


uniform float4x4 _Projector;


(correctly naming a matrix property in SF works for this)


then within "vert" :


o.posProjector = mul(_Projector, v.vertex);


then within "frag" :


if (i.posProj.w <= 0.0) return float4(0,0,0,0); // behind projector, ignore

return tex2D(_MainTex, i.posProjector.xy / i.posProjector.w); // return decal


Generally the above would be used in conjunction with a falloff:


vert:

o..projClip = mul(_ProjectorClip, input.vertex);

frag:

float4 fallOff = tex2Dproj(_FalloffTex, i.projClip);


result:

return float4( tex2D(_MainTex, i.posProjector.xy / i.posProjector.w), fallOff.a );



I spent an hour trying to learn shader forge hoping it'd speed up this crazy projector I have to make. Kinda sad it seems impossible (currently).



[EDIT]


in my opinion the most important node (for this) that shader forge is missing is:


Geometry Data/Projector Position :: o.posProjector = mul(_Projector, v.vertex);