Frictional Games Forum
SSAO is inverted - light instead of shadows - Printable Version

+- Frictional Games Forum (https://www.frictionalgames.com/forum)
+-- Forum: SOMA (https://www.frictionalgames.com/forum/forum-55.html)
+--- Forum: User created content (https://www.frictionalgames.com/forum/forum-79.html)
+---- Forum: Technical Support (https://www.frictionalgames.com/forum/forum-80.html)
+---- Thread: SSAO is inverted - light instead of shadows (/thread-56521.html)



SSAO is inverted - light instead of shadows - Asthanius - 10-03-2019

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.

EDIT:

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]


RE: SSAO is inverted - light instead of shadows - Darkfire - 10-03-2019

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:
https://discord.gg/5RvchzN