#Severe Light/Shadow Banding on lit PSX shader [URP][Unity 6.2]

1 messages · Page 1 of 1 (latest)

errant zealot
#

As the title says, I'm trying to create a lit PSX shader in shader graph with vertex snapping, however the lower the vertex resolution I set, used in ranges of [8, 16, 32, 64, 128, etc...], creates a severe light banding effect on the models I apply it to. High resolutions like 256-512 barely have the effect but also barely have any snapping.

I have discovered that only when both cast shadows and recieve shadows are enabled it happens. If either is disabled there is no light banding so the shadow pass seems to not be using my vertex displacements properly

flat hatch
#

I'd instead try using unity_WorldToCamera/unity_CameraToWorld in a custom function

#

Try Custom Function node. Under Node Settings tab while that node is highlighted :
Mode : String
Inputs :

  • Position (Vector3)
  • Steps (Float)
    Output :
  • Out (Vector3)
    Body :
float3 pos = mul(unity_WorldToCamera, float4(Position, 1)).xyz;
pos = floor(pos * Steps) / Steps; // Posterize
Out = mul(unity_CameraToWorld, float4(pos.xyz, 1));

In graph use Position node in World space in graph for first input
And after Transform from World to Object

errant zealot
#

I'm basically a beginner with shaders so I don't know how to go about adding this

#

Oh I see custom function node, let me check that out quick

errant zealot
#

Testing it now

#

Seems to be working so far