ac-custom-shaders-patch / acc-extension-config

Configuration files for Assetto Corsa Custom Shaders Patch
224 stars 220 forks source link

Shadow map filtering exhibits backfacing #197

Open chas1723 opened 2 years ago

chas1723 commented 2 years ago

for a while now, there has been an issue with shadows which causes them to have stripes in them. It is very dependent on the sun angle to the object that shows the stripes. Open wheel cars show it the best on the tires but every vehicle does it.

https://imgur.com/2XrrT79

chas1723 commented 2 years ago

if you download that image and look at the full file, you will see the lines on the tires and body of the car.

Marocco2 commented 2 years ago

I'll close the issue because it's not a CSP bug. To solve this, you need to disable double shadow

[SHADER_REPLACEMENT_...]
MESHES = carpaint, tyres
DOUBLE_FACE_SHADOW = 0
chas1723 commented 2 years ago

I will try that. I see many complaining about it so I assumed it was csp.

Trava715 commented 2 years ago

@Marocco2 By default double faced shadows are disabled and It happens if there's backfacing very close to the shadowed surface. However with CSP it happens even on objects with no backfacing such as tyres and similar.

image

Trava715 commented 2 years ago

Consistently reproducible at Road America image

can be fixed with

[SHADER_REPLACEMENT_...]
MATERIALS = ?
DOUBLE_FACE_SHADOW_BIASED = 1

but that's going to adversely affect performance and might break other things such as overlays not supposed to cast shadows.

It seems to be a vanilla issue being exaggerated in some way by CSP. https://digitalrune.github.io/DigitalRune-Documentation/html/3f4d959e-9c98-4a97-8d85-7a73c26145d7.htm#:~:text=Shadow%20biasing,the%20direction%20of%20the%20light.

One way of fixing it would be adding an optional "apply globally" checkbox inside CM with a simple check to exclude any CAST_SHADOWS = 0 meshes by default for people who have beefy enough hardware and don't want to see it. @gro-ove ?

Trava715 commented 2 years ago

Update: DOUBLE_FACE_SHADOW_BIASED does not make it go away but makes it a lot less noticeable.

0 image

1 image