cschied / q2vkpt

Real-time path tracer VKPT integrated into q2pro Quake 2 client.
http://brechpunkt.de/q2vkpt
GNU General Public License v2.0
946 stars 76 forks source link

Make it possible to run on Pascal gpu. Lags are okay. #11

Open vorob1 opened 5 years ago

vorob1 commented 5 years ago

subj

Siphonay commented 5 years ago

The Vulkan extension used to create the rendering for the game is only compatible with the specific hardware of the Turing GPUs. Unless the project is written entirely, compatibility with the previous line of GPUs infeasible.

You may want to check out q2pt which doesn't require Turing GPUs: http://amietia.com/q2pt.html

v00d00m4n commented 5 years ago

How about combining both?

cschied commented 5 years ago

vk_nv_raytracing is available on some pascal cards on linux. We successfully tested it on a 1080 and TitanXp. Unfortunately on Windows the extension is not available for Pascal-based GPUs.

AeonMW2 commented 5 years ago

vk_nv_raytracing is available on some pascal cards on linux. We successfully tested it on a 1080 and TitanXp. Unfortunately on Windows the extension is not available for Pascal-based GPUs.

what about perfomance on a 1080ti?

BrianMwit commented 5 years ago

I ran it on GTX 1070 (mobile) at ~1080p. It hovers around 10-15fps most of the time. https://www.youtube.com/watch?v=EPMO_c6Kirw Can't say for other cards.

vorob1 commented 5 years ago

Awesome news. Can you give step by step guide how you did it? Linux? Can you upload compiled quake 2 with demo pk2? What is? Driver version? Thx

BrianMwit commented 5 years ago

I ran it on Ubuntu 18.10 with nvidia-driver-415.

I kinda refered to the guide from https://linuxgamecast.com/2019/01/a-software-thing-quake-2-real-time-path-tracing/. For dependencies:

wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-1.1.97-bionic.list http://packages.lunarg.com/vulkan/1.1.97/lunarg-vulkan-1.1.97-bionic.list
sudo add-apt-repository ppa:graphics-drivers/ppa

sudo apt install glslang-dev libvulkan1 libvulkan-dev libc6-dev libx11-dev libpng-dev libjpeg8-dev zlib1g-dev mesa-common-dev liblircclient-dev libcurl4-gnutls-dev make gcc g++ mesa-common-dev libglu1-mesa-dev libxxf86dga-dev libxxf86vm-dev libasound2-dev libx11-dev libxcb1-dev git libsdl2-dev libopenal-dev glslang-tools glslang-tools-dbgsym shaderc libsdl1.2-dev nvidia-driver-415 lunarg-vulkan-sdk -y

I don't know if all of these are actually needed.

After that, building is just git clone, make, then make strip. (According to the INSTALL file).

The next step is where the INSTALL file is a little out of date. I haven't tried reproducing this from scratch so I might miss some files that also need to be copied over.

mkdir -p ~/.q2pro/baseq2         # I will guess that any other folder would also work just as fine.
cd q2vkpt                        # The base directory of wherever you cloned this repo
cp -a src/client/ui/q2pro.menu ~/.q2pro/baseq2/
cp -a game*.so ~/.q2pro/baseq2/
cp -a q2vkpt ~/.q2pro/           # The name of the executable changed from INSTALL

Then also copy blue_noise_textures and shader_vkpt folder over as well. (Look at the directory structure of the Windows build)

It should work now with lower res textures. I then copied z6_32bitclr_png_allmaps.pak from the Windows release over.

When I tried the demo from https://ftp.gwdg.de/pub/misc/ftp.idsoftware.com/idstuff/quake2/ somehow I can't start a new game from the single player menu. Loading "demo" map from multiplayer menu works fine tho. I'll admit never played Quake 2 before...

ghost commented 5 years ago

What's the point? The performance is terrible. And always will be terrible.

I don't know to what extend Nvidia, and most importantly AMD, and Intel are going to push with RT cores on their own hardware. I think that it depends on how many smaller things you could do with few RT cores. If you can do at least the primary rays, and just fill-in rasterizing, and do audio, or audio only. Then you will see with next gen that even lower end 50s and 30s cards will have RT cores. And of course, that would make even my 1080ti and its 1.21 GRays (if I recall) look useless. The RTX 2060 got 5GRays.

The 5GRays are on RT though. While the 1080ti use it's CUDA cores. So, not much left to do other things for game graphics with that 1.21GRays in use it seems. An RTX 2150 with say the same 1.21 Grays, still would be a bit faster (and cheaper), than the very high end and expensive 1080ti that you also my not be able to buy anymore either these days anyways.

Giving RT cores for everybody could make ray tracing a foundation for every game engine big and small, without having to switch too much code inside the engine to do rasterizing or ray tracing. Primary rays are good for culling. This is one use scenario aside of actual rendering that every game does require and RT could deliver for everybody. So, I hope there is going to be RTX 2150s with at least 1.21Grays in the near future. :)

Dreadmoth commented 5 years ago

With GeForce driver version 425.31, Q2VKPT can run on Windows with a GTX 1060 6GB or higher GPU.

On Windows 7, I get ~32FPS at 1280x720 on my 1070 Ti. ~14 FPS at 1920x1080.

vorob1 commented 5 years ago

Ye that was the first thing I’ve tried in new driver ;)