-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* started working on implementing proper render features * lighting and engine UBO render features added * working on entity base class for OvRendering * dealing with camera issues * added OvSandbox applicaton to test rendering changes
- Loading branch information
1 parent
fd0834d
commit 840edbf
Showing
63 changed files
with
1,909 additions
and
963 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
Sources/Overload/OvCore/include/OvCore/Rendering/EngineBufferRenderFeature.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* @project: Overload | ||
* @author: Overload Tech. | ||
* @licence: MIT | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <map> | ||
#include <chrono> | ||
|
||
#include <OvRendering/Features/ARenderFeature.h> | ||
#include <OvRendering/Buffers/UniformBuffer.h> | ||
#include <OvRendering/Entities/Camera.h> | ||
|
||
namespace OvCore::Rendering | ||
{ | ||
/** | ||
* Render feature handling engine buffer (UBO) updates | ||
*/ | ||
class EngineBufferRenderFeature : public OvRendering::Features::ARenderFeature | ||
{ | ||
public: | ||
/** | ||
* Constructor | ||
* @param p_renderer | ||
*/ | ||
EngineBufferRenderFeature(OvRendering::Core::CompositeRenderer& p_renderer); | ||
|
||
/** | ||
* Upload view data to the GPU | ||
* @param p_camera | ||
* @param p_windowWidth | ||
* @param p_windowHeight | ||
*/ | ||
void UploadViewData( | ||
OvRendering::Entities::Camera& p_camera, | ||
uint16_t p_windowWidth, | ||
uint16_t p_windowHeight | ||
); | ||
|
||
/** | ||
* Invoked before drawing, handle uploading entity data to the GPU | ||
* @param p_drawable | ||
*/ | ||
virtual void OnBeforeDraw(const OvRendering::Entities::Drawable& p_drawable) override; | ||
|
||
/** | ||
* Invoked at the beginning of a frame, bind the engine buffer and update elapsed time | ||
* @param p_outputDesc | ||
*/ | ||
virtual void OnBeginFrame(std::optional<OvRendering::Data::RenderOutputDesc>& p_outputDesc) override; | ||
|
||
/** | ||
* Invoked at the end of a frame, unbind the engine buffer | ||
*/ | ||
virtual void OnEndFrame() override; | ||
|
||
private: | ||
std::chrono::high_resolution_clock::time_point m_startTime; | ||
std::unique_ptr<OvRendering::Buffers::UniformBuffer> m_engineBuffer; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.