Frictional Games Forum (read-only)

Full Version: SSAO is inverted - light instead of shadows
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm working in HPL3 and noticed that I get very strange lighting around the edges of certain objects in-game, which disappears when I turn SSAO off in the options. This obviously means the SSAO isn't working correctly, but I have no idea why.

This even causes things like, when I move a door, there's a band of light on the edge that moves with the door.

It's easiest to see the issue around the mirrors and in the corner on the left, where there's strange lighting that shouldn't exist.

I had someone much more knowledgeable in code take a look at shadersource.hpss, and they said the math for computing SSAO looks correct, so maybe it has to do with when it's applied?

Does anyone know how I can solve this issue?

[Image: Kox7Sjs.png]

NOTE: I've also attached my hpl.log, which does seem to mention SSAO errors.


Okay, so I found the .hpsl shader files and tried reversing some of the results (e.g. changing specific instances of "+" to "-", or "*" to "/"), which partially fixed the issue. Those lights I saw before disappeared, but now they're appearing where there used to be proper shadow.

[Image: z5tETGA.png]
[Image: 184LCj5.png]
Sounds like you reversed the shadow-shading script to make them lighter instead of darker. I don't think this is the way to go.

This might have something to do with the way you light those levels, because you seem to use a one intensive BoxLight or smth similar. This probably won't be a problem when you apply usual lighting techniques.

PS. You'd probably better come to the official Discord with this: