Quad-buffered 3D uses sequential frames

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
GFD
Posts: 347
Joined: Mon May 31, 2010 7:42 pm
Preferred Pronouns: He/Him
Location: Canada
Contact:

Quad-buffered 3D uses sequential frames

Post by GFD »

Since biospud fixed the last bug report I made about stereoscopic 3D support in GZDoom, it seems more worthwhile to me now to make some more topics for at least some of the more glaring issues with these features.

Every vr_mode setting except quad-buffered will render for both eyes simultaneously. However, using quad-buffered 3D does not do this, as it renders different frames for each eye. This can be extremely uncomfortable, especially in scenes with fast motions, as you will never see fast-moving objects in the same position with both eyes.

This is easily observed with something like the Heavy Assault Rifle in D4D. At 60 Hz, there are "gaps" between where the bullet is rendered as it moves, but at 120 Hz, it's rendered often enough that there are no more "gaps" anymore. When using quad-buffered 3D, setting vr_hunits_per_meter to 0 and vr_screendist to something high like 5000 (to remove all depth from the scene) shows there aren't any "gaps" with the bullet's rendering, even though these gaps should be visible as they are at 60 Hz, as GZDoom should be showing the same scene for two frames.

This problem also applies to 2D elements, like HUD elements and the mouse cursor. For example, fast-moving weapon sprites become impossible to focus your eyes on, as each eye always sees the sprite in a different location from the other.

[Realized right after posting this should be in OpenGL renderer bugs. Apologies for the inconvenience, admins.]
User avatar
biospud
Posts: 206
Joined: Mon Oct 14, 2013 2:19 pm
Location: California, USA
Contact:

Re: Quad-buffered 3D uses sequential frames

Post by biospud »

Wait are you saying that it looks OK at 120 Hz? I think quad buffered stereo only works at monitor refresh rates of 120 Hz. Don't use 60 Hz.
User avatar
GFD
Posts: 347
Joined: Mon May 31, 2010 7:42 pm
Preferred Pronouns: He/Him
Location: Canada
Contact:

Re: Quad-buffered 3D uses sequential frames

Post by GFD »

The monitor's refresh rate is 120 Hz; there are no problems there. The issue is that GZDoom is rendering 120 different scenes each second, instead of rendering 60 scenes 2 different times (once for each eye).

If necessary, I can try to make some images to better illustrate what the issue is exactly.
User avatar
biospud
Posts: 206
Joined: Mon Oct 14, 2013 2:19 pm
Location: California, USA
Contact:

Re: Quad-buffered 3D uses sequential frames

Post by biospud »

It seems to me impossible that the quad buffered stereo mode would behave differently from the other 3d modes in this way. Is it possible you are seeing sprites rotated 45 degrees occasionally, based on the slightly different position of each eye?
User avatar
GFD
Posts: 347
Joined: Mon May 31, 2010 7:42 pm
Preferred Pronouns: He/Him
Location: Canada
Contact:

Re: Quad-buffered 3D uses sequential frames

Post by GFD »

biospud wrote:Is it possible you are seeing sprites rotated 45 degrees occasionally, based on the slightly different position of each eye?
That is a separate issue from this. It's to be the next bug report I submit about stereoscopic 3D features.

I would have liked to show off the sequential frame rendering more clearly by video editing some footage of it in action. However, both Fraps and Shadowplay (the only things that seem capable of capturing 3D game footage) only make 2D captures of GZDoom when it's using quad-buffered 3D, for some reason. And I lack external capture hardware, either in a passthrough sort of device or a high-speed camera that I can point at my computer monitor. So, I'll have to make do with some crude illustrations.

Consider this no-art-skills scene of a green ball moving left to right across some stripes at 120 Hz. The scene has no depth, but is being rendered in 3D anyway. (Much as HUD elements are, which is where this is most easily noticed in action.) Here's how the scene appears in 2D:

Frame 1
Image
Frame 2
Image
Frame 3
Image
Frame 4
Image
Frame 5
Image
Frame 6
Image

With the other 3D modes in GZDoom, the scene is rendered in much the same way. Two views are rendered for the same frame and superimposed onto the canvas simultaneously, and both eyes view the canvas at the same time, so both eyes naturally perceive the same scene:

Frame 1
Image
Frame 2
Image
Frame 3
Image
Frame 4
Image
Frame 5
Image
Frame 6
Image

But quad-buffered stereoscopic 3D is inherently different due to the shutter glasses technology. Two views are not rendered for the same frame, two views are never superimposed onto one canvas, and both eyes view the canvas at different times. This is how GZDoom would currently render this scene:

Frame 1
Image
Frame 2
Image
Frame 3
Image
Frame 4
Image
Frame 5
Image
Frame 6
Image

Due to this, both eyes do not perceive the same scene. In action, this is extremely jarring, and frankly quite difficult to look at in scenes with fast motion. When you squash the frames together to create an effective 60 Hz scene, this becomes more obvious:

Frames 1 & 2
Image
Frames 3 & 4
Image
Frames 5 & 6
Image

This looks very different from what the 3D anaglyph 60 Hz equivalent would be:

Frame 1
Image
Frame 2
Image
Frame 3
Image

This is not proper practice for quad-buffered stereoscopy. With sequential frames, horizontal movement can be perceived at the wrong depth, and vertical movement becomes impossible to focus your eyes on properly.
This is what GZDoom should be doing:

Frame 1
Image
Frame 2
Image
Frame 3
Image
Frame 4
Image
Frame 5
Image
Frame 6
Image

Now, half of the frames are rendering an old version of the scene. But when the frames are squashed together, you can see both eyes now perceive the same scenes:

Frames 1 & 2
Image
Frames 3 & 4
Image
Frames 5 & 6
Image

I hope this has been helpful.
User avatar
biospud
Posts: 206
Joined: Mon Oct 14, 2013 2:19 pm
Location: California, USA
Contact:

Re: Quad-buffered 3D uses sequential frames

Post by biospud »

I believe that gzdoom is doing what you said it "should be doing" in your sixth series of panels. I suspect your discomfort arises from the mismatch between subsequent frames 2&3, or 4&5, etc. in that series.
User avatar
GFD
Posts: 347
Joined: Mon May 31, 2010 7:42 pm
Preferred Pronouns: He/Him
Location: Canada
Contact:

Re: Quad-buffered 3D uses sequential frames

Post by GFD »

That is not what's happening. I do not experience this kind of discomfort in any other 3D applications I've used thus far. Again, I can very easily tell that GZDoom is rendering sequential frames by doing something like this:
GFD wrote:This is easily observed with something like the Heavy Assault Rifle in D4D. At 60 Hz, there are "gaps" between where the bullet is rendered as it moves, but at 120 Hz, it's rendered often enough that there are no more "gaps" anymore. When using quad-buffered 3D, setting vr_hunits_per_meter to 0 and vr_screendist to something high like 5000 (to remove all depth from the scene) shows there aren't any "gaps" with the bullet's rendering, even though these gaps should be visible as they are at 60 Hz, as GZDoom should be showing the same scene for two frames.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Quad-buffered 3D uses sequential frames

Post by Graf Zahl »

Unless biospud has more to say I see no reason to keep this around any longer. None of the developers here has any interest in VR programming and I cannot even tell who of you two is correct.
User avatar
GFD
Posts: 347
Joined: Mon May 31, 2010 7:42 pm
Preferred Pronouns: He/Him
Location: Canada
Contact:

Re: Quad-buffered 3D uses sequential frames

Post by GFD »

I'd love to take another look and see if this is still an issue, but now I'm having a new problem, which is that GZDoom refuses to run my display at 120 Hz with quad-buffered stereo enabled. I have vid_refreshrate set to 120, but with vr_enable_quadbuffered set to true, it always sets my monitor to 144 Hz, and with vr_enable_quadbuffered set to false, it always just continues using whatever refresh rate the monitor was already set to. So, vid_refreshrate seems to always be ignored. As such, I can't get quad-buffered stereo to work at all right now.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Quad-buffered 3D uses sequential frames

Post by Graf Zahl »

That value will indeed be ignored because GZDoom no longer switches video modes.
Post Reply

Return to “Closed Bugs [GZDoom]”