Skip to content

Conversation

@gpx1000
Copy link
Contributor

@gpx1000 gpx1000 commented Dec 16, 2025

NB: if you have the bistro from before, please grab the latest to be able to see the animations of the ceiling fan.

Apply consistent formatting, improve code readability, and add/update copyright headers across multiple files.

This is the full simple game engine with all features implemented including:

  • streaming textures in separate threads with transfer queue ray query rendeirng pipeline
  • forward+ rendering pipeline
  • reflections
  • thick and thin glass
  • translucency
  • better lighting fixes so light doesn't appear over bright animation from GLTF
  • robustness2
  • synchronization2
  • Dynamic rendering local read
  • shader tile image
  • culling

Incorporated PRs for:

  • Android support
  • Windows support
  • memory leak fixes

… copyright headers across multiple files.

This is the full simple game engine with all features implemented including:
streaming textures in separate threads with transfer queue
ray query rendeirng pipeline
forward+ rendering pipeline
reflections
thick and thin glass
translucency
better lighting fixes so light doesn't appear over bright
animation from GLTF
robustness2
synchronization2
Dynamic rendering local read
shader tile image
culling

Incorporated PRs for:
Android support
Windows support
memory leak fixes
@gpx1000 gpx1000 added the Game Engine Specific to the Simple Game Engine tutorial label Dec 16, 2025
…and shaders for cleaner production-ready code.
@SaschaWillems
Copy link
Collaborator

CMake setup doesn't work for me (while it does/did work on master). I get the following error:

CMake Error at V:/github/vcpkg/scripts/buildsystems/vcpkg.cmake:893 (_find_package):
  By not providing "Findtinygltf.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "tinygltf",
  but CMake did not find one.

  Could not find a package configuration file provided by "tinygltf" with any
  of the following names:

    tinygltfConfig.cmake
    tinygltf-config.cmake

  Add the installation prefix of "tinygltf" to CMAKE_PREFIX_PATH or set
  "tinygltf_DIR" to a directory containing one of the above files.  If
  "tinygltf" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:20 (find_package)

This is on Windows 11.

@SaschaWillems
Copy link
Collaborator

I also don't see any added .adoc documentation files. Afair the samples PR had a few new documentation chapters?

@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 16, 2025

Yep, I'm working those into the tutorial itself. Should have them soon

@SaschaWillems
Copy link
Collaborator

Adding a CMake folder and putting Findtinygltf.cmake in there makes CMake work. So looks like that file simply is missing in the right folder.

@SaschaWillems
Copy link
Collaborator

Does compile and start for me on Windows with above fix, but errors out at loading:

image

Watchdog sounds like something implemented in the app itself that doesn't take into account that things do load a lot slower in debug ;)

@SaschaWillems
Copy link
Collaborator

SaschaWillems commented Dec 16, 2025

If I increase the watchdog timeout, same issue as I had with an earlier version: In debug it starts loading things and at some point just gets stuck, and nothing ever happens.

In release it outright crashes in the driver right at startup (Nvidia RTX 4070).

Enabling validation layers I do not see any errors, but I do get an exception in pNext validation of the layers. So this looks like the application is not properly initializing things.

@SaschaWillems
Copy link
Collaborator

SaschaWillems commented Dec 16, 2025

Debugging in RelWithDebugInfo: This is a scoping issue.

This code:

image

Declares variables inside an if-block, yet they're accessed outside of it.

Obviously can't work and needs fixing.

Looks like there are other places where this is also wrong, causing all sorts of exceptions, see e.g.:

image

@SaschaWillems
Copy link
Collaborator

Also indentation is all over the place for me in some files, e.g.:

image

We merged clang-format into tutorials a few weeks ago: Would it make sense to apply it to the simple game engine files?

@SaschaWillems
Copy link
Collaborator

One thing that I'm totally unsure about and might be something that should be cleared inside Vulkan:

The original tutorial was licensed under CC-BY-SA 4.0. So we had to use the same license for our tutorial too. The simple game engine files use Apache-2.0 as their license, which differs from CC-BY-SA. Not sure if we can/should mix licenses like that.

Any thoughts @marty-johnson59?

…-Profiles, and GLM libraries, enabling automated detection and integration of dependencies.
@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 16, 2025

I fixed the cmake by committing the cmake folder that was missing.

The watchdog I might remove; I don't know if it makes sense for slower computers. 2 seconds between update should have been fine. Maybe 10 seconds? Or maybe just remove it.

Lemme see if I can find all the places where I messed up the scoping.

The indention, was done by the samples' script. I'll redo it and make it cleaner. Just about to add the updates to the tutorial text.

…ustness2, Mipmaps and LOD, glTF Animation, and Push Constants.
@marty-johnson59
Copy link
Contributor

Hmm, might be cleaner to have the same license. Is that possible @gpx1000? If not, I can check with Khronos legal to see if mixing licenses is an issue..

@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 17, 2025

I only put the copyright at the top to get past the sample's PR requirements. I'm fine with whatever license we want to use.
However, I think someone asked on Discord to have the most permissive license possible. While we can't try to change the license of the main tutorial, we can make sure that new tutorials like this one are as permissive as possible with the hope that this can be used as a template for any project.
That said, my goals here are to provide good high quality documentation that people can use. I would have no problem with whatever license we want to use and am fine with keeping it at the same that the tutorial uses.

…ormance, reduce redundant lookups, and enhance thread safety in rendering pipelines.

Hopefully fix windows, also, fix frames-in-flight so we can handle more than 1.  Hopefully, improve the windows frame rate.  In linux testing all rendering types and options result in about 60fps on an older computer.  Forward+ does drop to 30, but that's due to requirements of the Forward+ methodology.
@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 17, 2025

@SaschaWillems I think I hopefully got all of the potential places that windows could have crash potential problems. I also did a bunch of work on improving the frame rate. I now see 60fps in Linux for all render types while in debug build, except for forward+ (for hopefully obvious reasons (i.e. if you want boundless dynamic lighting capabilities without deferred there's significant overhead to that kind of trade off; could refine this further to get frame rate up there, but these optimizations are the ones I can do in a day).
i'm on a NVIDIA 2090 6 year old laptop.
Lemme know if you run into any more issues. I'll get a Windows machine to validate these on if you run into problems there.

@SaschaWillems
Copy link
Collaborator

SaschaWillems commented Dec 17, 2025

Looking better.

But still crashing for me in debug, while/after TLAS creation. Watchdog kicks in and aborts, resulting in an exception:

image

If I increase the watchdog timeout, it just gets stuck at some point. Last line I see is

AS build deferred: readiness 0/551 entities (0%), uniqueMeshesReady=0

But this never ever moves and is stuck indefinitely at 0%.

If you can't debug on Windows I can try, but I'd have to get into the code base first.

@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 17, 2025

I'll debug in windows, just gonna take some logistics on my end. I shouldn't travel this close to holidays and only bring linux and mac laptops. I think I have a solution, will just take time to set it up.

@SaschaWillems
Copy link
Collaborator

No need to hurry ;)

This gets windows to run out of the box.
@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 17, 2025

I am in the process of upgrading my work computer so I had a brand new never before used computer that had windows pre-installed. I got it setup enough to do the debugging. Simple memory issue causing the race condition. This should now build and run out of the box. Okay, now to get this machine turned into Linux. So, if there's further windows issues, I'll have to wait until I get back to the office and have another windows machine to try out or I'll try to borrow some of Sam's time.

@marty-johnson59
Copy link
Contributor

Hi folks, regarding the license for the game engine code (not the docs), I checked with Emily and others on Khronos staff and we're OK with mixed licenses for this repo. I recommend we stick with Apache2 for the code - which matches what we do for our other sample code. But of course, for the tutorial documentation, we should stick with CC SA 4.0...LMK if questions.

@SaschaWillems
Copy link
Collaborator

Still only working for me in Debug.

In Release, watchdog always kicks in, no matter if release or debug. Even if I change it to wait for 60 seconds.

In release this is where it hangs:

image

Feels like UB. Maybe missing initialization or a race condition? Hard to debug, as it only fails in releease.

@SaschaWillems
Copy link
Collaborator

Debug seems to work because it thinks that ray queries are not supported:

image

That's 100% not the case. My RTX4070 supports them just fine.

@SaschaWillems
Copy link
Collaborator

SaschaWillems commented Dec 18, 2025

Also seeing some rendering issues, where e.g. the windows are not transparent depending on my camera angle. Looks like a culling issue.

@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 19, 2025

I should do a quick version that adds to the CI, not sure if it already checks the game engine or not (can't remember).

- Added progress tracking to Watchdog for better diagnostics during long operations.
- Enhanced Vulkan extension support checks with reusable helper.
- Optimized fencing and timeline semaphore handling for resource uploads.
- Improved staging buffer usage and batch processing for entity resources.

The windows debug now loads in under a minute and displays ray query as default and at 80fps.  Forward+ causes raster pass to average around 30fps while normal PBR raster, phong and no culling are all around 50 fps.
@gpx1000 gpx1000 mentioned this pull request Dec 19, 2025
- Sets up CI for Linux and Windows platforms.
- Includes Vulkan SDK setup and Linux prerequisites installation.
- Adds vcpkg manifest integration for dependency management.
- Improved Vulkan SDK installation for both Windows and Linux, including error handling and streamlined processes.
- Replaced direct vcpkg calls with platform-specific dependency install scripts.
- Added configuration for Ninja builds and automated test execution.
- Transitioned CI workflow to use LunarG's official Vulkan SDK tarball for Linux.
- Removed platform-specific Vulkan SDK package installations in favor of consistent tarball handling.
- Added new scripts for building and installing tinygltf and KTX dependencies from source.
- Updated Linux dependency scripts to standardize package installations across distributions.
- Improved build instructions to use Ninja by default.
- Added multiple fallback URLs for Vulkan SDK download from LunarG.
- Implemented error handling to ensure CI exits gracefully if all downloads fail.
@8SecSleeper
Copy link

Thanks for the report. Could you be more specific about what's missing for you in the CMake that's been committed? I am on a local fresh windows install and I haven't run into issues with the CMake. Are you using vcpkg? I assume you're on windows because you're saying you're seeing a 50 % frame drop. In linux I get 60fps with all the various options. I locally have a fix for the ray queries not working that I'm going to commit as soon as I get a full fix for the hang on start issue. That's taking some refactoring so it might not land tonight; but maybe in the next few days.

Add the installation prefix of "glfw3" to CMAKE_PREFIX_PATH or set
[cmake] "glfw3_DIR" to a directory containing one of the above files. If "glfw3"
[cmake] provides a separate development package or SDK, be sure it has been
[cmake] installed.

Missing ways to find glfw3 in the cmake folder. Not sure how you got past that on a clean install of windows. I also ran the vcpkg deal as suggested and restarted.

I resolved that, now I get this error.

C:/Program Files/CMake/share/cmake-4.2/Modules/FindPackageHandleStandardArgs.cmake:654 (_FPHSA_FAILURE_MESSAGE)
[cmake] CMake/FindKTX.cmake:55 (find_package_handle_standard_args)
[cmake] CMakeLists.txt:21 (find_package)

After dealing with that.

I get this.

[cmake] Could NOT find OpenAL (missing: OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
[cmake] Call Stack (most recent call first):
[cmake] C:/Program Files/CMake/share/cmake-4.2/Modules/FindPackageHandleStandardArgs.cmake:654 (_FPHSA_FAILURE_MESSAGE)
[cmake] C:/Program Files/CMake/share/cmake-4.2/Modules/FindOpenAL.cmake:140 (find_package_handle_standard_args)
[cmake] CMakeLists.txt:22 (find_package)

It's my understanding. that I should be able to run the bat file and the cmake and have a fully working project without all the running around. Let me know what I'm doing wrong. I'm quite curious what steps your taking on a clean windows install, to be able to run the project.

@SaschaWillems
Copy link
Collaborator

Please post your CMake command line. A clean CMake works fine for me, but you need to use the vcpkg toolchain.

@8SecSleeper
Copy link

Please post your CMake command line. A clean CMake works fine for me, but you need to use the vcpkg toolchain.

I was going off what it suggested in the install_dependencies_windows.bat.

echo All dependencies have been installed successfully!
echo You can now use CMake to build your Vulkan project.
echo.
echo Example CMake command:
echo cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=[path\to\vcpkg]\scripts\buildsystems\vcpkg.cmake
echo cmake --build build

So I took it as..

cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=C:\Users\Sadman\Desktop\Github\vcpkg\scripts\buildsystems\vcpkg.cmake

even tried using the explicit version suggested.

cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=[C:\Users\Sadman\Desktop\Github\vcpkg]\scripts\buildsystems\vcpkg.cmake

With you suggesting it's an issue with the command. I broke down and asked AI what the command should be and it gave me this.

cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE="C:/Users/Sadman/Desktop/Github/vcpkg/scripts/buildsystems/vcpkg.cmake"

Which works for me. Whilst the others failed.

@SaschaWillems
Copy link
Collaborator

Makes sense. I'm used to put paths in Windows inside quotes, so we might neeed to update the build instructions to let people know that this might be required.

@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 19, 2025

I went ahead and added ci to this last night. Need to fix Linux again. But hopefully that'll help as well.

Thanks for testing. I expect there's plenty of bugs in the pr. Spaces in the path and making sure the path is under a certain length are always the fun ways windows throws is curve balls. I'll have to think about where and how best to document that as it could appear anywhere there's file interaction and paths.

@SaschaWillems
Copy link
Collaborator

A recent commit did break things for me on Windows. I'm longer able to build. CMake now throws all these errors:

image

@8SecSleeper
Copy link

8SecSleeper commented Dec 19, 2025

A recent commit did break things for me on Windows. I'm longer able to build. CMake now throws all these errors:

image

I got beyond that issue by removing the "builtin-baseline": "2f84ffcfe5db02bf2d3b8377663cac7debaeef84". In the vcpkg file in the root project folder.

@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 19, 2025

Ahh... okay, getting CI working required some of that. I'll nuke that from the vcpkg in the next commit. Still working on Linux.

Enhance Vulkan SDK configuration by dynamically handling sysroot paths, setting explicit include and library directories, and refining CMake arguments, ensuring better compatibility and diagnostics.
…ation, enhance environment variable handling, improve tool detection, and add support for slangc in CMake configuration.
…`slangc`, enhance Vulkan SDK shared library handling, and improve environment diagnostics.
@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 21, 2025

Linux and windows finally work in the CI. Gonna try to get Android working in CI as well. I thought I grabbed all the changes from the other PR for it, but maybe not. I think once we have that we're good to merge this if you guys are comfortable with that.

@8SecSleeper
Copy link

Has anyone managed to get windows to build on release? I only had luck with debug build. Gonna try the latest commits today. But as of yesterday no luck.

@SaschaWillems
Copy link
Collaborator

See my comments above. Haven't had time to test with latest commits yet.

@SaschaWillems
Copy link
Collaborator

SaschaWillems commented Dec 21, 2025

With the latest commits it actually got worse for me. In release I now do get multiple device losts at startup (which on my setup also results in nasty audio hangs) :(

Debug works, but the image is extremely noisy. Looks like a combination of lighting issues, high frequency shading and missing mip maps. Transparent surfaces like the Café's windows are broken too.

Will prob. defer further testing until things become stable on Windows.

@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 21, 2025

Which render pipeline in debug is showing as extremely noisy? Is it the ray query, the PBR, the Forward+, or the phong? I'm guessing the ray query. Culling make it better/worse? Try adjusting the number of bounces slider. It might be worth taking the slider out and only allowing one bounce at most. I'll look at the windows side again, right now am trying to get the gaussian splats out. and all the other things on plate before end of year. I do want to try to get this merged as soon as possible, and put the checklist up of all the comments we had in the original PR; try to work through all of them. We'll see when I get time.

@SaschaWillems
Copy link
Collaborator

The rasterization pipelines are indeed less noisy than the ray query one.

My no. 1 request would be getting this to properly work on Windows ;)

@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 21, 2025

I have windows here now so will try iterating a bit on that side.

@gpx1000
Copy link
Contributor Author

gpx1000 commented Dec 23, 2025

I think the noisy thing you're seeing is the reflections code in ray tracing. Without shadows, light doesn't really care about geometry correctly, so all light is additive and the reflections are thus exaggerated. I went ahead and added some shadows with that being the assumption (i.e. I don't see any noisy effects with reflections turned off before the change). I'm still working on glass. but this is now taking a back seat to getting the gaussian splat sample. and all the other things that we need to get done by end of year. I'll try to get a new version up with shadows tonight/tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Game Engine Specific to the Simple Game Engine tutorial

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants