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

Added phong shading and support for a UI-controlled viewport + other changes #29

Merged
merged 20 commits into from
May 13, 2022

Conversation

TerraDOOM
Copy link
Collaborator

@TerraDOOM TerraDOOM commented May 4, 2022

  • Added Phong shading (or at least the ambient/diffuse components of it) using vertex normals.
  • Added deferred rendering and proper point light support (with light volumes)
  • Added support for a UI-controlled viewport
  • Modified Renderer to compartmentalize the actual drawing into its own World struct that can be duplicated etc.
  • Changed the ModelManager to instead be effectively a writable "guard" for the backing GPU-buffers, so that on drop all pending changes are automatically flushed to the GPU.
  • Fixed a bug where vertex/index buffers were overwritten with new data before the draws were actually performed, resulting in the final draw using vastly wrong vertex and index data.

Closes #18
Closes #30

Added comments to a bunch of the rendering code to hopefully explain what it's doing.
- Added basic phong shading using vertex normals
- Added basic traits to Camera
- Added normal maps to Material (so far unused)
- Added logic to create custom render targets that can be rendered to
- Factored out much of the rendering logic into a new "World" struct
  which can be duplicated and have their own custom render targets, this
  to facilitate rendering a scene to a texture for use in egui.
- Refactored the clip rect logic
- Added resize logic to the painter
Updated the ModelManager to use a pattern similar to a MutexGuard, in
that it freely allows writing to the instances, and uses a Drop impl to
synchronize the values to the GPU.
@foodelevator foodelevator added the Renderer✒️ This is related to the renderer label May 4, 2022
@TerraDOOM TerraDOOM marked this pull request as ready for review May 13, 2022 14:11
Copy link
Collaborator

@foodelevator foodelevator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's amazing

@TerraDOOM TerraDOOM merged commit c6a622a into main May 13, 2022
@foodelevator foodelevator deleted the shading-and-egui branch May 13, 2022 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Renderer✒️ This is related to the renderer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add customizable light sources Engine asset management
3 participants