Duke4.net Forums: LameDuke in stereoscopic 3D: I've done it! - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

LameDuke in stereoscopic 3D: I've done it!

#1

First, a premise. This will only work with devices that can display stereoscopic images in the "top-and-bottom" mode, where the pictures for both eyes are displayed at the same time in the same picture, left eye on top and right eye on bottom, because it's a fix for the flawed top-and-bottom mode that already exists in LameDuke.

Now, it all you want to do is try it and don't care about how it's achieved, just go to
https://mega.nz/#!cb...jpIqwzY_4lzzpxw to download the package, unzip it into the root of your D:\ hard drive (because that's where the preexisting settings expect to find it), set your desktop to 720p (because that's the resolution the preexisting settings expect) and double click on the shortcut to play.
Instead, if you care about technical details, read on.

If you've ever run the SETUP.EXE in LameDuke, you'll know about the "120Hz Stereo vision (for Crystal Eyes)" mode. To use it as it was originally intended, you needed the CrystalEyes shutterglasses, which used to be a high-end product, and a CRT monitor that supported a refresh frequency of 120 Hz. The game would then display an interlaced image, with the left eye view in the even lines, a line blank, the right eye view in the odd lines, and another line blank.
With all probability, if you tried when LameDuke had just been released, or in one of the official DosBox releases, you'll have concluded that it didn't work at all, either because your monitor did not support that frequency if you ran the game in DOS, or because the official DosBox cannot display it correctly. However, I recently discovered a distribution of DosBox that displays the CrystalEyes mode correctly: DosBox SVN-Daum. Another thing this distribution can do is use OpenGL to render the game view as a texture which is applied on a vertical plane, which is what you see.

If you run LameDuke in CrystalEyes mode in DosBox SVN-Daum, this is what you'll see:
Posted Image
But if you try to view LameDuke in stereoscopy like this, you'll see that it doesn't work right yet. The total height of the image is 480, but the right eye view starts at a height of 256, not 240 like it's supposed to. Your brain won't be able to merge the two views into a 3D view, unless somehow the right view is shifted up to the correct height.

This is why the package contains a third component. Remember how DosBox SVN-Daum uses OpenGL? This means that programs like ReShade can interface with it. The third component is ReShade, with a shader used to correct a preexisting stereoscopic view. In the package, it's preset to work at a resolution of 720p; if you want to use another resolution you'll need to understand the meaning of its parameters and modify them so that the view is displayed correctly.
If you press Shift+F2 when the game is running, you'll see four pairs of numbers:

-40 140
40 -190
1 1.7
1 1.7

They mean:
- Shift the left eye (upper) image 40 pixels to the right and 140 pixels upward
- Shift the right eye (lower) image 40 pixels to the left and 190 pixels downward
- Multilpy the width of the left eye image by 1 and the height by 1.7
- Multiply the width of the right eye image by 1 and the height by 1.7

If you use a higher resolution, you'll need to modify the first four values, because the images will need to be shifted for a greater distance. Instead, the last ffour values are constant for every 16:9 resolution, because they are ratios.
5

User is offline   leilei 

#2

Does it have to be reshade +Daum? PCem v13+ has a native GL3 shader system where you can implement that as well.

(also I think CrystalEyes support was busted in development. You can enable it in the .cfg files of the later Build games but it won't have any walls/2d rendered. Maybe slopes regressed it)

This post has been edited by leilei: 02 February 2018 - 03:11 PM

0

#3

View Postleilei, on 02 February 2018 - 03:07 PM, said:

Does it have to be reshade +Daum? PCem v13+ has a native GL3 shader system where you can implement that as well.

I don't know, I never used PCEm. I happened to notice the CrystalEyes mode worked in that version of DosBox, and I'm used to use ReShade and the SuperDepth3D.fx shader for stereoscopy, so I asked in the forum whether a shader could move and resize parts of the image. The author of the shader told me to contact him via Discord, so I did, I explained what I wanted to obtain, and few hours later he sent me the shader.
I'm 100% sure that the package I uploaded on Mega will work. No idea if it will also work with PCem.

View Postleilei, on 02 February 2018 - 03:07 PM, said:

(also I think CrystalEyes support was busted in development. You can enable it in the .cfg files of the later Build games but it won't have any walls/2d rendered. Maybe slopes regressed it)

It's a shame if someone wants to play another (non-Duke) Build game in stereoscopy, but if you want to play Duke Nukem 3D in stereoscopy there's a much better option. It involves ReShade.

This post has been edited by Altered Reality: 02 February 2018 - 05:45 PM

0

User is offline   MrFlibble 

#4

View PostAltered Reality, on 02 February 2018 - 11:36 AM, said:

unzip it into the root of your D:\ hard drive (because that's where the preexisting settings expect to find it), set your desktop to 720p (because that's the resolution the preexisting settings expect) and double click on the shortcut to play.

I think you should be able to make settings independent of a specific directory by using .\ as the current dir. E.g.
.\reshade-shaders\Textures

instead of
d:\Lameduke3D\reshade-shaders\Textures

Same for the BAT file to launch DOSBox with the needed settings.
0

#5

View PostMrFlibble, on 03 February 2018 - 10:45 AM, said:

I think you should be able to make settings independent of a specific directory by using .\ as the current dir. E.g.
.\reshade-shaders\Textures

instead of
d:\Lameduke3D\reshade-shaders\Textures

Same for the BAT file to launch DOSBox with the needed settings.

All right, I did it. I had to make some changes anyway, because I found some files here to patch stereoscopy support into Magic Carpet 1 and Hi-Octane, so I created configurations for those games too, modified the initial commands so they won't automatically launch Lameduke, and added .bat files to launch each of those games with the necessary settings.

The link to download the updated version is
https://mega.nz/#!4P...n8TS6c70woaLqg0 . Unzip it anywhere, launch dosbox_x64.exe and type "lameduke" (without quotes).
The new 3DCFG folder contains configuration files for Lameduke, Magic Carpet and Hi-Octane, which, if you use the appropriate .bat file, are automatically copied into the root directory before launching the game. Note that I did not include Magic Carpet nor Hi-Octane, for copyright reasons.

This post has been edited by Altered Reality: 03 February 2018 - 02:00 PM

1

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options