RTX Vulkan Game Engine
- 10 Devlogs
- 42 Total hours
A redone version of a vulkan engine, this time made following a tutorial so I actually know what I'm doing!
A redone version of a vulkan engine, this time made following a tutorial so I actually know what I'm doing!
Got dynamic scenes (mostly) working! Now while the code is running, models can be loaded and added. Probably will have to add blas merging for the future since each model having its own is a linear compared to logarithmic cost of combining them. Combining similar shouldn’t be hard since that is actually just modifying the root of of the animation framework. I might have like a cap of 5-10 with one being static geometry and the rest clumps of models. Still have to get removal working which shouldn’t be too bad. The hardest part was lining up all of my Vec<_>s so what I might do is combine it into a struct to organize, but I’ll leave it for now since that will probably conflict with the merging. Also, I’m planning on adding multithreading for the future so fingers crossed!
Got a bunch of PBR added to the shaders. Now has a lot of stuff so if you export more complex materials from blender or something it can parse and render them. I do still have to get transparency working, but that is much more complex than just solids tbh. For some reason my model’s animations kinda broke and only play like 60% of the animation before looping, but that isn’t the engines fault, I probably just need to make blender behave better.
Got models working!! Fully rigged and animated! I setup the framework to auto load any anims, and then they can be played from lets say the main with something like this: app.scene.animations[2].play(“Chop_Tree RT.001”);, so that works pretty well! I also implemented a pause/play/stop and fuzzy search since some of the anim names can be weird. Thanks to mesh2motion’s huge animation library and stuff. This model is custom textured by me, so I do own it. However, you may feel free to use it (with credit!) wherever. His name is Xenon btw
Got dynamic transforms working!!! You can’t see it, but that truck on the bottom is actually spinning so helicopter. This took a bit to add in, but thanks to the model system, I just had to add a transformation matrix for each one, which is done easier than said. I did have a bunch of issues with the multi bvh setup, but now that its done updating the matrices only takes about 0.02ms with the two. Might end up being more in the future with more, but definitely not bad in the slightest.
Got something really nice working: Instancing!! Basically now, when you want to start the scene up, you just call Scene::new() and then if you want to load a model into memory, just use load_model_into_memory() and you can stamp that out without reloading the model from the disc each time. Plus I added dedicated scale/transform functions that you just call on a specific model’s id (like for the first truck I loaded, I moved and scaled it with its id of 0). Basically loading models and transforming them is near effortless. Dynamic transforms next and then probably rigging!
Got a ton done towards an actual engine!! Added more model formats (glb files) and the ability to load more than one at a time! Also, textures have been introduced so if you look closely you can actually see the truck has a duramax engine label (boo! cummins is better). Shadows have been improved even more, although this screenshot doesn’t really show it too much. Next thing I have to add is dynamic vertices at runtime, which will allow me to actually change geometry without restarting the engine, and then after that, model rigs! There are a couple validation errors still (so a potential memory leak), but they only appear every couple of times the program is ran, and I really couldn’t find it, so thats a later problem.
Got some stuff done with the engine. Improved lighting with smooth normals and stuff. Also I added atmospheric scattering from one of my other shaders. Currently, the model that is loaded (although it may look not the greatest, I don’t have textures setup yet) has 8.5 million triangles and 16 million vertices. In 1440p, everything is currently running 1300 fps, with the majority of the hit coming from the scatterer as without it its a bit closer to 2300 fps.
Got a lot more done involving obj files and refinement! Now I can change the vertices on the fly, have decent indexing of them, and have raytraced shadows. Currently, on my rtx5070, in 1440p, this 408k triangle model runs around 1500fps, so pretty decent for now. I hope to lower that soon…
I had a nice devlog wrote, but it didn’t fully upload QwQ. Basically, I had to lean into AI to implement RT instead of raster due to a lack of rust tutorials for that. Spent most of the time debugging a slight misordering error that produce zero errors that caused nothing to render.
Got a triangle showing! Definately took me a while, but now I fully understand (ok like 90%) the pipeline! Also, now since I worked on my minecraft shader in the past, this will definitely look pretty good in the end. My goal of doing this engine is just because when I made my shader, I was running into performance issues due to minecraft and opengl, so this way I can bypass it all and have hardware vulkan support.