flingengine / FlingEngine

A Vulkan game engine with a focus on data oriented design
https://fling-engine.site/
MIT License
408 stars 16 forks source link

Add a "Debug" Rendering pipeline that draws meshes in wireframe #144

Open BenjaFriend opened 4 years ago

BenjaFriend commented 4 years ago

There should be a PipelineFlags options for "Debug" which will build a render pipeline enabling you to draw wireframe meshes

This is a really important feature that I want to have because how we implement this should be same was as we would a new shader effect, like an outline shader. It's important that the design is scalable to have as many materials/visual effects that we want here and that it is easily extensible to the end user (a graphics programmer making a new effect)

BenjaFriend commented 4 years ago

Shaders

This is necessary because we are working in world space, so we have to be drawing on the full screen quad render target.

C++ Side

We may have to change how the OffscreenSubpass::Draw function works. Because the offscreen pass currently begins/ends it's own command buffer, we have to make sure that we manage dependencies for drawing correctly in the Debug subpass. Ideally I would like to have the Debug subpass using those exact same command buffers, but that means we have a dependency between Offscreen and Debug.