Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphical bugs in Colin McRae Rally 2005 #7810

Closed
enomat opened this issue Jun 13, 2015 · 21 comments
Closed

Graphical bugs in Colin McRae Rally 2005 #7810

enomat opened this issue Jun 13, 2015 · 21 comments
Milestone

Comments

@enomat
Copy link

enomat commented Jun 13, 2015

The sky doesn't appear when the weather is rainy.

screenshot_2015-06-13-18-46-29

@ppmeis
Copy link
Contributor

ppmeis commented Jul 27, 2015

For now I detect these issues on Windows:

Sun is a black square:
image

Also, shadow flickering in almost all objects:
image
image

It's curious, but when the car is completely stopped, shadows look fine.

But I don't get any problem with weather, even snow works fine. Which device are you using? Maybe it could be a PowerVR bug...

@ppmeis
Copy link
Contributor

ppmeis commented Dec 6, 2015

Tested with latest build, now the sky is completely black:
image

Fortunately, shadows are good now:
image

@unknownbrackets
Copy link
Collaborator

Can you try to catch when it's rendering the sky in the GE debugger?

Skies can be tricky to catch, especially when they're drawn black. It might be the first thing it renders (before it draws other stuff on top), but it might also be something it draws near the end (stenciled in using depth testing or otherwise.) Best to check the texture on the left to be sure.

It also might be separately applying the rain effect: for example, it might first apply the sky, and then do something tricksy to the sky to make it look like rain. It could be that this is now generating black, if you initially see sky and then it's erased.

-[Unknown]

@hrydgard
Copy link
Owner

Seems the sky is no longer black, but the shadows are blinking.

@hrydgard hrydgard changed the title Sky bug: in Colin McRae Rally 2005, the sky isn't rendered when the weather is rainy Graphical bugs in Colin McRae Rally 2005 Dec 13, 2017
@hrydgard hrydgard added this to the v1.6.0 milestone Dec 13, 2017
@ppmeis
Copy link
Contributor

ppmeis commented Dec 13, 2017

Tested with latest build, It looks like one frame draw shadows and one not. Here an example:

No shadows:
image
image

When shadows are ok:
image
image
image

@hrydgard hrydgard modified the milestones: v1.6.0, v1.7.0 Mar 24, 2018
@hrydgard hrydgard modified the milestones: v1.7.0, v1.8.0 Sep 16, 2018
@unknownbrackets
Copy link
Collaborator

Could you try exporting a GE frame dump? If possible, it'd be great to have one with and one without the shadows (I'd suggest just mashing record, and then checking the dumps that result to find two useful ones.)

You can check a dump simply by opening it with PPSSPP.

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]

@ppmeis
Copy link
Contributor

ppmeis commented Nov 19, 2018

Tested with latest build. Same issues:

image
ULES00111_0001.zip
ULES00111_0002.zip

@unknownbrackets
Copy link
Collaborator

Hm, both of those dumps seem to have proper shadows (same as PSP rendering, and they look right too) when played back alone. That means it could be some sort of state issue, or it could be some texture/framebuffer overlap.

-[Unknown]

@hrydgard hrydgard modified the milestones: v1.8.0, v1.9.0 Feb 10, 2019
@hrydgard hrydgard modified the milestones: v1.9.0, v1.10.0 Aug 6, 2019
@hrydgard hrydgard modified the milestones: v1.10.0, Future Mar 9, 2020
@nassau-tk
Copy link
Contributor

Oops!! I duplicated.
#13478
Sorry.
for reference.

@ghost
Copy link

ghost commented Oct 9, 2021

Sun still got a blackbox similar to burnout legend
if I enable SBTE doesn't help on this game graphics issues and also the game is slow.
Screenshot_2021-10-09-09-06-19-263_org ppsspp ppsspp

Add this game id to IntraVRAMBlockTransferAllowCreateFB fixes the performance issue if SBTE is enable.
Screenshot_2021-10-09-08-44-26-026_org ppsspp ppsspp

ge dump
Colin McRae.zip

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Oct 18, 2021

Is the sun box thing not happening for all devices? It doesn't happen for me on NVIDIA or recent Adreno with any graphics backend. The sky also looks fine in that dump.

However, a much more interesting thing DOES happen: the sun only works properly at 1x.

Another interesting thing: the first frame render has no shadows, and then the second render has shadows, even from the dump. So it is reproducing.

First, the sun:
At 1368/1499, it draws on top of the tiny sun I see at 4x.

  • First, alpha blended black in throughmode, fixed ONE + ZERO, so in other words not alpha blending just replacing. No masking, so it really does just replace it with a black box.
  • Next, it textures in a sun with transparent edges in the same place (also through), same blend. At this point, we have a black box sun and it's bigger than the original tiny sun. This part uses a depth test so any objects that might occlude the sun are black.
  • This is drawn to 0x04044000 at 5551.

Sun at this stage with black box
So far, everything is the same at 4x.

Now at 1370/1499, there's a temp sun:

  • First black is drawn to 0x040dc000 at 8888, a 29x28 area.
  • Then it copies in the sun with a != 000000 color test. Because it just drew black, this is basically pointless.
  • Now it does a self-texture, which seems to confuse the GE debugger preview somehow, halving the size of the sun to the same buffer. Yuck.
  • It halves it four times more, again self-to-self each time. The last time is 2x2, so it's pretty serious about blurring it, I guess.

Successively smaller versions of grayscale sun

And now for the trick that misbehaves at > 1x: it textures from the top left pixel to the entire 29x28. At higher resolutions, this is black. All this work to I guess figure out the intensity of the sun (i.e. how occluded it is) as a 1x1 blur?

At 1378/1499, we texture the color it just drew to a new buffer, 0x040fc000, also 8888. This one is 256x32. But for good measure, it textures again (also from the top level texel) to 0x04104000 for just the top 256x16.

At 1380/1499, it blends that with a texture, that makes a bit of a beveled gradient. We get this at 1x (and 100% black at higher):
Gradient with more brightness on the left and some blurring, almost like a paint stroke

Back to 0x040fc000 at 1384/1499, it blends a much more straight forward gradient:
Gradient darkened to sun intensity

Again, all of these would be 100% black at > 1x without "lower resolution for effects."

At 1386, we return to 0x040dc000 again, drawing a fresh sun. This uses the same dst blending to darken it as well, so again it becomes entirely black at higher res. We then texture that on top of the original rendering at 1387/1499 (which has had its previous sun restored, I guess by block transfer?)

This time, we're doing a fixed ONE + ONE blend, so the black around the edges of the sun ought to blend in. The only reason we'd get black corners here is if the presumed block transfer didn't reupload the old sun, or if it didn't download it correctly. This sun is drawn a few times to make it a bit blurry and increase the intensity back up, but again nothing would get drawn at > 1x.

It then uses the gradients from before to create a bit of a halo around the sun and some rays. This finishes with 1443/1499

I didn't see anything alpha related here, so I don't think stencil/dual source blending is at play, so block transfer, slow effects, or function replacements being disabled seem like the only way to get that issue. Or skip buffer effects, of course.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Now, shadows:

Initially, it draws the ground. Here's a screenshot:
Ground before any shadows, trees, or objects

At 152/1499, it draws an offwhite from a texture to 0x040cc000 (5551.) Then it proceeds to draw the shadows to this other buffer, through 367/1499. At 368/1499, it blends some white to brighten it up a bit. It textures that using dst + ZERO blend, which applies the shadows to the actual scene. Here's the shadows drawn:
Scene without trees, but with shadows on the ground

But this blend just... doesn't work the first time around. It doesn't blend. And the reason is that the shadows never even get drawn, that first time. And that's all because of depth.

At 151/1499, we've created a new and beautiful depth buffer at 0x04088000. We reuse this depth buffer for the shadows, just with depth write disabled. But it's not copying the first time.

If I make it copy the depth buffer on create (not just switch), then this works for the first frame and everything is fine. I'm thinking we should do that, but I don't see why that would cause flicker? Maybe there's more happening with that temp buffer, or it's misdetecting the levels of separation?

-[Unknown]

@ghost
Copy link

ghost commented Oct 22, 2021

This game required buffered rendering warning in compat ini because skipp buffering cause graphics issue
Screenshot_2021-10-22-10-36-10-829_org ppsspp ppsspp

The sun still causing lag if SBTE is enable
Screenshot_2021-10-22-10-52-51-174_org ppsspp ppsspp

software rendering
Screenshot_2021-10-22-10-46-14-867_org ppsspp ppsspp

@enomat
Copy link
Author

enomat commented Oct 24, 2021

These are the workarounds to fix shadow flickering:

  • Press the Android's Recent Apps Button, then switch back to PPSSPP.

OR

  • Set Frame skipping to 1.

Setting the Frame skipping to 1 usually fixes the problem. It locks the shadows in either "visible" or "not visible" state. If the shadows are not visible then press the Recent Apps Button, then switch back to PPSSPP. Or disable frameskipping, go back to game, then enable frameskipping again, and repeat it until shadows are visible.

OR

  • Create a save state then load it.

The shadows are fixed until you quit the game. The next time you start the game you need to do one of these workarounds again. Except if you load the game from save state, because loading a save state fixes the shadows.

Tested it on LG V20 H990N, Android 8.

@ghost
Copy link

ghost commented Oct 24, 2021

These are the workarounds to fix shadow flickering:

  • Press the Android's Recent Apps Button, then switch back to PPSSPP.

OR

  • Set Frame skipping to 1.

Setting the Frame skipping to 1 usually fixes the problem. It locks the shadows in either "visible" or "not visible" state. If the shadows are not visible then press the Recent Apps Button, then switch back to PPSSPP. Or disable frameskipping, go back to game, then enable frameskipping again, and repeat it until shadows are visible.

OR

  • Create a save state then load it.

The shadows are fixed until you quit the game. The next time you start the game you need to do one of these workarounds again. Except if you load the game from save state, because loading a save state fixes the shadows.

Tested it on LG V20 H990N, Android 8.

Flickering already solve in the latest ppsspp git build

@nassau-tk
Copy link
Contributor

nassau-tk commented Oct 25, 2021

Thd flickering issue is not solved on my GalaxyS20.

And,The flickering disappear when switch from on game to Android home and back to the game.
My device too.
Android 11
SD865
RAM 12GB

@ghost
Copy link

ghost commented Oct 25, 2021

Thd flickering issue is not solved on my GalaxyS20.

Adreno gpu issue because LG V20 H990N is also Snapdragon 820 and adreno 530 gpu

And,The flickering disappear when switch from on game to Android home and back to the game. My device too. Android 11 SD865 RAM 12GB

Cannot reproduce the flickering since 12ad2b0
My GPU is Mali-G52.

@QrTa
Copy link

QrTa commented Aug 29, 2022

To "correct" lens flare until it get fixed. Use this cheat.

_S ULES-00111
_G Colin McRae Rally 2005 Plus
_C1 Correct Lens Flare
_L 0xE01C2025 0x00197CA4
_L 0x2019925C 0x0E200800
_L 0x20199260 0x00115040
_L 0x20002000 0x16800007
_L 0x20002004 0x3C1BB504
_L 0x20002008 0x277B0040
_L 0x2000200C 0x17630004
_L 0x20002010 0x00000000
_L 0x20002014 0x00002821
_L 0x20002018 0x00004021
_L 0x2000201C 0x00004821
_L 0x20002020 0x03E00008
_L 0x20002024 0x022A5026
_L 0x20198AC8 0x0A20080A
_L 0x20198ACC 0x7D05B804
_L 0x20002028 0x3C1BE100
_L 0x2000202C 0x17650009
_L 0x20002030 0x3C1BE100
_L 0x20002034 0x277BFFFF
_L 0x20002038 0x17640006
_L 0x2000203C 0x8D64FFFC
_L 0x20002040 0x3C1BCB00
_L 0x20002044 0x277BFFFF
_L 0x20002048 0x17640002
_L 0x2000204C 0x3C1BE200
_L 0x20002050 0x2765FFFF
_L 0x20002054 0x0A2662B4
_L 0x20002058 0xAD650008
_L 0x20197CA4 0x00002021
_C0 Correct Lens Flare [Disable]
_L 0xE0052021 0x00197CA4
_L 0x2019925C 0x00115040
_L 0x20199260 0x022A5026
_L 0x20198AC8 0x7D05B804
_L 0x20198ACC 0xAD650008
_L 0x20197CA4 0x00852025

@nassau-tk
Copy link
Contributor

The sun will drawn correctly on v1.13.2-2076.
*No appear the black box.
But FPS goes down on Android more than before fix it.

Galaxy S20/Android12
Snapdragon865 /Adreno650/RAM12GB

But Windows work smooth.
Windwos 10
Ryzen7 3800X
Nvidia Geforce RTX3060
RAM32GB

@hrydgard
Copy link
Owner

Oh indeed, the shadows work too now, that's nice.

The slowdown looks to be caused by a GPU readback, I'm gonna see if it's avoidable or not.

hrydgard added a commit that referenced this issue Nov 26, 2022
…pies.

Improves performance when the sun is visible, see #7810
@hrydgard
Copy link
Owner

That wasn't too hard, fix committed.

I'm gonna go ahead and close this. Please re-open if you see any new graphical issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants