#Shadow Only Shader in URP

1 messages · Page 1 of 1 (latest)

hollow kernel
#

Need a shader that only casts shadows in URP, any pointers?

foggy knot
#

Why a shader specifically, and not set it on the renderer ?

hollow kernel
#

I don't want to have two skinned meshes

#

tho I might have to

#

I hoped to avoid it because its all on skinned meshes

kindred topaz
#

Not sure how textbook correct this is but has worked for me


#if SHADERPASS == SHADERPASS_SHADOWCASTER
state = true;
#endif```
#

Probably doesn't require Lit graph, if shadowcasting keywords are set manually

foggy knot
hollow kernel
#

I wa going to use a render feature to override the material on a second pass but that didn't work

#

so i think this one's in the bin for me

foggy knot
#

Yeah, nope, renderer features don't inject into the shadowmapping passes.

kindred topaz
hollow kernel
#

So i already have a mesh thats visible, but the shadows are screwed on it since im using a shader to scale the mesh based on an FOV and Scale factor for my fps

#

So i was looking into ways of having normal shadows on the mesh without having multiple meshes basically

hollow kernel
#

Huge, as if the fov sscalong applies from the direction the light points in, and it doesn't match up with the mesh at all

kindred topaz
#

Fov scaling away from the light's direction? I'm curious what that looks like because I can't really imagine what that accomplishes

hollow kernel
#

The shadows are HUGE like way bigger than the mesh, and onlu visible in one specific direction, so I'm trying to figure out how to get shadows that match, without using two renderers

kindred topaz
#

Scaling to emulate a different FoV for a mesh is useful in general, but shadows are pretty challenging
Even if the shadow casting part of the mesh is scaled in some desirable way, it'll still not line up with the visible mesh so self-shadowing would be broken without more workarounds

hollow kernel
#

selfshadowing isnt a concern for me right now
I'll probably just add a second skinned mesh and set it to shadows only

kindred topaz
hollow kernel
#

as i said, ill probably just duplicate the renderer and make do i think

#

itll only apply for the player viewing through first person, so its not a huge concern