rpcs3 icon indicating copy to clipboard operation
rpcs3 copied to clipboard

BLUS30767 texture clamping issues

Open Nerboruto opened this issue 8 years ago • 30 comments

look at the attached picture

rpcs3 2018-01-29 21-53-53

Nerboruto avatar Jan 31 '18 10:01 Nerboruto

even the shadows flash in that place...

Nerboruto avatar Jan 31 '18 10:01 Nerboruto

Just looks like texture border issues. Also, this report is lacking alot of information. What renderer is that? What settings? Does it happen on both opengl and vulkan? Does strict mode affect anything? etc

kd-11 avatar Jan 31 '18 14:01 kd-11

opengl & vulkan on nvidia... 1280x720 scaling 100%.. monitor resolution 1360x768 + reshade custom scanlines. reshade & strict mode is irrelevant. the shadows become darker and blink. tested on 2 different nvidia PCs only at that point in the game. around the branches of the tree there is a black outline that appears during the scrolling of the backdrop the problem tends to disappear and reappear and the shadows become more darker.

I would also have a suggestion for scaling resolution. approximate resolutions to 16 pixels multiple. es: 1280x720 @ 107% =1369x770 rounded at 1360x768.

Nerboruto avatar Jan 31 '18 14:01 Nerboruto

use gpu texture scaling is irrilevant. all options at default.

Nerboruto avatar Jan 31 '18 14:01 Nerboruto

it seems more a problem of how shadows are rendered over background texture. however I'm not sure.

Nerboruto avatar Jan 31 '18 14:01 Nerboruto

Both the shadow flickering and the misalignment issues are still present as of RPCS3 v0.0.7-8852-e9ea226e Alpha. I couldn't capture the shadow flicker, but the misalignment I did manage to; see the RRC file attached below. Captured on VK, replayed on GL, happens on both. Stock settings.

image

RRC file: BLUS30767_20191011014102_capture.zip

Guide to the area on the picture

The area can be accessed after about 5-10 minutes spent ingame. I also chose an Amazon character, as I wasn't sure how different the playthroughs are for each character archetype.

You have to do a quick tutorial that teaches you how to move around, fight, and interact with your environment. This takes about 5 minutes at worst.

Then you'll be in the city and forced to join a guild, but probably have yourself rejected for unkept armor, sent to repair it, and then will you be allowed to join. This takes about another minute.

After this, you're sent out to help a guild member, that's when you'll be able to access the area on the picture, called Gate. Once there, go a bit left, and there you are.

dio-gh avatar Oct 10 '19 23:10 dio-gh

@Nerboruto update.

digitaldude555 avatar Feb 21 '20 19:02 digitaldude555

the problem is here...

Nerboruto avatar Feb 21 '20 21:02 Nerboruto

Need a new RSX capture, the one attached here is incompatible with current rpcs3.

kd-11 avatar May 08 '20 17:05 kd-11

VID_20200508_230519.zip shadows flikering

Nerboruto avatar May 08 '20 21:05 Nerboruto

RenderDoc 1.7 captures on current build 10398 I got four frames with various characters flickering, and most of them have texture alignment issues in the background sprites

13xforever avatar May 16 '20 11:05 13xforever

This is not caused by shadows or anything like that its a combination of factors. Unfortunately modern hardware does not behave the same way as a GPU from 20 years ago and some of the techniques this game is relying on are not present on modern cards anymore. The borders are part of the artwork. You can see them in this pic (alpha channel isolated): image But that's not all, if you zoom in closer, you get a better idea of where the line truly comes from: image This is a compressed texture, so there is some 'bleeding' over the edges of alpha vs no alpha along with some banding due to low bit compression. So how does the game sample this texture? It uses the old-school coordinate clamp technique which no longer exists for over a decade (GL_CLAMP). From spec they just say "it clamps the coordinates to [0-1]" but I know that's not the whole story, it does some other fuckery too depending on the hardware. We can only enable this on old OGL v2 which has been obsolete since 2008. Rpcs3 has a workaround for this with GL_CLAMP_TO_EDGE, but its not the exact same behavior. Whether the alpha border texels are decoded differently on a G70 class GPU is unknown, but not entirely out of the question either. But from what I can see, rpcs3 is doing the best it can with what we have to work with.

kd-11 avatar May 17 '20 08:05 kd-11

Well, the transparent graphical errors of the paintings plus the cup in the menu in the RPCS3 game of Dragon's Crown continue to happen to me!

screenshot_20220215_100727

screenshot_20220215_101244

Bertue avatar Feb 15 '22 09:02 Bertue

Same, still not fixed.

dante3732 avatar Jun 08 '22 14:06 dante3732

I already get angry about this issue but still no case for these 2D games like Dragon's Crown or Odin Sphere to fix the problems they have even knowing that it says they are 100% playable without technical problems or graphic bugs and they continue the same with errors I don't know What are you waiting for to solve it once and for all for the good and entertainment of the users of the Rpcs3 emulator with how beautiful those games really are!

Bertue avatar Jun 08 '22 16:06 Bertue

Seems like a duplicate of #9150

Peduls avatar Jun 08 '22 18:06 Peduls

If I think that the solution would be to expand the bilinear texture for the first time for 2D games like these, well, the kd-11 knows more about it, let's see what will be done sooner or later, but it will be less, I suppose, to be able to eliminate these absurd bugs of the Rpcs3 emulator and everyone is happy.

Bertue avatar Jun 08 '22 19:06 Bertue

Being hostile and impatient towards the dev team won't help get this bug fixed any sooner. If anything it'll make them not want to help you. I am very eager for the issues in Dragon's Crown and Odin Sphere to be fixed as well, but I'm not a jerk about it.

Peduls avatar Jun 08 '22 20:06 Peduls

I made a mistake, I recognize that I shouldn't have rushed, I'm sorry, when it has to happen, let it happen, please.

Bertue avatar Jun 08 '22 21:06 Bertue

Well, I think it is very difficult to fix these graphic bugs and more of old 2D games like these in the RPCS3 emulator and I have already seen why they fail due to the problem of OpenGL version 2.3 for much older computers that do not incorporate it and Vulkan I think that it does not reach him until they release some version of VK something that I have not seen at least that even if this kind of complicated fastening textures will work to solve the graphical errors of these two games because it is not even known what solution it has for what The texture clamping error would no longer exist in both Dragon's Crown and Odin Sphere because we have to thank those of Rpcs3, which is much better than the Vita3k emulator, which already works with those two games too, and they are much worse because of how green they are. is that emulator still!

Bertue avatar Jun 09 '22 17:06 Bertue

Ogl bringup 4 #12284 I wish I could fix the few graphical glitches that both Dragon's Crown and Odin Sphere have, but I doubt it so soon yet.

Bertue avatar Jun 27 '22 17:06 Bertue

This should be fixed.

Screenshot 2023-05-26 at 16 25 52

shinra-electric avatar May 26 '23 14:05 shinra-electric

it's not fixed, and as kd explained before, the actual fix won't be easy or performant image

13xforever avatar May 26 '23 14:05 13xforever

Ah, ok. I didn't realise it was a specific area. I can reproduce.

Screenshot 2023-05-26 at 16 51 32

shinra-electric avatar May 26 '23 14:05 shinra-electric

Earlier this year I submitted some work that supports custom clamp algorithms (https://github.com/RPCS3/rpcs3/pull/14104) I think we can now tackle this one in software as we have a pipeline to do it. I need a save file though and instructions how exactly to reproduce it (basically eli5)

kd-11 avatar Dec 24 '23 13:12 kd-11

You can reproduce all the issues from the beginning, it doesn't take much time to go through character creation and get to the tavern.

After you load save, leave the tavern and go all the way to the right, then exit through the Gate, and that's it.

On the first actual dungeon (Ancient Temple Ruins / Boss: Harpy Lv 1) if you go most of the way to the boss, there's a section with drowned ruins and a couple of lizard enemies where you could reproduce disappearing sprites (if you go too far right, you start the boss fight). But I think this was fixed already.

dragon's crown save.zip

13xforever avatar Dec 24 '23 13:12 13xforever

I finally got some time to look into this. The game has a weird rendering setup and basically renders everything as tiles. The inputs are chunked and stitched together into texture atlases. This is fine, but introduces some 1px borders all over the place. The borders are actually invisible, and are caused by a blending setup error. The developer set up the blend equation as S.src_alpha + D.(1 - src_alpha) for both color and alpha which is almost never what you want. However, the output is typically never sampled so nothing bad happens. However, sometimes, to render special effects or menus, etc, the game can decide to duplicate a frame and resamples the previous frame. This is where everything falls apart, because now the alpha channel which is ignored normally is now relevant.

So, why doesn't this appear on PS3? Because they picked a special PS3 output format that erases the alpha channel. In rpcs3 this is implemented using a special mask when reading. However, the mask does not propagate properly when data is being copied around so we lose track of the "throw away the alpha" flag and we end up rendering the seams.

A fix is trivial, but unfortunately comes with a shader cache version bump. This also explains the weird issues observed in https://github.com/RPCS3/rpcs3/issues/9150

kd-11 avatar Jan 16 '24 22:01 kd-11

Hmm, I'll try and come up with a less intrusive stop-gap solution for now.

kd-11 avatar Jan 16 '24 23:01 kd-11

Is this related to the weird boxes that show up in shadow-y areas in the game?

peilong-du avatar Mar 30 '24 00:03 peilong-du