Emulator Issues #2098
sh shattered memories flashlight Scaling Issue
What steps will reproduce the problem?
1. run silent hill shattered memories in last dolphin revs
2. use lighter and see blak lines
What is the expected output? What do you see instead?
I see black lines when lighter is on.
What version of the product are you using? On what operating system?
rev 4915. core2duo 2,6, 2giga ram, geforce 9600, windows xp, opengl, memory
to texture, with safe texture cache, native resolution.
Please provide any additional information below.
#3 Updated by Sylvio.Kurze over 10 years ago
Tha native mode workes for me with the whitezero build
but not any resolution above(as soon swith native off the flashlight gets ugly
stripes or glitches at the side. )
(whitezeros build is still the best that worked for me) (nvidia gtx 260 win7 64bit)
#7 Updated by gabrielmorano over 9 years ago
here is a picture that shows the problem
this picture was taken with d3d11 (and NO pluggin combination solves it, nor XFB or anything)
The problem is only with flashlight lighting, and it's worst on d3d11, as you can't light pretty much anything (if you try to light something up close all you will see is those black shadows, and using the flash light on far objects you can see things as in the picture)
on d3d9 and OpgenGL light works fine on close, but you will see black shadow bars if you light something further than 2 steps...
there is no way or posible combination that solves it on this pluggins either
this issue was an always bug on every single revision of dolphin, so there is none that broke it... as it was never fixed
the only fix there is is for "whitezeros" r4664 (but it was not a regular revision, as it was a release altered by him to work with this game.)
so issue remains the same up to r6798
#8 Updated by gabrielmorano over 9 years ago
Here is a picture of how things look on D3D9 and OpenGL (same place as d3d11 for you to compare)
#11 Updated by gabrielmorano over 9 years ago
Questionable? There are pictures showing the problem :s what's the questionable part of it? Oo (sorry, i don't get it)
anyway, problem remains on r6892
Also, i don0t think it's a dup from issue 3965 as in that report it says all the textures are wrong, and for it's all perfect except for the flashlight wich creates those weird shadows
#12 Updated by gabrielmorano over 9 years ago
here, i made a video
as you can see on this video with d3d (does not matter if it's 11 or 9) the flashlight creates black shadows that are incredibly wrong, and there is no option to active or deactivate that fixes it
and the same here but with OpenGL: (if you do not watch it on full screen you will not notice it)
this one is a little trickie, if you pay attention the shadows that appears are messed up (but not as much as in d3d) but then if you get close enough to a wall then the flashlight does not do those black bars (but you gotta be practically stick to the wall doing the spider-man fanservise)
this was fixed in a non oficial revesion by whitezero build
it just was never implemented on the regular revisions
http://www.megaupload.com/?d=F8OG83V1 (don't remember if d3d worked on this one, but i did finished the game in OpenGL at that time and the flashlight worked
i will upload a video latter.
#17 Updated by Autoran1 almost 8 years ago
Found the problem, r4812 r532ab905c452b changes in PixelShaderGen.cpp caused the problem, partially reverted them and here's the result
revision 776 modiffied
DX9/11 look pretty much the same, some strange thing in the caenter of flashlight light, don't know what this shit is, but no more lines
DX11, 2,5x scale, Efb Scaled Copy is off to avoid known scaling problems, EFB to Ram and to Texture look pretty much the same
OGL doesn't have this strange thing in the center, looks perfect, but unlikely DX apis, to avoid scaling issues, except Efb Scaled Copy is off also requires native internal resolution
I also think the issue 4592 should be merged here as well, also i noticed that these changes from patch are positively affect Simpsons The Game issue 4570, not completely, but slightly removes the corrupted graphics, will post the comparison screens later
And here's the patch
#18 Updated by Autoran1 almost 8 years ago
I've made mistake in my report about DX9 status, i've mistaken it with DX9 from my texcache-rewrite build, which is look exactly the same way as DX11 in normal build.
The truth is that in normal DX9 always rendered FlashLight correctly except black lines, but DX9 render was broken and caused crashes/hangs after the cutscene with questionnaire in r5394 r8eb21d1bac06 by changes in TextureCache.cpp file wich were replaced into VideoCommon lately in r6288, anyway here's the screen of DX9 and updated patch.
#20 Updated by Autoran1 over 7 years ago
#21 Updated by NeoBrainX over 7 years ago
- Status changed from Questionable to Work started
- Category set to gfx
Heh, thanks a lot for checking. While I expected the patch to be mostly correct, I wasn't sure if it would conflict with other places in the source code.
I'll still have to review some other parts in the shader gen and make sure nothing will break from this, unfortunately. But at least we now know what's the proper fix ;)
#25 Updated by NeoBrainX over 7 years ago
Yeah, our emulation has some serious flaws which have been worked around with dumb hacks, so I can't commit the patch in this state. I've fixed lots of those hacks locally, but it'll take me a little longer to fix it completely without introducing tons of regressions. Not sure if I'll be able to work on this any longer at all, though.
#27 Updated by NeoBrainX over 7 years ago
I found out something nice about Tev, which makes fixing the issue a lot easier.
Could you test if this issue is fixed in the tev_fixes branch?
Builds available here:
http://dl.dolphin-emu.org/builds/dolphin-tev_fixes-3.5-197-x86.7z (32 bit)
http://dl.dolphin-emu.org/builds/dolphin-tev_fixes-3.5-197-x64.7z (64 bit)
Also, would be cool if you tested other games with that branch and checked those for regressions.
#29 Updated by NeoBrainX over 7 years ago
#30 Updated by Autoran1 over 7 years ago
And here's the regression
this one goes for DX11 and DX9 OGL does fine
and these screens goes for DX9 only
will test more...
#34 Updated by Autoran1 over 7 years ago
#37 Updated by Autoran1 over 7 years ago
Now r03c3a33a71ee every thing broken like i showed here http://code.google.com/p/dolphin-emu/issues/detail?id=2098#c36 and water on DX9 pink again issue 3313 is back
and the last r22417fefea0f commit refixes issue 5394 only for DX9 everything else remain broken
Other games seems untouched...
Anyway great changes if everything goes right 3 issues will be closed or maybe more, keep it up)
#40 Updated by NeoBrainX over 7 years ago
Just pushed some new changes. Unfortunately the issue still isn't fixed though..
Anyway, could you check if there's any visual difference in D3D for SH or if the issues in ZWW and ZTP have changed?
#41 Updated by Autoran1 over 7 years ago
Let's see rev 201
SH is the same
on dx9 in ZWW and ZTP all objects that were missing are still missing
issue 5394 is fixed for both DX9 and DX11
issue 3313 is fixed
but new issue is here for both DX9 and DX11 in ZWW
#42 Updated by Autoran1 over 7 years ago
Strange, but this patch stuff.diff doesn't work for me at all in Silent Hill, and Simpsons The Game, even on older and clean builds worked with them before maybe i didn't cleared Shader Cahce before, and this patch actually never worked
Yet my solution, the one i've poke from the old SVN still works
#46 Updated by NeoBrainX over 7 years ago
Instead of reverting the last part of that revision, can you try changing code.google.com/p/dolphin-emu/source/browse/Source/Core/VideoCommon/Src/PixelShaderManager.cpp#114 to SetPSConstant4f(C_ALPHA, (lastAlpha&0xfc)/255.0f, ((lastAlpha>>8)&0xfc)/255.0f, 0, ((lastAlpha>>16)&0xff)k/255.0f);
(i.e. replace the first two 0xff with 0xfc)
#48 Updated by NeoBrainX over 7 years ago
Sorry, I'm stupid.
(lastAlpha&0xfc)/255.0f, ((lastAlpha>>8)&0xfc)/255.0f should've actually been ((lastAlpha&0xfc)|((lastAlpha&0xc0)>>6))/255.0f, (((lastAlpha>>8)&0xfc)|(((lastAlpha>>8)&0xc0)>>6))/255.0f
I hope I didn't mess up the brackets, but that should work. Hopefully anyway, but as I know my luck it's the perfectly correct thing to do without actually fixing anything, though :P
#50 Updated by NeoBrainX over 7 years ago
Can you check if revision a82d41be9ecf makes the bombs and missing objects look fine again in wind waker, too?
If not, can you provide a fifo log for that one? (or point me to it if you already posted it, kinda getting lost with all the logs on these tev issues :p)
#58 Updated by udkaso about 7 years ago
It should be this build/revision! http://dl.dolphin-emu.org/builds/dolphin-tev_fixes-3.5-543-x64.7z
The fix will only work if open gl is enabled as far as I found out!But in my opinion the lightning problem is more unsightly than the line issue!
#59 Updated by Line.Exon about 7 years ago
Holy shit !!! This build
fixes (almost) Silent Hill black shadow lines !))) FINALLY ! But looks like no one noticed this :(
I'am using D3D9 plugin (dint like DX11 and OpenGl plugins due to their crappy 2d filtering). I used savegame to bypass crash in the beginning (ankete talking) and this tev-fixed version gives almost clean picture ! Just small lighting dots but it is almost invisible. So please - merge this fixes into master !
By the way - I can give a hint on this lighting problems (I am graphic engineer).
Current emulation of Silent Hill SM have light source bug - lighting source of flashlight have a bit wrong place. It is should be at the end of the flashlight mesh model (original Wii console draws it that way), but dolphin puts it in the middle of flashlight body. That's why DX11 gives shadow of Harrys hand on the wall and that's why half of his face lighten up. Other problem is - incorrect light calculation if using antialiasing or non-native resolution. With non-native resolution game looks much better, but lighting area from the flashlight a bit spikey and trying to light up wrong areas. I don't know how or why, but lighting operations didn't upscale correctly. Hope somebody here will hear me.
#62 Updated by Line.Exon about 7 years ago
Hi NeoBrain !
I can test SilentHill SM anytime you need. I'm trying to play this game about 2 years and will be happy when Dolphin finally could handle it without problems.
And I thing it is possible to fix upscaling lighting bug, because old Dolphin svns was fine with upscaling (but with EFB-to-texture mode, not EFB to RAM).
And that annoying black lines - maybe something wrong it texture cache or mipmapping support ?
#68 Updated by Line.Exon about 7 years ago
Hi Neo !
Latest fixes in Dolphin has bring a lot of positive changes and speedups, also correct framerate and framebuffer effects in many games. But Silent Hill still gives those wierd lines in the far plane in master branch builds. Can you describe where I can download and test latest Dolphin build with TEV-fixes ?
#71 Updated by NeoBrainX about 7 years ago
Please use git hashes instead of "rev. 1222". For one, 1222 is even more useless than 3.5-1222 because you aren't saying what base version you're referring to (you could also mean 3.0-1222, for instance). Also, 3.5-1222 is ambigious; since we use multiple branches, each of them might have a 3.5-1222 build.
tl;dr: Please specify the git hashes of these builds, I don't have any idea what you're talking about otherwise.
#75 Updated by Line.Exon almost 7 years ago
TEV-fixes-3 1717 version renders Silent Hill Shattered Memories correctly with DX9 plugin ! :) No problems or artifacts )))) But with native IR only, and without any form of anti-aliasing.
DX11 plugin still shows hand shadow on entire screen, and OpenGl plugin shows shattered shadow bug, just like DX9 plugin shows with AA enabled.
Also I tried to use FXAA in this game and it doesn't work.
#77 Updated by NeoBrainX over 6 years ago
@ Autoran: are you sure about Simpsons? The fifo log on my hdd shows complete breakage on both tev_fixes_new and the sw renderer (at least they're consistent now). Specifically talking about issue 4570 here. Maybe the dff is broken, can you try the one Billiard posted in the issue thread?
The fix for issue 540 is still WIP, I know that it still has some work left to do :)
#79 Updated by NeoBrainX over 6 years ago
There are issues where? When running the game itself or when running the dff? Anyway, does it look anything like the pictures on the right at https://fifoci.dolphin-emu.org/simpsons-tev/tev_fixes_new-4.0-66/ ?
#82 Updated by Autoran1 over 6 years ago
That dff in issue 4570 is a way too old, it defenetely was taken from tev fixes 3 cause the comparison screens you gave me, i have this satate on tev_fixes 3
BTW i've noticed your branch has DX9 removed so maybe this is the reason i can't test DX11 it produces only blackscreen
#84 Updated by Autoran1 over 6 years ago
I've noticed that tree structure of tev_fixes new looks different and built it
Lightning now looks perfect this issue is fixed
issue 4570 is fixed
issue 6442 is fixed
issue 540 is fixed my god, never thought i see the day
the bubbles look perfect, but it seems the white shit on screen is Mario
But ZTP looks strange like i see only a 1/4 or 1/8 of 3d graphics
and SMS Mario is Missing
#88 Updated by NeoBrainX over 6 years ago
I know about d3d11, it'll need fixing.. Do you have panic handlers disabled? It should at least throw you an error message about shader compile failures.. (I know what's wrong so I don't need any further info, but just saying :p)
I'll look into the SMS issue. The new branch is still pretty much WIP :)
#97 Updated by Autoran1 over 6 years ago
#101 Updated by Line.Exon almost 6 years ago
I've tested and completed Silent Hill SM with latest revision.
summary - works pretty good only in OGL backend. D3D (DX11) always shows that ugly hand shadow on entire screen...
But - I've noticed an interesting thing - game runs faster and better (fullspeed) with pixel lighting enabled (!) and EFB2Ram cache disabled... Only raw EFB2Ram mode without any speedhacks. So it means that without pixel lighting enhancement and efb2ramcache - it works slower (0_0)
And there is still that "shadow upscale bug" if you use anything other than native resolution... And it is the only thing that keeps this game being perfectly emulated... Is there any way to fix upscaling ? Even with 2x upscale this game looks awesome !
#102 Updated by JMC4789 over 5 years ago
- Status changed from Work started to Fixed
This issue is fixed. The shadow glitch with D3D is unrelated to the flashlight scaling. There are other issues that deal with that problem already on the tracker, so I'm closing this issue for good.
If you want to report the hand blocking the light, you can, but I'm planning on rolling those into a single issue when I can.