C++ Game Engine (Vulkan) - Airplane demo

Опубликовано: 16 Июль 2023
на канале: Lewa
4,838
157

This is a continuation of the previous FPS demo (which included vehicle combat). As the engine is still work in progress (and there are a few features still missing such as a map- and character- editor) i cut the whole First-person shooter aspect of the game and concentrate on vehicle combat for now. This reduced complexity and allows me to take more time with polishing the core aspects of the gamefeel and gameplay loop.

One of the notable features in this demo is the water rendering which uses tesselation shaders. (It's still a very rough implementation but it works for my usecase.)

There are still aspects of the engine i've to work out (it's an ongoing process) but i'm getting more and more into the game prototyping stage as most of the (core) engine features are already up and running.

The renderer is PBR based, supports one global directional (sunlight) as well as point lights. Shadowmapping is done in realtime by using 7 shadow cascades to allow long distance shadows (shadows are fading out at 6km distance). Not the best technique but it works fine on a GTX 1060. The renderer is using a z-prepass to precalculate which fragments have to be rendered during the gbuffer pass. (This heavily cuts down on overdraw but incurs a CPU cost as every geometry has to be rendered twice ingame.)

I'm using also the reverse-z depthbuffer technique to linearize (or at least get close to linear) the depth-precision across the near and far-plane.
By default depth-buffer are logarithmic (starting from 0 and going up to 1) so that most of the precision is in the near plane. At distance you rapidly loose precision which causes z-fighting.

What you can do however is reverse the depth range (so that 1 is near and 0 is far) and then store the depth in a floating point (32 bit) framebuffer. Floats have more precision closer to 0 than 1 so it negates the logarithmic precision loss of the depth buffer. (The most precision loss is then in the middle distance of 0.5 but still. It's as close as you can get with hardware acceleration.)
This in turn should keep most z-fighting artifacts to a minimum. (at least i hope so.)

Hope to be able to post more game/gameplay related stuff in the upcoming months.

_______________
Music Track: "Smash It Sport Action Background" by "Sound_Forces"
https://audiojungle.net/item/smash-it...