dynamic pipeline base

This commit is contained in:
h4570
2022-07-18 21:49:38 +02:00
parent 34c553af04
commit 95c01afa01
66 changed files with 571 additions and 488 deletions
@@ -0,0 +1,37 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include <tamtypes.h>
#include "../renderer_3d_pipeline.hpp"
#include "./dynpip_options.hpp"
#include "renderer/core/renderer_core.hpp"
#include "renderer/3d/mesh/dynamic/dynamic_mesh.hpp"
namespace Tyra {
class DynamicPipeline : public Renderer3DPipeline {
public:
DynamicPipeline();
~DynamicPipeline();
void init(RendererCore* core);
void onUse();
/**
* Render 3D data via "meshes".
* This render() method is a bridge to core.render() method.
*/
void render(DynamicMesh* mesh, const DynPipOptions* options = nullptr);
};
} // namespace Tyra
@@ -0,0 +1,21 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# 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 {
class DynPipOptions {
public:
DynPipOptions() {}
~DynPipOptions() {}
};
} // namespace Tyra
@@ -15,12 +15,12 @@
namespace Tyra {
class StapipBagPackage {
class StaPipBagPackage {
public:
StapipBagPackage();
~StapipBagPackage();
StaPipBagPackage();
~StaPipBagPackage();
StapipBag* bag;
StaPipBag* bag;
Vec4* vertices;
Vec4* sts;
@@ -32,12 +32,12 @@ class StapipBagPackage {
CoreBBoxFrustum isInFrustum;
/**
* We are creating StapipBagPackagesBBox which checks CoreBBoxBBox for every
* We are creating StaPipBagPackagesBBox which checks CoreBBoxBBox for every
* maxVertCount / 3. So this variable is index of starting
* StapipBagPackagesBBox's CoreBBoxBBox. If package have <= maxVertCount / 3
* StaPipBagPackagesBBox's CoreBBoxBBox. If package have <= maxVertCount / 3
* verts, we will need only single (starting) bbox. if package have
* maxVertCount verts, we will calculate CoreBBoxBBox from 3
* StapipBagPackagesBBox's bboxes.
* StaPipBagPackagesBBox's bboxes.
*/
u32 indexOf1By3BBox;
@@ -19,13 +19,13 @@
namespace Tyra {
class StapipBagPackager {
class StaPipBagPackager {
public:
StapipBagPackager();
~StapipBagPackager();
StaPipBagPackager();
~StaPipBagPackager();
void init(Renderer3DFrustumPlanes* frustumPlanes);
void setRenderBBox(StapipBagPackagesBBox* bbox) { renderBBox = bbox; }
void setRenderBBox(StaPipBagPackagesBBox* bbox) { renderBBox = bbox; }
void setMaxVertCount(const u32& count);
/**
@@ -33,20 +33,20 @@ class StapipBagPackager {
*
* @param size Max maxVertCount verts (VU1 buffer size)
*/
StapipBagPackage* create(u16* o_size, StapipBag* data, u16 size);
StaPipBagPackage* create(u16* o_size, StaPipBag* data, u16 size);
/**
* @brief Split render package to smaller packages
*
* @param size Max maxVertCount verts (VU1 buffer size)
*/
StapipBagPackage* create(u16* o_size, const StapipBagPackage& pkg, u16 size);
StaPipBagPackage* create(u16* o_size, const StaPipBagPackage& pkg, u16 size);
CoreBBoxFrustum checkFrustum(const StapipBagPackage& pkg);
CoreBBoxFrustum checkFrustum(const StaPipBagPackage& pkg);
private:
u32 maxVertCount;
Renderer3DFrustumPlanes* frustumPlanes;
StapipBagPackagesBBox* renderBBox;
StaPipBagPackagesBBox* renderBBox;
};
} // namespace Tyra
@@ -18,13 +18,13 @@ namespace Tyra {
* Splits all 3D input vertices into 16vert parts and creates child bboxes for
* it
*/
class StapipBagPackagesBBox {
class StaPipBagPackagesBBox {
public:
StapipBagPackagesBBox(Vec4* t_vertices, u32* t_faces, const u32& t_facesCount,
StaPipBagPackagesBBox(Vec4* t_vertices, u32* t_faces, const u32& t_facesCount,
const u32& t_maxVertCount);
StapipBagPackagesBBox(Vec4* t_vertices, const u32& t_counts,
StaPipBagPackagesBBox(Vec4* t_vertices, const u32& t_counts,
const u32& t_maxVertCount);
~StapipBagPackagesBBox();
~StaPipBagPackagesBBox();
void setMaxVertCount(const u32& count);
@@ -25,16 +25,16 @@ namespace Tyra {
* Supports frustum culling, clipping, lighting,
* texture and single color / many colors.
*/
class StapipBag {
class StaPipBag {
public:
StapipBag();
~StapipBag();
StaPipBag();
~StaPipBag();
/** Mandatory. Object info. */
StapipInfoBag* info;
StaPipInfoBag* info;
/** Mandatory. Object color(s). */
StapipColorBag* color;
StaPipColorBag* color;
/** Mandatory. Vertex count. */
u32 count;
@@ -43,15 +43,15 @@ class StapipBag {
Vec4* vertices;
/** Optional. Texture coordinates and image. */
StapipTextureBag* texture;
StaPipTextureBag* texture;
/** Optional. Object lighting. */
StapipLightingBag* lighting;
StaPipLightingBag* lighting;
/**
* @param maxVertCount This parameter is available in renderer API.
*/
StapipBagPackagesBBox calculateBbox(const u32& maxVertCount);
StaPipBagPackagesBBox calculateBbox(const u32& maxVertCount);
void print() const;
void print(const char* name) const;
@@ -17,10 +17,10 @@ namespace Tyra {
/**
* @brief Color data. At least one color data is required (single/many).
*/
class StapipColorBag {
class StaPipColorBag {
public:
StapipColorBag();
~StapipColorBag();
StaPipColorBag();
~StaPipColorBag();
/** Optional. Single color for all vertices. */
Color* single;
@@ -17,15 +17,15 @@
namespace Tyra {
class StapipInfoBag {
class StaPipInfoBag {
public:
StapipInfoBag();
~StapipInfoBag();
StaPipInfoBag();
~StaPipInfoBag();
/** Mandatory. Model matrix */
M4x4* model;
StapipShadingType shadingType;
StaPipShadingType shadingType;
bool blendingEnabled;
bool antiAliasingEnabled;
bool noClipChecks;
@@ -16,12 +16,12 @@
namespace Tyra {
enum StapipLightingBagMode { Auto, Manual };
enum StaPipLightingBagMode { Auto, Manual };
class StapipLightingBag {
class StaPipLightingBag {
public:
explicit StapipLightingBag(const bool& manual = false);
~StapipLightingBag();
explicit StaPipLightingBag(const bool& manual = false);
~StaPipLightingBag();
Vec4* normals;
M4x4* lightMatrix;
@@ -47,7 +47,7 @@ class StapipLightingBag {
void deallocate();
void forceDeallocate();
u8 isAllocated;
StapipLightingBagMode mode;
StaPipLightingBagMode mode;
Vec4* lightColors;
Vec4* lightDirections;
@@ -15,10 +15,10 @@
namespace Tyra {
class StapipTextureBag {
class StaPipTextureBag {
public:
StapipTextureBag();
~StapipTextureBag();
StaPipTextureBag();
~StaPipTextureBag();
/** Mandatory. Texture coordinates per vertex. */
Vec4* coordinates;
@@ -16,15 +16,15 @@
namespace Tyra {
class StapipAsIsCVU1Program : public StapipVU1Program {
class StaPipAsIsCVU1Program : public StaPipVU1Program {
public:
StapipAsIsCVU1Program();
~StapipAsIsCVU1Program();
StaPipAsIsCVU1Program();
~StaPipAsIsCVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
StapipQBuffer* qbuffer) const;
StaPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -16,14 +16,14 @@
namespace Tyra {
class StapipAsIsDVU1Program : public StapipVU1Program {
class StaPipAsIsDVU1Program : public StaPipVU1Program {
public:
StapipAsIsDVU1Program();
~StapipAsIsDVU1Program();
StaPipAsIsDVU1Program();
~StaPipAsIsDVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
StapipQBuffer* qbuffer) const;
StaPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -16,14 +16,14 @@
namespace Tyra {
class StapipAsIsTCVU1Program : public StapipVU1Program {
class StaPipAsIsTCVU1Program : public StaPipVU1Program {
public:
StapipAsIsTCVU1Program();
~StapipAsIsTCVU1Program();
StaPipAsIsTCVU1Program();
~StaPipAsIsTCVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
StapipQBuffer* qbuffer) const;
StaPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -16,14 +16,14 @@
namespace Tyra {
class StapipAsIsTDVU1Program : public StapipVU1Program {
class StaPipAsIsTDVU1Program : public StaPipVU1Program {
public:
StapipAsIsTDVU1Program();
~StapipAsIsTDVU1Program();
StaPipAsIsTDVU1Program();
~StaPipAsIsTDVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
StapipQBuffer* qbuffer) const;
StaPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -16,14 +16,14 @@
namespace Tyra {
class StapipCullCVU1Program : public StapipVU1Program {
class StaPipCullCVU1Program : public StaPipVU1Program {
public:
StapipCullCVU1Program();
~StapipCullCVU1Program();
StaPipCullCVU1Program();
~StaPipCullCVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
StapipQBuffer* qbuffer) const;
StaPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -16,14 +16,14 @@
namespace Tyra {
class StapipCullDVU1Program : public StapipVU1Program {
class StaPipCullDVU1Program : public StaPipVU1Program {
public:
StapipCullDVU1Program();
~StapipCullDVU1Program();
StaPipCullDVU1Program();
~StaPipCullDVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
StapipQBuffer* qbuffer) const;
StaPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -16,14 +16,14 @@
namespace Tyra {
class StapipCullTCVU1Program : public StapipVU1Program {
class StaPipCullTCVU1Program : public StaPipVU1Program {
public:
StapipCullTCVU1Program();
~StapipCullTCVU1Program();
StaPipCullTCVU1Program();
~StaPipCullTCVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
StapipQBuffer* qbuffer) const;
StaPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -16,14 +16,14 @@
namespace Tyra {
class StapipCullTDVU1Program : public StapipVU1Program {
class StaPipCullTDVU1Program : public StaPipVU1Program {
public:
StapipCullTDVU1Program();
~StapipCullTDVU1Program();
StaPipCullTDVU1Program();
~StaPipCullTDVU1Program();
std::string getStringName() const;
void addProgramQBufferDataToPacket(packet2_t* packet,
StapipQBuffer* qbuffer) const;
StaPipQBuffer* qbuffer) const;
};
} // namespace Tyra
@@ -25,11 +25,11 @@ namespace Tyra {
* To be honest clipping algorithm should be moved to VU1 and "AsIs" VU1 program
* should be renamed to "Clip" - I don't want to do it now, too much time.
*/
class StapipClipper {
class StaPipClipper {
public:
StapipClipper();
~StapipClipper();
void clip(StapipQBuffer* buffer);
StaPipClipper();
~StaPipClipper();
void clip(StaPipQBuffer* buffer);
void init(const RendererSettings& settings);
void setMaxVertCount(const u32& count);
void setMVP(M4x4* mvp);
@@ -41,7 +41,7 @@ class StapipClipper {
void perspectiveDivide(std::vector<Path1ClipVertex>* vertices);
void moveDataToBuffer(const std::vector<Path1ClipVertex>& vertices,
StapipQBuffer* buffer);
StaPipQBuffer* buffer);
};
} // namespace Tyra
@@ -12,20 +12,20 @@
namespace Tyra {
enum StapipProgramName {
enum StaPipProgramName {
StdipUndefinedProgram,
StapipCullColor,
StapipAsIsColor,
StaPipCullColor,
StaPipAsIsColor,
StapipCullDirLights,
StapipAsIsDirLights,
StaPipCullDirLights,
StaPipAsIsDirLights,
StapipCullTextureDirLights,
StapipAsIsTextureDirLights,
StaPipCullTextureDirLights,
StaPipAsIsTextureDirLights,
StapipCullTextureColor,
StapipAsIsTextureColor,
StaPipCullTextureColor,
StaPipAsIsTextureColor,
};
} // namespace Tyra
@@ -12,11 +12,11 @@
namespace Tyra {
enum StapipProgramType {
StapipVU1Color,
StapipVU1DirLights,
StapipVU1TextureDirLights,
StapipVU1TextureColor,
enum StaPipProgramType {
StaPipVU1Color,
StaPipVU1DirLights,
StaPipVU1TextureDirLights,
StaPipVU1TextureColor,
};
} // namespace Tyra
@@ -27,22 +27,22 @@
namespace Tyra {
class StapipProgramsRepository {
class StaPipProgramsRepository {
public:
StapipProgramsRepository();
~StapipProgramsRepository();
StaPipProgramsRepository();
~StaPipProgramsRepository();
StapipVU1Program* getProgram(const StapipProgramName& name);
StaPipVU1Program* getProgram(const StaPipProgramName& name);
private:
StapipAsIsCVU1Program asIsColor;
StapipCullCVU1Program cullColor;
StapipAsIsDVU1Program asIsLightingColor;
StapipCullDVU1Program cullLightingColor;
StapipAsIsTDVU1Program asIsLightingTextureColor;
StapipCullTDVU1Program cullLightingTextureColor;
StapipAsIsTCVU1Program asIsTextureColor;
StapipCullTCVU1Program cullTextureColor;
StaPipAsIsCVU1Program asIsColor;
StaPipCullCVU1Program cullColor;
StaPipAsIsDVU1Program asIsLightingColor;
StaPipCullDVU1Program cullLightingColor;
StaPipAsIsTDVU1Program asIsLightingTextureColor;
StaPipCullTDVU1Program cullLightingTextureColor;
StaPipAsIsTCVU1Program asIsTextureColor;
StaPipCullTCVU1Program cullTextureColor;
VU1DrawFinish drawFinish;
};
@@ -18,10 +18,10 @@
namespace Tyra {
class StapipQBuffer {
class StaPipQBuffer {
public:
StapipQBuffer();
~StapipQBuffer();
StaPipQBuffer();
~StaPipQBuffer();
void setMaxVertCount(const u32& count);
@@ -29,27 +29,27 @@ class StapipQBuffer {
* @brief Dont allocate any dynamic data in buffer.
* Just copy pointers to input data.
*/
void fillByPointer(const StapipBagPackage& pkg);
void fillByPointer(const StaPipBagPackage& pkg);
/**
* @brief Allocate dynamic data in buffer
* And copy input data to it.
*/
void fillByCopyMax(const StapipBagPackage& pkg1, const StapipBagPackage& pkg2,
const StapipBagPackage& pkg3);
void fillByCopyMax(const StaPipBagPackage& pkg1, const StaPipBagPackage& pkg2,
const StaPipBagPackage& pkg3);
/**
* @brief Allocate dynamic data in buffer
* And copy input data to it.
*/
void fillByCopy1By2(const StapipBagPackage& pkg1,
const StapipBagPackage& pkg2);
void fillByCopy1By2(const StaPipBagPackage& pkg1,
const StaPipBagPackage& pkg2);
/**
* @brief Allocate dynamic data in buffer
* And copy input data to it.
*/
void fillByCopy1By3(const StapipBagPackage& pkg);
void fillByCopy1By3(const StaPipBagPackage& pkg);
/**
* @brief Deallocate dynamic data if it was allocated and allocate new data
@@ -60,7 +60,7 @@ class StapipQBuffer {
bool any() const;
StapipBag* bag;
StaPipBag* bag;
Vec4* vertices;
Vec4* sts;
@@ -76,7 +76,7 @@ class StapipQBuffer {
private:
u32 maxVertCount;
void deallocateDynamicData();
void allocateDynamicData(u16 size, StapipBag* bag);
void allocateDynamicData(u16 size, StaPipBag* bag);
u8 _isDynamicallyAllocated, _stAllocated, _colorAllocated, _normalAllocated;
};
@@ -28,10 +28,10 @@
namespace Tyra {
class StapipQBufferRenderer {
class StaPipQBufferRenderer {
public:
StapipQBufferRenderer();
~StapipQBufferRenderer();
StaPipQBufferRenderer();
~StaPipQBufferRenderer();
void init(RendererCore* t_core);
@@ -39,26 +39,26 @@ class StapipQBufferRenderer {
void setClipperMVP(M4x4* mvp) { clipper.setMVP(mvp); }
StapipQBuffer* getBuffer();
StaPipQBuffer* getBuffer();
void sendObjectData(StapipBag* bag, M4x4* mvp,
void sendObjectData(StaPipBag* bag, M4x4* mvp,
RendererCoreTextureBuffers* texBuffers) const;
void setMaxVertCount(const u32& count);
void setInfo(StapipInfoBag* bag);
void setInfo(StaPipInfoBag* bag);
/** Fast render with culling */
void cull(StapipQBuffer* buffer);
void cull(StaPipQBuffer* buffer);
/** Slower render with clipping */
void clip(StapipQBuffer* buffer);
void clip(StaPipQBuffer* buffer);
void clearLastProgramName();
StapipVU1Program* getCullProgramByBag(const StapipBag* bag);
StaPipVU1Program* getCullProgramByBag(const StaPipBag* bag);
StapipVU1Program* getCullProgramByParams(const bool& isLightingEnabled,
StaPipVU1Program* getCullProgramByParams(const bool& isLightingEnabled,
const bool& isTextureEnabled);
const u16& getBufferSize() { return bufferSize; }
@@ -69,27 +69,27 @@ class StapipQBufferRenderer {
void uploadPrograms();
void setDoubleBuffer();
StapipVU1Program* getProgramByName(const StapipProgramName& name);
void addBufferDataToPacket(StapipVU1Program* program, StapipQBuffer* buffer);
StaPipVU1Program* getProgramByName(const StaPipProgramName& name);
void addBufferDataToPacket(StaPipVU1Program* program, StaPipQBuffer* buffer);
void sendPacket();
StapipVU1Program* getAsIsProgramByBag(const StapipBag* bag);
StapipVU1Program* getCullProgramByType(const StapipProgramType& programType);
StapipProgramType getDrawProgramTypeByBag(const StapipBag* bag) const;
StapipProgramType getDrawProgramTypeByParams(
StaPipVU1Program* getAsIsProgramByBag(const StaPipBag* bag);
StaPipVU1Program* getCullProgramByType(const StaPipProgramType& programType);
StaPipProgramType getDrawProgramTypeByBag(const StaPipBag* bag) const;
StaPipProgramType getDrawProgramTypeByParams(
const bool& isLightingEnabled, const bool& isTextureEnabled) const;
packet2_t* packets[2];
packet2_t* programsPacket;
StapipQBuffer buffers[2];
StaPipQBuffer buffers[2];
packet2_t* currentPacket;
packet2_t* staticDataPacket;
packet2_t* objectDataPacket;
RendererCore* rendererCore;
StapipProgramName lastProgramName;
StaPipProgramName lastProgramName;
Path1* path1;
StapipClipper clipper;
StapipProgramsRepository repository;
StaPipClipper clipper;
StaPipProgramsRepository repository;
u16 bufferSize;
u8 context;
@@ -17,33 +17,33 @@
namespace Tyra {
class StapipVU1Program : public VU1Program {
class StaPipVU1Program : public VU1Program {
public:
StapipVU1Program(const StapipProgramName& name, u32* start, u32* end,
StaPipVU1Program(const StaPipProgramName& name, u32* start, u32* end,
const u32& t_reglist, const u8& t_reglistCount,
const u8& t_elementsPerVertex);
~StapipVU1Program();
~StaPipVU1Program();
u32& getReglist();
const StapipProgramName& getName() const;
const StaPipProgramName& getName() const;
u16 getMaxVertCount(const bool& singleColorEnabled,
const u16& vu1DBufferSize) const;
void addBufferDataToPacket(packet2_t* packet, StapipQBuffer* buffer,
void addBufferDataToPacket(packet2_t* packet, StaPipQBuffer* buffer,
prim_t* prim);
protected:
StapipProgramName name;
StaPipProgramName name;
u8 reglistCount, elementsPerVertex;
u32 destinationAddress, reglist;
virtual void addProgramQBufferDataToPacket(packet2_t* packet,
StapipQBuffer* qbuffer) const = 0;
StaPipQBuffer* qbuffer) const = 0;
private:
void addStandardBufferDataToPacket(packet2_t* packet, StapipQBuffer* buffer,
void addStandardBufferDataToPacket(packet2_t* packet, StaPipQBuffer* buffer,
prim_t* prim);
};
@@ -19,15 +19,15 @@
namespace Tyra {
class StapipelineCore {
class StaPipelineCore {
public:
StapipelineCore();
~StapipelineCore();
StaPipelineCore();
~StaPipelineCore();
void init(RendererCore* t_core);
/** Render 3D data via "bags" */
void render(StapipBag* data, StapipBagPackagesBBox* bbox = nullptr);
void render(StaPipBag* data, StaPipBagPackagesBBox* bbox = nullptr);
/** Get max vert count of VU1 qbuffer (for optimizations) */
u32 getMaxVertCountByParams(const bool& isSingleColor,
@@ -35,7 +35,7 @@ class StapipelineCore {
const bool& isTextureEnabled);
/** Get max vert count of VU1 qbuffer (for optimizations) */
u32 getMaxVertCountByBag(const StapipBag* bag);
u32 getMaxVertCountByBag(const StaPipBag* bag);
/**
* - Uploads standard VU1 programs.
@@ -50,10 +50,10 @@ class StapipelineCore {
RendererCore* rendererCore;
void setMaxVertCount(const u32& count);
StapipBagPackager packager;
StapipQBufferRenderer qbufferRenderer;
void renderPkgs(StapipBagPackage* packages, u16 count);
void renderSubpkgs(StapipBagPackage* packages, u16 count);
StaPipBagPackager packager;
StaPipQBufferRenderer qbufferRenderer;
void renderPkgs(StaPipBagPackage* packages, u16 count);
void renderSubpkgs(StaPipBagPackage* packages, u16 count);
};
} // namespace Tyra
@@ -15,10 +15,10 @@
namespace Tyra {
class StapipLightingOptions {
class StaPipLightingOptions {
public:
StapipLightingOptions() {}
~StapipLightingOptions() {}
StaPipLightingOptions() {}
~StaPipLightingOptions() {}
/**
* Mandatory.
@@ -15,18 +15,18 @@
namespace Tyra {
class StapipOptions {
class StaPipOptions {
public:
StapipOptions() {}
~StapipOptions() {}
StaPipOptions() {}
~StaPipOptions() {}
StapipShadingType shadingType;
StaPipShadingType shadingType;
bool blendingEnabled;
bool antiAliasingEnabled;
bool noClipChecks;
/** Optional */
StapipLightingOptions* lighting;
StaPipLightingOptions* lighting;
};
} // namespace Tyra
@@ -12,9 +12,9 @@
namespace Tyra {
enum StapipShadingType {
StapipShadingFlat,
StapipShadingGouraud,
enum StaPipShadingType {
StaPipShadingFlat,
StaPipShadingGouraud,
};
} // namespace Tyra
@@ -19,10 +19,10 @@
namespace Tyra {
class Stapipeline : public Renderer3DPipeline {
class StaticPipeline : public Renderer3DPipeline {
public:
Stapipeline();
~Stapipeline();
StaticPipeline();
~StaticPipeline();
void init(RendererCore* core);
@@ -30,30 +30,30 @@ class Stapipeline : public Renderer3DPipeline {
/**
* Render 3D data via "meshes".
* This render() method is a bridge to core.renderer3D.render() method.
* This render() method is a bridge to core.render() method.
*/
void render(DynamicMesh* mesh, const StapipOptions* options = nullptr);
void render(DynamicMesh* mesh, const StaPipOptions* options = nullptr);
private:
StapipelineCore core;
StaPipelineCore core;
RendererCore* rendererCore;
Vec4* colorsCache;
void addVertices(DynamicMesh* mesh, MeshMaterial* material, StapipBag* bag,
void addVertices(DynamicMesh* mesh, MeshMaterial* material, StaPipBag* bag,
MeshFrame* frameFrom, MeshFrame* frameTo) const;
StapipInfoBag* getInfoBag(DynamicMesh* mesh, const StapipOptions* options,
StaPipInfoBag* getInfoBag(DynamicMesh* mesh, const StaPipOptions* options,
M4x4* model) const;
StapipColorBag* getColorBag(DynamicMesh* mesh, MeshMaterial* material,
StaPipColorBag* getColorBag(DynamicMesh* mesh, MeshMaterial* material,
MeshFrame* frameFrom, MeshFrame* frameTo) const;
StapipTextureBag* getTextureBag(DynamicMesh* mesh, MeshMaterial* material,
StaPipTextureBag* getTextureBag(DynamicMesh* mesh, MeshMaterial* material,
MeshFrame* frameFrom, MeshFrame* frameTo);
StapipLightingBag* getLightingBag(DynamicMesh* mesh, MeshMaterial* material,
StaPipLightingBag* getLightingBag(DynamicMesh* mesh, MeshMaterial* material,
M4x4* model, MeshFrame* frameFrom,
MeshFrame* frameTo,
const StapipOptions* options) const;
void deallocDrawBags(StapipBag* bag, MeshMaterial* material) const;
const StaPipOptions* options) const;
void deallocDrawBags(StaPipBag* bag, MeshMaterial* material) const;
void setLightingColorsCache(StapipLightingOptions* lightingOptions);
void setLightingColorsCache(StaPipLightingOptions* lightingOptions);
};
} // namespace Tyra