Closed hrydgard closed 5 years ago
Monster Hunter's lighting in general is too dark(https://github.com/hrydgard/ppsspp/issues/2526). Also, cooking steaks in Monster Hunter is made much more difficult by the meat not changing in colour as it cooks, like the fish issue(it goes from a light red/raw to black if it burns).
Is the bright Wipeout considered a lighting issue?
Most likely not.
I think all this is fixed except the strong light in Virtua Tennis, which might be an entirely separate issue. It occurs when the "strike power" meter is shown, before that it looks correct.
https://github.com/hrydgard/ppsspp/issues/2526 seems to have been fixed, so that can be marked off the list.
Shouldn't Sonic Rivals 2 be included to the list?
This isn't really about bloom issues. Does that game look correct in softgpu? If yes, then it's probably not a lighting issue.
-[Unknown]
I think item 2 should be fixed .Item 4 is not .Wondering how about item 1 and 3?
Yes, the issue which occurs in Monster Hunter games is fixed :)
Is Virtua Tennis any better now?
-[Unknown]
@unknownbrackets Virtua Tennis World Tour is a bit better during gameplay but in near camera views players are too bright:
Does the GE debugger show anything when it's drawing the areas that are too bright?
-[Unknown]
@unknownbrackets here you have:
It's using color doubling but the texture already looks reasonable imho. Unless we're doubling incorrectly (I don't think we are), not sure. Though, it's using a texture level bias. Does the other texture level look different, other than smaller? e.g. is it darker?
-[Unknown]
@unknownbrackets no, other texture levels look the same color and brightness.
If you change "Light 0 enable" (by double clicking) to off right when it's sitting with the face highlighted in red, and then click "Step Draw", does it make it darker, or is it the same?
-[Unknown]
It would be interesting if these issues reproduce now in softgpu (especially starting from the beginning.) If it's an issue of RAM not being updated somewhere, i.e. stencil or depth or w/e, then softgpu may handle it more correctly.
-[Unknown]
Apart from some black pixels (rounding issues) Virtua Tennis looks fine in the software renderer.
It's actually really strange that this is still buggy in the hardware renderer... i wonder what it could be.
By the way I'm going to turn off the "slow" warning in the software renderer :)
Well, frameskip does still help in softgpu, but sure, heh.
-[Unknown]
Blade Dancer also has an issue - both in softgpu and GLES.
Also, double-checked that this wasn't somehow a bug in the real game. A few notes:
It uses the same lighting parameters for basically the entire scene. Probably the lighting parameters are being calculated too close?
-[Unknown]
What's incorrect in the screenshot? The dark triangle?
What do you mean by "calculated too close"? Sorry :)
Yes, the blue triangle is wrong. It shouldn't be there at all. Note that the same blue is darkening things like the steps, the walkway, the wall, etc. The amount of blue is correct on those things.
-[Unknown]
Could always be some inf or nan interpreted differently than the PSP, but that's just speculation...
Here's all the tabs when it draws it (PRIM_TRIANGLE_STRIP): https://gist.github.com/unknownbrackets/8f98e0511e1991932b21ef2cf565d974
Disabling the light 1 flag for only this draw makes it look approximately correct (but other things look wrong unless light 1 is manually re-enabled before continuing drawing.) I don't see any inf/nans, but maybe it's guardband related or something...
Quickly checked - JPCSP does not have this bug. However, it also renders the opening scene wrong (the girl is not translucent - which is a lighting bug in JPCSP.)
-[Unknown]
See ULUS10124_0001.zip ULUS10124_0002.zip for a dump of the Blade Dancer lighting issue. Will also add to the issue description.
Edit: Uploaded a new one since the old broke.
-[Unknown]
I'm not sure why, but #10411 has made the Blade Dancer issue stop happening in GLES. It still happens everywhere else and in softgpu.
This may be a case of "accidentally working", I'm not sure...
-[Unknown]
This issue have maybe Flat Out Head on too.
An interesting finding, the Blade Dancer bug doesn't happen in OpenGL in game... but it does happen from the dump. This makes me think it's an alignment issue or something.
-[Unknown]
Any change to the Virtua Tennis, NBA, or Flat Out Head On issues?
Could you try exporting a GE frame dump? These help a lot (already have one for NBA, sorry, see #4109.)
See here for instructions - it's not hard and works on Android too: https://github.com/hrydgard/ppsspp/wiki/How-to-create-a-frame-dump
You can zip that and then drag and drop it into a reply here.
-[Unknown]
Virtua Tennis still has problems, so here's a couple of frame dumps. In the first one (03), the character lighting is normal. In the second one (04), the lighting is wrong and too bright.
The change to the bad lighting happens when you hit X to start a ball strike, which shows the little meter. Presumably it sets some state that the rest of the drawing shouldn't care about but somehow does...
Here's a youtube video confirming what the normal lighting looks like: https://www.youtube.com/watch?v=TAhAGgeJthM
Texture for overly bright person: 0x04105720
For reference, the correct image for that frame:
And the incorrect:
Interestingly, softgpu also gets the lighting wrong and the shadows even worse. It also has an easy to fix bug breaking clearing, which I'll fix soon. What's interesting is: it used to work in the software renderer. This implies it's not a state thing.
If I disable light 0 (the only enabled light), the characters are too dark. This light uses powered diffuse + spec. If I remove specular from the equation, it looks right.
The shadow uses color doubling + standard blend, and the same lighting parameters. It also looks correct without specular. Curiously, softgpu loses the shadow after the first frame.
The check from #8403 doesn't help. Also, because getMaterialSpecularCoef is 1.0, pow doesn't really matter.
It's not possible that mode 2 is powered diffuse only, and not specular, is it? Hm.
-[Unknown]
Hardware tests so far indicate that mode 2 is powered diffuse only, no specular. Also makes this dump look perfect, except in softgpu (still not sure what's causing the shadow to evaporate after the first frame - it's drawn briefly... so weird.)
I'm seeing some other possible differences though. For example, lightdir = (0, 0, 0) seems to normalize to (0, 0, 1) for spot lights, and a clamping issue for spot lightScale.
It also seems like lighting is generally rounding down, not up, but that's a fairly minor accuracy issue...
Need to check more and see how games react to this, but later.
-[Unknown]
Nice! All of it makes sense, I think this will fix a lot of graphics issues. Did you confirm that specular is off if dot(light, normal) is <= 0.0?
With rounding down, do you mean when it gets rounded to the final screen color from float? I thought we were already effectively doing that, but maybe not... Come to think of it, should we maybe explicitly round down before multiplying with the texture color in case of MODULATE, hm... I mean, really we should probably do what Dolphin did and perform the fragment shading in fixed point, but that would not be good for perf on older mobile chips.
Yeah - many of the tests I'm running are giving me colors that are off by one, e.g. 00471d1d
instead of 00461d1d
(diffuse.) I'm running these tests with no texturing at all, actually.
Didn't create a test yet to confirm specular during diffuse + specular, still more to test...
-[Unknown]
Confirming that Virtua Tennis looks good now. For the record, it was the no-specular-during-powered-diffuse.
Tested with latest build. Now lightning seems to be fine, but now start menu has disappeared in some backends:
Vulkan: ULES00126_0001.zip
OpenGL seems to be fine:
Direct3D9:
Direct3D11: ULES00126_0002.zip
Near texture 0x08973d00 + several draws to VAIDISOVA. I think that's a separate issue related to depth.
It draws verts with a crazy high Z, depth clamp, and standard minz/maxz. It uses src >= depth
test. This passes and it draws the BG and clamped depth. Lighting is disabled. Alpha test and blend, but 8c alpha sent.
Not clear what should be keeping it from drawing... it doesn't draw on a PSP running the same dump...
Should open a separate issue, since lighting is disabled.
-[Unknown]
As I don't think NBA Live 06 (#4109) is a lighting problem, I'm gonna close this. If we discover more lighting-related problems, let's open new game-specific issues.
Bugs probably caused by something wrong with our lighting equations (possibly edge cases, NaNs, whatnot):
Strong yellow light in Fired UpFish with the wrong color in Monster Hunter (reported in forums), also some pointer arrows (FIXED)Overly strong light in Virtua TennisUnexpected blue and banding in Blade Dancer (ULUS10124_0001.zip)