zaps166 / NFSIISE

Need For Speed™ II SE - Cross-platform wrapper with 3D acceleration and TCP protocol!
MIT License
553 stars 45 forks source link

3D Glasses Fix: Question about adding Direct3D support (3rash/Thrash API) #115

Open cyberluke opened 6 months ago

cyberluke commented 6 months ago

Hi, I am on Windows XP machine with Geforce 3 that has 3D glasses support. It works great using this 3rash patch that has both OpenGL and DirectX support: https://web.archive.org/web/20220131033002/https://verokster.blogspot.com/2019/11/need-for-speed-ii-second-edition-patch.html

But it does not fix Force Feedback, only your project seems to fix Force Feedback.

Would it be possible to use newer Thrash engine DLL same way Verokster patched NFS II game? I have a bit of software dev skills, I could try to do it myself if you point me to some direction.

The thing is that by using OpenGL 1 on Geforce 3 and enabling NVIDIA 3D in-game, it won't display stereo rendered camera, but only single camera. While Quake II using OpenGL works perfectly with stereo rendering. Perhaps it has something to do with Glide to OpenGL wrapper.

Sources: https://web.archive.org/web/20210929214910/https://github.com/Verokster/3rash-module https://archive.org/details/verokster

zaps166 commented 6 months ago

Does other games requires modifications to run with this?

cyberluke commented 6 months ago

Of course not, all other opengl and directx work out of the box. It is quite standard feature in rendering pipeline. For example using nvidia drivers, you have stereo options in driver options and it works on windows 98, windows xp and higher. First models were blinking left and right eye and monitor runs at 120hz rendering each eye for 60hz. Newer model of nvidia glasses is called nvidia vision and works also on LCD, not just CRT.

Pressing CTRL+T switches to stereo rendering in any 3d app. On Tue 19. 3. 2024 at 22:14, Błażej Szczygieł @.***> wrote:

Does other games requires modifications to run with this?

— Reply to this email directly, view it on GitHub https://github.com/zaps166/NFSIISE/issues/115#issuecomment-2008147198, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIPKT7TI66Q4AAYIJ26RSTYZCTDXAVCNFSM6AAAAABE6DFTYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBYGE2DOMJZHA . You are receiving this because you authored the thread.Message ID: @.***>

zaps166 commented 6 months ago

Ok, I see, but I never used it and I don't know how it's working. If it's stereo, the app has to display image with shifted view for the second eye, right? Strange that's only this app has a problem. Have you checked both: GL1 and GL2 executables?

sonik-br commented 6 months ago

@zaps166 The driver handles the stereo stuff. Internally it will render two "screens". I've used this before. But looks like the driver will only do it's magic on direct3d games and not opengl.

cyberluke commented 6 months ago

GL2 is a no go because Geforce 3 is only OpenGL 1.5 compliant.

Yes, it renders two screens, but Quake II is well known OpenGL game and it works there as well. So I suspect it must be something with Glide wrapper in NFS II. It does not support OpenGL directly.

Therefore I would like to combine Verokster DirectX DLL and Sonik FFB DLL somehow.

I would like to help, I did this (Youtube video: https://www.youtube.com/watch?v=pIR5bgpmE7E ):

So I have some experience, but the problem is I don't have Verokster Trash engine fix source. It was on Github, but was removed. I tried to contact him. Do you have any clues how we could add DirectX DLL to your repo? They are present in Verokster binary you can still download, we could just bind to it, right?

sonik-br commented 6 months ago

@cyberluke There's no "sonik ffb dll" XD I did some simple changes to how the games handles ffb but it its mostly zaps code. There's also Silent's Patch for NFSIISE and I believe it's open source. You can try to take a look into it.

Btw I believe that for 3d stereo to work the game must run at a stable 60fps. Did you force it via the config file?

zaps166 commented 6 months ago

the game must run at a stable 60fps.

This game is designed for fixed 64 FPS (IIRC), so if you run it on 60 Hz monitor with V-Sync it will still stutter a little. When I change it to 60 FPS, the entire game runs slower :sweat_smile: . Maybe for now best is to monitor with VRR which can go for 64 Hz :smile:

zaps166 commented 6 months ago

GL2 is a no go because Geforce 3 is only OpenGL 1.5 compliant.

Yes, right :smile:


I use basic functions like glBegin() / glEnd(), glOrtho(), glViewport(), glScissor(), glScalef() in OpenGL... Nothing special.

If you guys know how this is working and can test, maybe simple change in GL1 code could make it work?

cyberluke commented 6 months ago

Good point: https://github.com/CookiePLMonster/SilentPatchNFS90s --- I could take your FFB Zaps and implement it there and then use it with Verok's patch.

I don't know about 60fps thing, but Verokster DirectX patch works. The thing is you need CRT monitor with 120 Hz (and I think interlaced mode), so it will draw left eye with 60 Hz and right eye for 60 Hz. Even some older games have 30 Hz cap, it does not blink or stutter.

Me is more DirectX guy, I don't have any experience with OpenGL.

zaps166 commented 6 months ago

I did some simple changes to how the games handles ffb but it its mostly zaps code.

Your info about the non-working POLAR on Windows was very helpful!


I have PC with Nvidia and Windows 7, is it possible to check if it's working there or I need Windows XP and older GPUs?

sonik-br commented 5 months ago

I believe that you will need to use some very old nvidia driver. Nvidia removed the "stereoscopic" stuff from newer drivers.

Check if your driver have this menu (this is the best picture I could find of it)

image

I'm not sure if it's the same tech that cyberluk is using.

cyberluke commented 5 months ago

Yes, that is what I am using - Stereoscopic 3D. It works in Windows 98, Windows XP, Windows 7. Each driver menu looks different. For example in Windows XP, I think you have more options in the driver. Set up key shortcuts.

There are two versions of NVIDIA stereo 3d glasses: 1) ASUS 3D and similar - you connect them via 3.5mm jack to graphic card (geforce 2, geforce 3, geforce 4) 2) NVIDIA 3d vision - glasses made directly by nvidia - there are two models - older works on both CRT and LCD, newer works only on LCD.

Both use same driver. NVIDIA 3d vision is newer and should work in Win 7 and Win 10.

sonik-br commented 5 months ago

@cyberluke have you seen this? https://3dsurroundgaming.com/OGL3DVision.html

zaps166 commented 4 months ago

I noticed Nvidia 3d vision on 9600GT and Windows 10.

ThreeDeeJay commented 3 months ago

@cyberluke have you seen this? https://3dsurroundgaming.com/OGL3DVision.html

That does seem like the only way unless Direct3D is implemented, but I wasn't able to use that or even a couple old versions to trigger 3D

On a side note, any particular reason to use such an old hardware/software combo for 3D? There are viable modern alternatives I was indeed able to get stereoscopic 3D by using the modern patch configured with Direct3D then dgVoodoo to convert it to Direct3D 11, which can be stereoized using a 3D Vision driver + patch installed via 3D Fix Manager nvcplui_klev17OnJN Newer drivers/GPUs should work with 3D Vision if you use Direct3D + d3d8to9, though the 2080 Ti is the last GPU to support 3D in Direct3D 11 natively (with that patch on the top right), which is useful for other games where D3D9 output of geo-11 doesn't work.

nfs2se001 I'm getting stable 60FPS per eye (120hz shutter display+emitter+glasses) though I wonder if switching to 72FPS/eye (144hz) would be better for the 64FPS lock. 🤔