Skip to content

Commit

Permalink
Merge branch 'vulkan' into texture-storage
Browse files Browse the repository at this point in the history
  • Loading branch information
w23 authored Oct 31, 2023
2 parents 737d132 + 6f40ada commit a9df5cd
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 45 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![GitHub Actions Status](https://github.com/w23/xash3d-fwgs/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/w23/xash3d-fwgs/actions/workflows/c-cpp.yml)

## TL;DR
- ![image](https://github.com/w23/xash3d-fwgs/assets/321361/12200b56-df80-4d33-b433-71f5690fb4f5)
- This fork adds Vulkan renderer to Xash3D-FWGS engine.
- This is work-in-progress. It is in early stages and is not ready for unsupervised usage.
- Vulkan renderer targets two different modes:
Expand All @@ -13,19 +14,20 @@
- [Page on Mod DB](https://www.moddb.com/mods/half-life-rtx) (screenshots, etc).

## Current status
- See Issues and [ref/vk/TODO.md](ref/vk/TODO.md)
- Traditional rasterizer works with some issues.
- See [issues](https://github.com/w23/xash3d-fwgs/issues) and [project](https://github.com/users/w23/projects/2/views/12)
- Traditional rasterizer mostly works:
- Works on Windows and Linux with any Vulkan GPU (and at some point it worked on Raspberry Pi 4 even).
- It is slower than OpenGL renderer (1. I suck at Vulkan. 2. No visibility culling is performed).
- Some features are not implemented yet.
- Some features are not implemented yet, like decals, dynamic lighting is different and way off, etc.
- Ray tracer mostly works too, with dynamic GI and stuff.
- It also requires material remaster (i.e. newer textures for PBR parameters) and missing RAD files for most of the game maps.
- Works under both Windows and Linux.
- Works on both AMD and Nvidia GPUs.
- Works on Steam Deck with _interactive framerates_.
- If you feel adventurous, you can follow [build instructions](https://github.com/w23/xash3d-fwgs/wiki/64-bit-build-on-Windows). Note that they might be slightly out of date, kek.

## Follow development
This project is 99.999% developed live on stream. I'm not a graphics programmer, and have no idea what I'm doing. I'm essentially learning Vulkan, game engine renderer development, linear algebra, and ray tracing techniques while getting hands dirty with this. This is all for your amusement.
This project is 99% developed live on stream. I'm not a graphics programmer, and have no idea what I'm doing. I'm essentially learning Vulkan, game engine renderer development, linear algebra, and ray tracing techniques while getting hands dirty with this. This is all for your amusement.

You can watch me making a fool of myself publicly here:
- [Archive playlist on YouTube/floba23](https://www.youtube.com/playlist?list=PLP0z1CQXyu5CrDa522FklxbOC0SM_Manl)
Expand Down
12 changes: 11 additions & 1 deletion ref/vk/data/valve/luchiki/maps/c1a0a.patch
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,14 @@
}
{
"_xvk_smoothing_group" "2394 2392 2390 2388 2389 2391 2393 2395" // 2383 2384 2387
}
}

{
"_xvk_smoothing_excluded_pairs" "1322 1324 1308" // FIXME
}
//{
//"_xvk_smoothing_excluded_pairs" "1321 1322" // TODO: only this
//}
//{
//"_xvk_smoothing_excluded_pairs" "1200 1220 1221 1199 1207 1217" // TODO: need investigate
//}
21 changes: 21 additions & 0 deletions ref/vk/data/valve/luchiki/maps/c1a0b.patch
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,25 @@
{
"_xvk_surface_id" "3558 3540 3546 3552" // +0~DRKMTLS2 80 60 30 1000
"_light" "80 60 30 80000"
}


// smoothing
{
//"_xvk_smoothing_threshold" "0"
}
{
"_xvk_smoothing_group" "2044 2044 2041 753 2045 757 2053 763 765" //756 // TODO: fix bad geometry
}
{
//"_xvk_smoothing_group" "754 758 764 766"
}
{
"_xvk_smoothing_group" "668 765 762" // 763 (bad) // TODO: fix bad geometry
}
{
"_xvk_smoothing_group" "2029 2028 2052 768 760 761 663"
}
{
"_xvk_smoothing_excluded_pairs" "883 884 886 887 903 1156" // FIXME: bad autosmooth
}
23 changes: 23 additions & 0 deletions ref/vk/data/valve/luchiki/maps/c1a0c.patch
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,26 @@
{
"_xvk_ent_id" "162" // remove hack lights entity
}



// smoothing
{
//"_xvk_smoothing_threshold" "44" // FIXME, 44 workaround // bad autosmooth (for metallic room wall)
}
{
//"_xvk_smoothing_excluded_pairs" "189 188 183 182 184"
}
{
//"_xvk_smoothing_group"
//"_xvk_smoothing_excluded_pairs" "182 183 184 97 74 187 188 2714 76 185" // FIXME
}
{
"_xvk_smoothing_excluded_pairs" "1067 1042" // FIXME: bad autosmooth
}
{
//"_xvk_smoothing_excluded_pairs" "747 748 750 751" // FIXME: bad autosmooth
}
{
"_xvk_smoothing_excluded_pairs" "747 748" // FIXME: bad autosmooth
}
21 changes: 19 additions & 2 deletions ref/vk/data/valve/luchiki/maps/c1a1b.patch
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@
}

{
_xvk_ent_id "321 322 323 324"
_xvk_smooth_entire_model "1"
_xvk_ent_id "329 321 322 323 324"
_xvk_smooth_entire_model "1"
}
//{ // FOR TESTING
//"_xvk_smoothing_group" "5577 5575 5579 5581 5576 5586 5583 5585 5584 5582 5580 5578 " // 5569 5572 5571 5570 5573 + //5567 5565 5568 5566
//}


{
//"_xvk_smoothing_excluded_pairs" "2790 2791 2792 2793 3187 2850 2874 2871 2872 2853 2900 2901 3182 3181" // wall // TODO: bad autosmooth
}
{
//"_xvk_smoothing_excluded_pairs" "2792 2790 2793 2791 2871 2850 2872 3187" // wall // TODO: bad autosmooth
}
{
//"_xvk_smoothing_excluded_pairs" "2788 2786 2787 3191 2786 2787 2870 2849 2868" // wall // TODO: bad autosmooth
}
{
//"_xvk_smoothing_threshold" "44" //workaround
}
10 changes: 10 additions & 0 deletions ref/vk/data/valve/luchiki/maps/c1a1f.patch
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,14 @@
{
"_xvk_surface_id" "766 765 772 773 777 776 768 769"
"_xvk_material" "generic_metal1" // TODO: texture -> material
}

{
"_xvk_smoothing_group" "3176 3175 3195" // wall // TODO: fix bad geometry
}
{
"_xvk_smoothing_excluded_pairs" "3060 3062" // wall // TODO: bad autosmooth
}
{
"_xvk_smoothing_excluded_pairs" "3061 3063 3065" // wall // TODO: bad autosmooth
}
13 changes: 4 additions & 9 deletions ref/vk/data/valve/maps/c1a0.rad
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,16 @@
~LIGHT3C 198 215 74 14000
~SPOTYELLOW 189 231 253 20000
~SPOTBLUE 7 163 245 18000
//LAB1_COMP3D 255 255 255 20
LAB1_COMP3D 255 255 255 0 // TODO: emissive texture
//~LAB1_COMP7 255 255 255 20
~LAB1_COMP7 255 255 255 0 // TODO: emissive texture
//LAB1_COMP3D 255 255 255 20 // TODO: emissive texture
//~LAB1_COMP7 255 255 255 20 // TODO: emissive texture

CRYS_2TOP 171 254 168 14000

DRKMTL_SCRN3 1 111 220 200

//+0~LAB1_CMP2 255 255 255 20
//+0~LAB1_CMP2 255 255 255 20 // TODO: emissive texture
//+1~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet
//+2~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet
+0~LAB1_CMP2 255 255 255 0 // TODO: emissive texture
+1~LAB1_CMP2 255 255 255 0 // hack, because no inheritance yet
+2~LAB1_CMP2 255 255 255 0 // hack, because no inheritance yet

+0~LAB_CRT8 50 50 255 200
+1~LAB_CRT8 50 50 255 200 // hack, because no inheritance yet
Expand All @@ -36,7 +31,7 @@ DRKMTL_SCRN3 1 111 220 200
+1DRKMTL_SCRN 60 80 255 200
+2DRKMTL_SCRN 60 80 255 200

FIFTIES_MON1B 100 100 180 0
//FIFTIES_MON1B 100 100 180 30

~LAB_CRT9A 225 150 150 100
~LAB_CRT9B 100 100 255 100
Expand Down
4 changes: 3 additions & 1 deletion ref/vk/data/valve/maps/c1a0b.rad
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
+0~GENERIC86B 60 220 170 10000
+0~LAB1_CMP2 255 255 255 20
//+0~LAB1_CMP2 255 255 255 20 // TODO: emissive texture
//+1~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet
//+2~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet
~LIGHT3C 220 210 150 2500
+A~FIFTIES_LGT2 160 170 220 4000
+0~FIFTIES_LGT2 160 170 220 10000
Expand Down
10 changes: 3 additions & 7 deletions ref/vk/data/valve/maps/c1a0d.rad
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,11 @@ LITEPANEL1 190 170 120 2500
~LIGHT3F 200 190 140 2500
+0~GENERIC85 110 160 220 25500 // 11000 16000 22000
~SPOTBLUE 7 163 245 18000
//+0~LAB1_CMP2 255 255 255 20
//+0~LAB1_CMP2 255 255 255 20 // TODO: emissive texture
//+1~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet
//+2~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet
+0~LAB1_CMP2 255 255 255 0 // TODO: emissive texture
+1~LAB1_CMP2 255 255 255 0 // hack, because no inheritance yet
+2~LAB1_CMP2 255 255 255 0 // hack, because no inheritance yet
//LAB1_COMP3D 255 255 255 20
LAB1_COMP3D 255 255 255 0 // TODO: emissive texture
~LAB1_COMP7 255 255 255 20
//LAB1_COMP3D 255 255 255 20 // TODO: emissive texture
//~LAB1_COMP7 255 255 255 20 // TODO: emissive texture
+0~FIFTS_LGHT5 255 255 255 10000

GENERIC105 255 100 100 0
Expand Down
4 changes: 2 additions & 2 deletions ref/vk/data/valve/maps/c1a0e.rad
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//RED 255 0 0 10000
RED 255 0 0 0 // no need
+0~GENERIC86B 60 220 170 10000
+0~LAB1_CMP2 255 255 255 20
//+0~LAB1_CMP2 255 255 255 20 // TODO: emissive texture
~LIGHT3C 220 210 150 2500
+A~FIFTIES_LGT2 160 170 220 4000
+0~FIFTIES_LGT2 160 170 220 10000
Expand All @@ -15,6 +15,6 @@ XENO_18 0 50 255 10000
CRYS_3TOP 255 152 79 10000
+0~LIGHT1 40 60 150 10000
+0LAB1_W6 150 160 210 8800
LAB1_COMP3D 255 255 255 0 // no need (for optimization)
//LAB1_COMP3D 255 255 255 20 // TODO: emissive texture
+0~DRKMTLS2 150 120 20 30000

6 changes: 3 additions & 3 deletions ref/vk/data/valve/maps/c1a1a.rad
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
+A~FIFTIES_LGT2 160 170 220 4000
+0~GENERIC86B 60 220 170 10000

+0~LAB1_CMP2 255 255 255 0
+1~LAB1_CMP2 255 255 255 0 // hack, because no inheritance yet
+2~LAB1_CMP2 255 255 255 0 // hack, because no inheritance yet
//+0~LAB1_CMP2 255 255 255 20 // TODO: emissive texture
//+1~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet
//+2~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet

LAB1_COMP3D 255 255 255 0

Expand Down
8 changes: 4 additions & 4 deletions ref/vk/data/valve/maps/c1a1f.rad
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//+0~LAB1_CMP2 255 255 255 0
//+1~LAB1_CMP2 255 255 255 0 // hack, because no inheritance yet
//+2~LAB1_CMP2 255 255 255 0 // hack, because no inheritance yet
//+0~LAB1_CMP2 255 255 255 20 // TODO: emissive texture
//+1~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet
//+2~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet

LAB1_COMP3D 255 255 255 0
//LAB1_COMP3D 255 255 255 20 // TODO: emissive texture

+0DRKMTL_SCRN 60 80 255 200
+1DRKMTL_SCRN 60 80 255 200
Expand Down
19 changes: 7 additions & 12 deletions ref/vk/data/valve/maps/lights.rad
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
+0BUTTONLITE 255 0 0 220
//+0DRKMTL_SCRN 60 80 255 10000
//+1DRKMTL_SCRN 60 80 255 10000 // hack, because no inheritance yet
//+2DRKMTL_SCRN 60 80 255 10000
//+2DRKMTL_SCRN 60 80 255 10000 // hack, because no inheritance yet
+0DRKMTL_SCRN 60 80 255 200
+1DRKMTL_SCRN 60 80 255 200
+2DRKMTL_SCRN 60 80 255 200
+1DRKMTL_SCRN 60 80 255 200 // hack, because no inheritance yet
+2DRKMTL_SCRN 60 80 255 200 // hack, because no inheritance yet
+1FLICKERMON 255 255 255 1000
+3FLICKERMON 255 255 255 300
+4FLICKERMON 255 255 255 1000
Expand Down Expand Up @@ -42,12 +42,9 @@
+0~GYMLIGHT 255 230 150 2500
+0~LAB_CRT8 50 50 255 100
+1~LAB_CRT8 50 50 255 100 // hack, because no inheritance yet
//+0~LAB1_CMP2 255 255 255 20
//+0~LAB1_CMP2 255 255 255 20 // TODO: emissive texture
//+1~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet
//+2~LAB1_CMP2 255 255 255 20 // hack, because no inheritance yet
+0~LAB1_CMP2 255 255 255 0 // TODO: emissive texture
+1~LAB1_CMP2 255 255 255 0 // hack, because no inheritance yet
+2~LAB1_CMP2 255 255 255 0 // hack, because no inheritance yet
//+0~LIGHT1 40 60 150 3000
+0~LIGHT1 40 60 150 10000
+0~LIGHT2A 255 250 130 2000
Expand All @@ -70,7 +67,7 @@ DRKMTL_SCRN3 1 111 220 200
ELEV2_CIEL 255 200 100 2000
EMERGLIGHT 255 200 100 50000
EMERGLIGHTC 101 255 170 8000
FIFTIES_MON1B 100 100 180 30
//FIFTIES_MON1B 100 100 180 30
FILL1 140 190 175 30
FILL2 140 190 175 30
//FLATBED_HLITE2 215 180 95 2000
Expand Down Expand Up @@ -103,15 +100,13 @@ SKKYLITEDAWN 210 175 195 2000
SUBWAY_LIGHTS 255 250 202 2000
//WHITE 255 255 255 100
//YELLOW 255 200 100 2000
//LAB1_COMP3D 255 255 255 20
LAB1_COMP3D 255 255 255 0 // TODO: emissive texture
//LAB1_COMP3D 255 255 255 20 // TODO: emissive texture
~GENERIC87 205 230 255 550
~GENERIC88 205 230 255 550
~LAB_CRT9A 225 150 150 100
~LAB_CRT9B 100 100 255 100
~LAB_CRT9C 100 200 150 100
//~LAB1_COMP7 255 255 255 20
~LAB1_COMP7 255 255 255 0 // TODO: emissive texture
//~LAB1_COMP7 255 255 255 20 // TODO: emissive texture
~LIGHT3A 190 20 20 3000
//~LIGHT3B 155 155 235 2000
~LIGHT3B 84 118 198 14000
Expand Down

0 comments on commit a9df5cd

Please sign in to comment.