I know there is no way to acheive Point filtered shadows in HDRP using the default unity shaders/shadows, how could i go about making something to have pixelated shadows like the image ? Would i need to change the object's shaders ? or something about the lights ? or the render pipeline code itself ? i just need indications on where i should look in the first place
#Any way to acheive shadows like this ?
1 messages · Page 1 of 1 (latest)
thank you ^^"
there is in fact a way :D
its not antialisaed like the picture but it works anyway
answer is in there
I've answered again on discussions ^^
I think there might be a solution to have a "pixelated filtered shadow", by keeping the PCF_Tent_3x3 method, but use a point sampler state inside it.
In discussions again
Couldnt make it work :(
all the shadows are broken
I answered again, with actually trying it on my side and gave you a solution.
I think this is what you want now :
This is perfect, thank you
I know this is solved, but any idea how to do it in URP ? i cant find a file that defines what filtering to use
i assume it is somewhere in this one ? https://github.com/Unity-Technologies/Graphics/blob/master/Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl
Yes, from L234 to L340
You can see the individual filtering functions, and the global sample calls.
Did you try to disable soft shadows in the URP asset ?
i did turn off soft shadows, but they are still bilinearly filtered and not point filtered
yeah it seems to be the place to change something but i dont really know what to change-
Doesnt seem as simple as in HDRP
L332 is where the shadow is sampled when softshadows are off.
I guess you just have to change the sampler state, like for HDRP.
i test it and i come back
huh
I added a step 0.5 around the function but its not exactly what i expected
attenuation = step(0.5, real(SAMPLE_TEXTURE2D_SHADOW(ShadowMap, sampler_ShadowMap, shadowCoord.xyz)));
Im not sure if i can change the sampler state, i assumed i couldnt like in hdrp but Im gonna try anyways
Sorry if im really slow its a lot of trial and error lol
got it !
ill be honest i had to use chatgpt for help but it did figure it out after a lot of handholding damn
basically, replace line 332 with
attenuation = shadowCoord.z >= shadowDepth ? 1.0 : 0.0;```
Thank you for helping find the line btw, you're an angel!
Minecraft's shadows are not exactly point filtered
They are soft but snapped to world coordinate grid, or texture UVs (times two) like this, no difference if the world is a voxel grid
Oh damn
I might try doing it in shadergraph, it looks cool
Thank you!