init dynpip bag

This commit is contained in:
h4570
2022-07-18 23:16:47 +02:00
parent efdec2c52e
commit 0953ce3f19
33 changed files with 321 additions and 80 deletions
@@ -0,0 +1,34 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <draw.h>
#include "math/m4x4.hpp"
#include "math/vec4.hpp"
#include "./pipeline_shading_type.hpp"
namespace Tyra {
class PipelineInfoBag {
public:
PipelineInfoBag();
~PipelineInfoBag();
/** Mandatory. Model matrix */
M4x4* model;
PipelineShadingType shadingType;
bool blendingEnabled;
bool antiAliasingEnabled;
bool noClipChecks;
};
} // namespace Tyra
@@ -0,0 +1,56 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include "renderer/models/color.hpp"
#include "math/m4x4.hpp"
#include "math/vec4.hpp"
namespace Tyra {
enum PipelineLightingBagMode { Auto, Manual };
class PipelineLightingBag {
public:
explicit PipelineLightingBag(const bool& manual = false);
~PipelineLightingBag();
Vec4* normals;
M4x4* lightMatrix;
void setAmbientColor(const Color& color);
void setDirectionalLightColors(Color* colors, const u8& count);
void setDirectionalLightDirections(Vec4* directions, const u8& count);
void setDirectionalLightColor(const Color& color, const u8& index);
void setDirectionalLightDirection(const Vec4& direction, const u8& index);
void setLightsManually(Vec4* colors, Vec4* directions);
void disableManualMode();
Vec4* getLightColors() { return lightColors; }
Vec4* getLightDirections() { return lightDirections; }
void forceDeallocateColors();
void forceDeallocateDirections();
private:
void allocate();
void deallocate();
void forceDeallocate();
u8 isAllocated;
PipelineLightingBagMode mode;
Vec4* lightColors;
Vec4* lightDirections;
};
} // namespace Tyra
@@ -0,0 +1,20 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
namespace Tyra {
enum PipelineShadingType {
StaPipShadingFlat,
StaPipShadingGouraud,
};
} // namespace Tyra