finished tutorial 9

This commit is contained in:
h4570
2022-08-24 19:27:16 +02:00
parent 5c375dd24f
commit a21bcee671
11 changed files with 130 additions and 41 deletions
@@ -20,9 +20,9 @@ namespace Tyra {
*/
class StaPipBagPackagesBBox {
public:
StaPipBagPackagesBBox(Vec4* t_vertices, u32* t_faces, const u32& t_facesCount,
const u32& t_maxVertCount);
StaPipBagPackagesBBox(Vec4* t_vertices, const u32& t_counts,
StaPipBagPackagesBBox(const Vec4* t_vertices, u32* t_faces,
const u32& t_facesCount, const u32& t_maxVertCount);
StaPipBagPackagesBBox(const Vec4* t_vertices, const u32& t_counts,
const u32& t_maxVertCount);
~StaPipBagPackagesBBox();
@@ -11,7 +11,7 @@
#pragma once
#include <tamtypes.h>
#include "core/bag/packaging/stapip_bag_packages_bbox.hpp"
#include "./bag/packaging/stapip_bag_packages_bbox.hpp"
#include "renderer/3d/mesh/mesh.hpp"
#include <memory>
#include <vector>
@@ -20,7 +20,7 @@ namespace Tyra {
struct StapipBagBBoxesCacheItem {
u32 vu1MaxVertCount;
u32 frameId;
u32 id;
std::unique_ptr<StaPipBagPackagesBBox> bboxes;
int framesLeftToDestroy;
};
@@ -35,12 +35,11 @@ class StapipBagBBoxesCacher {
void onFrameEnd();
StaPipBagPackagesBBox* getBBoxesByMesh(const MeshMaterialFrame* frame,
const u32& maxVertCount);
StaPipBagPackagesBBox* getBBoxes(const Vec4* vertices, const u32& count,
const u32& id, const u32& maxVertCount);
private:
StapipBagBBoxesCacheItem* getCache(const u32& maxVertCount,
const u32& frameId);
StapipBagBBoxesCacheItem* getCache(const u32& maxVertCount, const u32& id);
std::vector<StapipBagBBoxesCacheItem> storage;
};
@@ -16,6 +16,7 @@
#include "./bag/packaging/stapip_bag_package.hpp"
#include "./bag/packaging/stapip_bag_packager.hpp"
#include "./stapip_qbuffer_renderer.hpp"
#include "./stapip_bag_bboxes_cacher.hpp"
#include "renderer/3d/pipeline/shared/pipeline_frustum_culling.hpp"
namespace Tyra {
@@ -27,9 +28,10 @@ class StaPipCore {
void init(RendererCore* t_core);
void onFrameEnd();
/** Render 3D via "bags" */
void render(StaPipBag* bag, StaPipBagPackagesBBox* bbox,
const u32& maxVertCount);
void render(StaPipBag* bag);
/** Get max vert count of VU1 qbuffer (for optimizations) */
u32 getMaxVertCountByParams(const bool& isSingleColor,
@@ -59,6 +61,7 @@ class StaPipCore {
u32 maxVertCount;
RendererCore* rendererCore;
StapipBagBBoxesCacher cacher;
void setMaxVertCount(const u32& count);
StaPipBagPackager packager;
@@ -17,7 +17,6 @@
#include "renderer/3d/mesh/static/static_mesh.hpp"
#include "./core/stapip_core.hpp"
#include "./stapip_options.hpp"
#include "./stapip_bag_bboxes_cacher.hpp"
namespace Tyra {
@@ -51,7 +50,6 @@ class StaticPipeline : public Renderer3DPipeline {
void render(const StaticMesh* mesh, const StaPipOptions* options);
private:
StapipBagBBoxesCacher cacher;
RendererCore* rendererCore;
Vec4* colorsCache;