-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Sega Rally [ULES00910] - Missing dirt impact over the car #6979
Comments
Might have to do with texture levels. Do the mipmap levels look different other than smaller? -[Unknown] |
@unknownbrackets The other same effect for the CPU cars is smaller and it appears in the screen. It has the same look at this one but is 128x128 instead of 256x256. But now I notice that the effect only is missing in that car model :S. Also, when I switch between Buffer Rendered to CPU/GPU and back to buffer rendered, The effect appears! :S Tested in OpenGL and Direct3D9 |
Tested with latest build. Same issue. Also I figured out when you are playing other cars don't have dirt impact, it only appears when I switch buffer render. |
Tested with latest build. Same status. |
So, it's probably a copy that we're missing... When it draws the dirt (above screenshots), can you press "step prim" to see it highlight where it's drawing? It changes more settings after that, so I want to know what settings it's actually drawing with. 0x09* can't be something that needs copying back to memory. Are there any textures it uses that start with 0x04*? Otherwise, it's probably copying from somewhere else it's rendering to. -[Unknown] |
The mud draws to the wheel,but not draw to the car body,they use the same texture 0x09a7a100.Don't know if the reflection effect of the car,it can't draw to. more tabs |
Well, the texture looks fine... it does use a depth test, though. But it can't really be depth related if "read framebuffers" solves the problem. There must be some framebuffer it's rendering to (even if it's not during the race) that causes it. In GPU/GLES/Framebuffer.cpp, you can find this: void FramebufferManager::ReadFramebufferToMemory And on the next line log which framebuffers it reads (during "read framebuffers to memory" mode): NOTICE_LOG(HLE, "Downloading: %08x", vfb->fb_address); Then, we can try forcing off some of those framebuffers. That is: if (vfb->fb_address != 0x00044000 && vfb->fb_address != 0x00000000) {
return;
}
NOTICE_LOG(HLE, "Downloading: %08x", vfb->fb_address); Until we've narrowed it down to the one that makes it work. Then we have to figure out where it's rendering there and how we can detect that it needs to be copied out of GL. -[Unknown] |
Read framebuffers to memory does not solve the problem in the latest build. |
Even force return in the top of ReadFramebufferToMemory it still get the mud when changing rendering mode. |
I see, then most likely we are keeping a stale framebuffer alive when the memory behind it has been written to separately. We might still be able to trigger an upload which might fix this. What FBOs does it say are deleted and created when you change rendering mode? If one is deleted and never created, then it's probably that one. -[Unknown] |
seems each one is created
|
Hmm. I forgot that we upload framebuffers on create. In GPU/Common/FramebufferCommon.cpp: if (useBufferedRendering_ && !updateVRAM_ && !g_Config.bDisableSlowFramebufEffects) {
gpu->PerformMemoryUpload(fb_address_mem, byteSize);
NotifyStencilUpload(fb_address_mem, byteSize, true);
// TODO: Is it worth trying to upload the depth buffer?
} Try putting an if around this and skipping some of the buffers (0x000d4000 seems like a good one to try first.) That will make it create as black instead of uploading the RAM to GL. -[Unknown] |
if (useBufferedRendering_ && !updateVRAM_ && !g_Config.bDisableSlowFramebufEffects && vfb->fb_address != 0x000d4000) { |
Then maybe it isn't that after all... or maybe clearing to zero is still working. In GPU/GLES/Framebuffer.cpp, there's this part: if (resized_) {
DestroyAllFBOs();
glstate.viewport.set(0, 0, PSP_CoreParameter().pixelWidth, PSP_CoreParameter().pixelHeight);
int zoom = g_Config.iInternalResolution;
if (zoom == 0) // auto mode
zoom = (PSP_CoreParameter().pixelWidth + 479) / 480;
PSP_CoreParameter().renderWidth = 480 * zoom;
PSP_CoreParameter().renderHeight = 272 * zoom;
resized_ = false;
} If you change it to: if (resized_) {
resized_ = false;
} Then it won't delete FBOs anymore. This should double check that recreating the FBOs is what's solving it. If it still works with this, then it might have more to do with the texture cache or something. -[Unknown] |
Still works after changing rendering mode. |
Tested with latest build. Same status. |
Tested with latest build. Same status. |
Tested again. Same issues. |
Tested with latest build. Same status. I think I can add good GE info this time: In a first place, the texture is good, but in next step prim, and I don't know why, it goes transparent when it shouldn't, comparing when the texture is applied in other cars. @unknownbrackets hope this would help in this strange issue ;). |
I think I need to see more tabs for the second screenshot - mainly the texture tab. Definitely interesting though - maybe somethign is wrong with the clut? If you go to the first screenshot, and click "Step Into" over and over (might be ~20 or so times total) what step is highlighted when the texture goes wrong? -[Unknown] |
@unknownbrackets here is the "Step Into" at the point the texture changes: The texture tab: |
Well, that was a clut load.... hm. Maybe the clut is being written too early/late. What happens if, when the "Clut load: 000001" line is highlighted, you right click on "TexFlush" below it and select "Jump to this address"? This will just skip the clut load entirely. Then hit "Step Frame" (you might have to hit it twice to see the scene, if you hit it more times it will go back to how it looked before since you only skip the clut load for that one frame.) If that makes it work, it could definitely be some sort of dcache issue or too-early issue. -[Unknown] |
If you pause, go to settings, don't change anything, and then resume the game, does it also make it draw the dirt? If so, it might just be pulling the texture or clut incorrectly from a framebuffer. Is this also fine in the software renderer? -[Unknown] |
@unknownbrackets it doesn't draw the dirt texture. Using software rendering all dirt textures are shown fine, even I notice there is two kind of dirt textures, low dirt during first lap and high dirt in second lap: So according to this, emulator are missing also low dirt texture even in wheels. |
Tested with latest build. Same status. |
Tested with latest build. Same issues. |
I think the latest information means that the dirt is being drawn by the CPU over a FBO texture. It might help to have a GE frame dump to confirm. -[Unknown] |
@unknownbrackets here is the GE Frame Dumps (first is with missing textures, second the same but after goes fullscreen): |
It seems like draw 1522/4013 uses texture 0x08bff920 to draw the dirt. It uses regular alpha blending and a It is using slope/bias but there are no mipmap levels so it shouldn't matter. I can imagine issues if lazy texture caching or vertex caching are enabled, but given that it's a RAM address, this shouldn't happen with those both off... It also clears depth at the start. So it's interesting that resizing the screen fixes it - that clears caches, and most notably the FBOs. -[Unknown] |
Tested with latest Windows build. Same status. |
This game has a other issue on Win10 of OpenGL. #13416 But,I find strange point happening on Win10(Vulkan) and Android(OpenGL). If you select these car then appear the dirt(Level2) on body suddenly at LAP2 automaticaly. I wonder... |
Yeah, this seems to be a case where the game first renders decals using the GPU so the car texture ends up in a framebuffer, then pokes dirt into it with CPU probably, and we never notice because we don't try to hash the memory behind framebuffers (and that's generally a waste, though not in this game)... |
During playing Sega Rally, I notice one effect is missing. Player's car is clean during all the circuit, so dirt impact effect is totally missing:
Real PSP
GE Debugger tabs:
The text was updated successfully, but these errors were encountered: