renderer cleanup, demo changes

This commit is contained in:
h4570
2022-08-03 10:37:27 +02:00
parent da958cb094
commit 0a024e745f
27 changed files with 329 additions and 149 deletions
@@ -11,7 +11,7 @@
#pragma once
#include "math/vec4.hpp"
#include "renderer/3d/pipeline/shared/bag/pipeline_info_bag.hpp"
#include "./stapip_info_bag.hpp"
#include "./stapip_color_bag.hpp"
#include "./stapip_lighting_bag.hpp"
#include "./stapip_texture_bag.hpp"
@@ -31,7 +31,7 @@ class StaPipBag {
~StaPipBag();
/** Mandatory. Object info. */
PipelineInfoBag* info;
StaPipInfoBag* info;
/** Mandatory. Object color(s). */
StaPipColorBag* color;
@@ -0,0 +1,41 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# 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/3d/pipeline/shared/bag/pipeline_info_bag.hpp"
#include "renderer/3d/pipeline/static/stapip_ztest.hpp"
namespace Tyra {
class StaPipInfoBag : public PipelineInfoBag {
public:
StaPipInfoBag() {
fullClipChecks = false;
zTestType = StaPipZTest_Standard;
}
~StaPipInfoBag() {}
/**
* @brief Experimental! False -> disables "clip against each plane" algorithm.
* Default: True.
*
* Full clip checks are slow, but they are
* preventing visual artifacts, which can happen
* for big 3D objects (or objects near camera eyes)
* Force enabled in dynamic pipe, because of efficiency.
*/
bool fullClipChecks;
/** @brief Type of z buffer testing. */
StaPipZTest zTestType;
};
} // namespace Tyra
@@ -29,8 +29,7 @@ class StaPipCore {
void init(RendererCore* t_core);
/** Render 3D via "bags" */
void render(StaPipBag* bag, const bool& frustumCull, const StaPipZTest& zTest,
StaPipBagPackagesBBox* bbox = nullptr);
void render(StaPipBag* bag, StaPipBagPackagesBBox* bbox = nullptr);
/** Get max vert count of VU1 qbuffer (for optimizations) */
u32 getMaxVertCountByParams(const bool& isSingleColor,
@@ -53,7 +53,7 @@ class StaticPipeline : public Renderer3DPipeline {
void addVertices(MeshMaterialFrame* materialFrame, StaPipBag* bag) const;
PipelineInfoBag* getInfoBag(StaticMesh* mesh, const StaPipOptions* options,
StaPipInfoBag* getInfoBag(StaticMesh* mesh, const StaPipOptions* options,
M4x4* model) const;
StaPipColorBag* getColorBag(MeshMaterial* material,