RPCS3 / rpcs3

PS3 emulator/debugger
https://rpcs3.net/
GNU General Public License v2.0
15.19k stars 1.89k forks source link

LBP 2 and 3 Missing Shadows #11317

Open JimScript opened 2 years ago

JimScript commented 2 years ago

In both Littlebigplanet 2 and 3, lighting will only propagate around the playable lanes, leaving a strangely fuzzy but sudden falloff. I know this is an issue because lights can still affect the background in Littlebigplanet 1. Note how the tip of the grass only gets lit as it moves into the playable area in the video below.

https://user-images.githubusercontent.com/66685584/147806561-2071aef0-343c-429d-af1e-ff3e7c9fa0bd.mp4

RSX Caputre: BCUS98245_20211229194940_capture.zip

And this is a log of another instance of the game in the same place as enabling logging causes a big performance hit and produces a huge log file if left too long(#10497): RPCS3.log.gz.zip

System:

Tarek2013 commented 2 years ago

Try with Read Colors Buffers enabled

JimScript commented 2 years ago

Read Color Buffers alone does nothing to fix anything, but when combined with Write Color Buffers makes the lighting fog render correctly, unfortunately it also cause the emulator to crash on level exit. But none of this has to do with the fact that lighting just stops at the playing area. It is less noticeable in LBP3 as there are more playable lanes, but it still just stops there even in the middle of a polygon. But sometimes at certain angles the game even fails to render the lighting in general.

Here in LBP1, the lights can affect the background geometry: BCUS98208_screenshot_2022_01_02_14_57_19

But as you can see in the first post, the lights in 2 and 3 just stop outside the play area. Here is an example in LBP3: NPUA81116_screenshot_2022_01_02_15_06_23

Edit: Read Color Buffers allow lighting in general in LBP3, but it doen't do anything special in LBP2 by itself. Edit3: I feel as if my post could be a little confusing so let me explain a little more. Enabling cpu blit causes the lighting fog to "disappear" only to reappear infrequently on the alpha of the background bushes for some reason. They can be brought back to normal with WCB+RCB, but it makes the screen blurry and causes the level to crash the emulator on exit. RCB is necessary for all lighting in LBP3 only.

The light propagation is an entirely different problem not affected by any of these settings and happens even when you run the game with default settings. And it looks strangely smooth, like it was designed that way, even though LBP1 doesn't do that and it looks incredibly obvious that it is not suppose to look like. I'm sorry for the confusion.

LBP1 Default: BCUS98208_screenshot_2022_01_02_15_42_36

LBP2 Default: BCUS98245_screenshot_2022_01_02_15_45_39

Yahfz commented 2 years ago

This issue is very convoluted. Please post a simple PS3 vs RPCS3 comparison to make it easier to spot what the issue is.

JimScript commented 2 years ago

Okay here is is a comparison between a RPCS3 screenshot and an ingame capture with the photo feature, so sorry about the quality.

Ingame real ps3 photo: A Photo

RPCS3 screenshot: BCUS98245_screenshot_2022_01_21_16_26_27

With RSX capture: BCUS98245_20220121162703_capture.zip

As you can see, the shadow is missing from the box. It also seems to be lit differently.

System:

Asinin3 commented 2 years ago

Just a note on this, the MLAA patch changes the lighting so don't use it to compare vs PS3. And, the lighting on the PS4 versions of these LBP games is different than the PS4 release. Excuse the squished image: image

PS3 VS RPCS3 VS RPCS3 with MLAA patch (Click to Expand) PS3 ![ps3](https://user-images.githubusercontent.com/15137035/164564190-1df49a16-43b2-4391-8c19-63c1a15b9d41.png) RPCS3 ![rpcs3](https://user-images.githubusercontent.com/15137035/164564393-418c8545-c010-4ec2-8cf8-2cdef2826666.jpg) RPCS3 + MLAA patch ![rpcs3 mlaa patch](https://user-images.githubusercontent.com/15137035/164564399-61438254-f6f5-40e2-9cef-903817c1f763.jpg)

These images are a bit old though, would appreciate a retest.

JimScript commented 2 years ago

Yeah, as far as I can tell, the lighting fog uses the same rendering layer as MLAA. But the weird thing is if it's "disabled" it will appear in the background of the gardens theme at certain angles, rendering how it should in the front. You can see this in the video in the first post.

Edit: Upon closer inspection, It seems that it removes a vignette effect from the screen too. Could all of the post processing be linked to MLAA? In #6348, It shows a leaked debug build that can manually disable MLAA without hacks, and if you look closely at the 2 sample images you see the same effects are missing.

I don't disable MLAA because the lack of flashlight light is really obvious, but in an earlier post it shows that there is a shadowing system that does not render in RPCS3 either way.

JimScript commented 2 years ago

In LBP3, I found a very helpful ingame function called "disable shadows" in the material tweaker. With it, I can better show what is missing and give a potential software lead on the problem.

PS3 enabled shadows: A Photo_1

PS3 disable shadows: A Photo_2

RPCS3 enabled shadows: NPUA81116_screenshot_2022_05_15_19_38_08

RPCS3 disabled shadows: NPUA81116_screenshot_2022_05_15_19_38_12

As you can see, the "disable shadows" function works on a real ps3, but not on rpcs3 as it is already missing.

TorutheRedFox commented 2 years ago

this lighting is done through a volumetric slice of a selected chunk of the game, as described here by Media Molecule themselves: https://advances.realtimerendering.com/s2011/Evans,%20Kirczenow%20-%20Voxels%20in%20LBP2%20(Siggraph%202011%20Advances%20in%20Real-Time%20Rendering%20Course).pdf

perhaps this could give a clue on where it could be failing (MRT rendering maybe?)

JimScript commented 2 years ago

Wow, this has an explanation on to why LBP1 has weird bar issues with its transparent objects, 'dual layer transparency'. But yes, RPCS3 doesn't seen to utilize this volumetric lighting, or it does but it doesn't get any slices to compute shadows. I only skimmed through it, but I don't know why removing MLAA has the affect of removing all post-processing, like foggy lighting and vignette. This documentation is pretty informative on to how LBP1 and LBP2 work and differ from each other(I am just going to assume that LBP3 is just LBP2, but slightly modified).

TorutheRedFox commented 2 years ago

it does use this volumetric lighting, but has issues doing the voxelization step

and the patch to remove MLAA may be instead turning off all post fx, as I don't recall all post fx being removed when doing it using the debug menu toggle to turn MLAA off

JimScript commented 2 years ago

Last I saw #6348, disabling MLAA in the debug menu did get rid of the glow around the start gate and the darkening around the screen.

TorutheRedFox commented 2 years ago

huh, odd

JimScript commented 2 years ago

Yeah, and when you increase the resolution scale the lighting fog gets 'dotted', as if there is a preset resolution from the CPU.

TorutheRedFox commented 1 year ago

the initial 4 AO slices do get rendered though, as they sometimes leak into the pause menu's render buffer BCET70023_screenshot_2022_10_08_16_09_42

so there's something going wrong with decoding and combining those slices into the volumemap they use (maybe 3d textures are the issue here?)