Refactor material system (#382)

This commit is contained in:
Jérôme Leclercq
2022-10-31 19:53:41 +01:00
committed by GitHub
parent 0a8048809c
commit dc6ce8427c
156 changed files with 3633 additions and 4569 deletions

View File

@@ -9,6 +9,7 @@
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Graphics/Config.hpp>
#include <Nazara/Graphics/TransferInterface.hpp>
#include <Nazara/Math/Matrix4.hpp>
#include <Nazara/Renderer/ShaderBinding.hpp>
#include <memory>
@@ -20,7 +21,7 @@ namespace Nz
class RenderBuffer;
class UploadPool;
class NAZARA_GRAPHICS_API ViewerInstance
class NAZARA_GRAPHICS_API ViewerInstance : public TransferInterface
{
public:
ViewerInstance();
@@ -39,7 +40,8 @@ namespace Nz
inline std::shared_ptr<RenderBuffer>& GetViewerBuffer();
inline const std::shared_ptr<RenderBuffer>& GetViewerBuffer() const;
void UpdateBuffers(UploadPool& uploadPool, CommandBufferBuilder& builder);
void OnTransfer(RenderFrame& renderFrame, CommandBufferBuilder& builder) override;
inline void UpdateEyePosition(const Vector3f& eyePosition);
inline void UpdateProjectionMatrix(const Matrix4f& projectionMatrix);
inline void UpdateProjectionMatrix(const Matrix4f& projectionMatrix, const Matrix4f& invProjectionMatrix);
@@ -54,6 +56,8 @@ namespace Nz
ViewerInstance& operator=(ViewerInstance&&) noexcept = default;
private:
inline void InvalidateData();
std::shared_ptr<RenderBuffer> m_viewerDataBuffer;
Matrix4f m_invProjectionMatrix;
Matrix4f m_invViewProjMatrix;