Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wireframe mode/Adjust aabb modes/Rename debug modes as render modes #389

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

T-rvw
Copy link
Contributor

@T-rvw T-rvw commented Sep 15, 2023

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...

image

So here comes a stupid but workable solution. Also adjust AABB/DebugModes user experience details:

  • Wireframe
    • RenderMode::wireframe
      • enable : draw all meshes in wireframe
      • disable : draw selected mesh in wireframe
  • AABB
    • AABB switch button
      • enable : draw all aabbs
      • disable : draw aabb for collision mesh component which enable DebugDraw
  • RenderMode same to Blender concepts
    • Wireframe
    • Solid : shading in white model or just no textures(Maybe try to use PBR without any textures?)
    • Material Preview : no support
    • Rendered : pbr material shading

@T-rvw T-rvw requested review from bxy176179 and roeas September 15, 2023 17:52
@T-rvw T-rvw merged commit f04ab6e into main Sep 15, 2023
3 checks passed
@T-rvw T-rvw deleted the add_wireframe branch September 15, 2023 17:57
@T-rvw
Copy link
Contributor Author

T-rvw commented Sep 15, 2023

Closes #112 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant