The fruits of my labor

This commit is contained in:
2023-01-20 00:00:36 -08:00
parent 97fd59f28d
commit 3ee07af4db
55 changed files with 563 additions and 459 deletions

View File

@ -6,14 +6,21 @@
#pragma once
#include "display/shader/ShaderProgram.hpp"
#include "scene/components/display/MeshRenderer.hpp"
#include "scene/components/display/Camera.hpp"
#include "display/_RenderManager.hpp"
namespace Dawn {
class Material;
struct ShaderPass {
struct ShaderPassItem {
ShaderProgram *shaderProgram = nullptr;
int32_t orderShader = 0;
bool_t needsW = false;
int32_t priority = 0;
Mesh *mesh;
int32_t start = 0;
int32_t count = -1;
float_t w = 0;
renderflag_t renderFlags = RENDER_MANAGER_RENDER_FLAG_DEPTH_TEST;
// Parameters
std::map<shaderparameter_t, struct Color> colorValues;
@ -39,27 +46,17 @@ namespace Dawn {
virtual void compile() = 0;
/**
* Returns the list of passes to render for the given scene item.
* Returns the list of pass items to render for the given scene item.
*
* @param mesh Mesh Renderer for the scene item.
* @param material Material for the scene item.
* @param camera Camera for the scene.
* @return List of passes to render.
*/
virtual std::vector<struct ShaderPass> getItemPasses(
MeshRenderer *mesh,
Material *material
) = 0;
/**
* Called once per frame, set the global shader parameters that is used by
* every item in the scene.
*
* @param cameraProjection Projection matrix of the camera.
* @param cameraView View matrix of the camera.
*/
virtual void setGlobalParameters(
glm::mat4 cameraProjection,
glm::mat4 cameraView
virtual std::vector<struct ShaderPassItem> getPassItems(
Mesh *mesh,
Material *material,
Camera *camera
) = 0;
};
}