Add wireframe mode/Adjust aabb modes/Rename debug modes as render modes #389
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To implement wireframe in bgfx, author suggests to use
bgfx::topologyConvert
to create another index buffer for wireframe lines. The reason is that bgfx doesn't support different fill modes in rasterize stage for different drawcalls and its wireframe mode is a global flag which will affect all drawcalls.And bgfx also doesn't support geometry shader which can easily generate barycentric coordinates to render wireframe in one pass...
And generate barycentric coordinates offline need to duplicate vertices because it should follow 3-color graph rule... If you don't want to duplicate, it is difficult to reorder indexes. It is possible in most cases but not all caes...
So here comes a stupid but workable solution. Also adjust AABB/DebugModes user experience details: