Play- icon indicating copy to clipboard operation
Play- copied to clipboard

Observation testing BGDA

Open bigianb opened this issue 4 years ago • 4 comments

I noticed you enabled the delayed MSCAL code so gave Baldur's Gate a quick whizz. Looks pretty good with just a few graphical issues.

One interesting thing though is with the text in the menus at the start. As usual their baselines are somewhat off. Changing the resolution multiplier in the settings to 2 (or higher) fixes it - which is a bit weird at first glance. My somewhat wild guess is that this is due to the game running in interlaced mode ... and so the height is halved somewhere giving us jitter due to rounding. Running the frame-buffer at 2x avoids that. Looking at the frame dump - each letter is a sprite with the same y value (but different x value) but at a multiplier of 1 with OpenGL these are rendered on the screen at different y positions (different by a pixel) ... seems a bit random

bigianb avatar Aug 25 '20 19:08 bigianb

Hey there! :)

Can you show us a screen shot of what you're seeing? For me, this is what I see:

Vulkan (which should be near pixel perfect): image

OpenGL 1x: image

OpenGL doesn't have the half pixel offset to snap PS2's pixels on the pixel grid. From my experimentation, using the offset works fine on 1x but kinda break things in higher multipliers.

jpd002 avatar Aug 26 '20 12:08 jpd002

Dell XPS 15 - Nvidia 750M

1x, actual size. note baseline of text wrong and also border of the button is rotated as if the v tex coord on the right hand side is one pixel higher than the left. (maybe it's the y coord of the sprite ... difficult to tell) image

2x,actual size. Now it looks ok. image

4x, also fine image

I can't test on Vulcan as neither of my machines have the shader interlock - neither the 750M or the 640GT in my desktop.

Ian

bigianb avatar Aug 26 '20 13:08 bigianb

Thanks, tried on my desktop nVIDIA GPU and I'm getting the same result as you. My first screen shots were on Intel GPU.

I'm wondering if adding a half pixel offset here would help for the 1x case: https://github.com/jpd002/Play-/blob/master/Source/gs/GSH_OpenGL/GSH_OpenGL_Shader.cpp#L121

As reference, this is how it's done on Vulkan: https://github.com/jpd002/Play-/blob/master/Source/gs/GSH_Vulkan/GSH_VulkanDraw.cpp#L705.

jpd002 avatar Aug 26 '20 19:08 jpd002

I looked again at the snowblind engine code which deals with the display buffers. I think there is a rounding error issue when the back-buffer is downscaled to the display buffer ... and using 2x internal resolution effectively disables that scaling so the error goes away. I think we probably see it in these games because the back buffer to frame buffer transfer is done using a grid of 64x64 sprites rather than in one big sprite transfer.

I wrote up some notes on the wiki below for interest and reference.

https://github.com/bigianb/bgda-explorer/wiki/Display-process

I've been thinking / musing about what the best patch would be best to avoid the bobbing also in that wiki page.

bigianb avatar Sep 03 '20 22:09 bigianb