dynamic pipeline - render
This commit is contained in:
@@ -22,13 +22,8 @@ class DynPipColorBag {
|
||||
DynPipColorBag();
|
||||
~DynPipColorBag();
|
||||
|
||||
/** Optional. Single color for all vertices. */
|
||||
Color* singleFrom;
|
||||
Color* singleTo;
|
||||
|
||||
/** Optional. Color per vertex. */
|
||||
Color* manyFrom;
|
||||
Color* manyTo;
|
||||
/** Mandatory */
|
||||
Color* single;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -29,6 +29,8 @@ class DynPipLightingBag {
|
||||
|
||||
/** Mandatory. Directional lights */
|
||||
PipelineDirLightsBag* dirLights;
|
||||
|
||||
void freeNormals();
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -26,6 +26,8 @@ class DynPipTextureBag {
|
||||
|
||||
/** Mandatory. Texture image. */
|
||||
Texture* texture;
|
||||
|
||||
void freeCoords();
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include <tamtypes.h>
|
||||
#include "./bag/dynpip_bag.hpp"
|
||||
#include "renderer/core/renderer_core.hpp"
|
||||
#include "./dynpip_programs_repository.hpp"
|
||||
#include "./dynpip_qbuffer_renderer.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
@@ -21,11 +23,18 @@ class DynPipCore {
|
||||
DynPipCore();
|
||||
~DynPipCore();
|
||||
|
||||
DynPipProgramsRepository repository;
|
||||
|
||||
void init(RendererCore* t_core);
|
||||
|
||||
/** Render 3D via "bags" */
|
||||
void render(DynPipBag* data);
|
||||
|
||||
/** Get max vert count of VU1 qbuffer (for optimizations) */
|
||||
u32 getMaxVertCountByParams(const bool& isSingleColor,
|
||||
const bool& isLightingEnabled,
|
||||
const bool& isTextureEnabled);
|
||||
|
||||
/**
|
||||
* - Uploads standard VU1 programs.
|
||||
* - Sends static "Tyra Renderer3D" VU1 data.
|
||||
@@ -36,6 +45,7 @@ class DynPipCore {
|
||||
|
||||
private:
|
||||
RendererCore* rendererCore;
|
||||
DynPipQBufferRenderer qbufferRenderer;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "debug/debug.hpp"
|
||||
#include "renderer/core/paths/path1/vu1_program.hpp"
|
||||
#include "./bag/dynpip_bag.hpp"
|
||||
|
||||
#include "./programs/dynpip_c_vu1_program.hpp"
|
||||
#include "./programs/dynpip_d_vu1_program.hpp"
|
||||
@@ -26,6 +27,9 @@ class DynPipProgramsRepository {
|
||||
~DynPipProgramsRepository();
|
||||
|
||||
DynPipVU1Program* getProgram(const DynPipProgramName& name);
|
||||
DynPipVU1Program* getProgramByParams(const bool& isLightingEnabled,
|
||||
const bool& isTextureEnabled);
|
||||
DynPipVU1Program* getProgramByBag(const DynPipBag* bag);
|
||||
|
||||
private:
|
||||
DynPipCVU1Program color;
|
||||
|
||||
@@ -29,9 +29,6 @@ class DynPipQBuffer {
|
||||
Vec4* stsFrom;
|
||||
Vec4* stsTo;
|
||||
|
||||
Vec4* colorsFrom;
|
||||
Vec4* colorsTo;
|
||||
|
||||
Vec4* normalsFrom;
|
||||
Vec4* normalsTo;
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# 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>
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class DynPipQBufferRenderer {
|
||||
public:
|
||||
DynPipQBufferRenderer();
|
||||
~DynPipQBufferRenderer();
|
||||
|
||||
// void init(RendererCore* t_core);
|
||||
|
||||
// void reinitVU1();
|
||||
|
||||
// DynPipQBuffer* getBuffer();
|
||||
|
||||
// void sendObjectData(DynPipBag* bag, M4x4* mvp,
|
||||
// RendererCoreTextureBuffers* texBuffers) const;
|
||||
|
||||
// void setMaxVertCount(const u32& count);
|
||||
|
||||
// void setInfo(PipelineInfoBag* bag);
|
||||
|
||||
// void render(DynPipQBuffer* buffer);
|
||||
|
||||
// void clearLastProgramName();
|
||||
|
||||
const u16& getBufferSize() { return bufferSize; }
|
||||
|
||||
private:
|
||||
// void sendStaticData() const;
|
||||
// void setProgramsCache();
|
||||
// void uploadPrograms();
|
||||
// void setDoubleBuffer();
|
||||
|
||||
// void addBufferDataToPacket(DynPipVU1Program* program, DynPipQBuffer*
|
||||
// buffer); void sendPacket();
|
||||
|
||||
// packet2_t* packets[2];
|
||||
// packet2_t* programsPacket;
|
||||
// DynPipQBuffer buffers[2];
|
||||
// packet2_t* currentPacket;
|
||||
// packet2_t* staticDataPacket;
|
||||
// packet2_t* objectDataPacket;
|
||||
|
||||
// RendererCore* rendererCore;
|
||||
|
||||
// DynPipProgramName lastProgramName;
|
||||
// Path1* path1;
|
||||
// DynPipClipper clipper;
|
||||
// DynPipProgramsRepository repository;
|
||||
|
||||
u16 bufferSize;
|
||||
// u8 context;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
@@ -41,20 +41,27 @@ class DynamicPipeline : public Renderer3DPipeline {
|
||||
Vec4* colorsCache;
|
||||
|
||||
void addVertices(DynamicMesh* mesh, MeshMaterial* material, DynPipBag* bag,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo) const;
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo,
|
||||
const u32& startIndex) const;
|
||||
PipelineInfoBag* getInfoBag(DynamicMesh* mesh, const DynPipOptions* options,
|
||||
M4x4* model) const;
|
||||
DynPipColorBag* getColorBag(DynamicMesh* mesh, MeshMaterial* material,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo) const;
|
||||
DynPipColorBag* getColorBag(MeshMaterial* material) const;
|
||||
DynPipTextureBag* getTextureBag(DynamicMesh* mesh, MeshMaterial* material,
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo);
|
||||
MeshFrame* frameFrom, MeshFrame* frameTo,
|
||||
const u32& count, const u32& startIndex);
|
||||
DynPipLightingBag* getLightingBag(DynamicMesh* mesh, MeshMaterial* material,
|
||||
M4x4* model, MeshFrame* frameFrom,
|
||||
MeshFrame* frameTo,
|
||||
const DynPipOptions* options) const;
|
||||
void deallocDrawBags(DynPipBag* bag, MeshMaterial* material) const;
|
||||
const DynPipOptions* options,
|
||||
PipelineDirLightsBag* dirLightsBag,
|
||||
const u32& count,
|
||||
const u32& startIndex) const;
|
||||
|
||||
void setLightingColorsCache(PipelineLightingOptions* lightingOptions);
|
||||
void freeBuffer(DynPipBag* bag);
|
||||
void setBuffersDefaultVars(DynPipBag* buffers, DynamicMesh* mesh,
|
||||
PipelineInfoBag* infoBag);
|
||||
void setBuffersColorBag(DynPipBag* buffers, DynPipColorBag* colorBag);
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -10,22 +10,14 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "renderer/3d/pipeline/shared/pipeline_shading_type.hpp"
|
||||
#include "../shared/pipeline_lighting_options.hpp"
|
||||
#include "renderer/3d/pipeline/shared/pipeline_options.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class DynPipOptions {
|
||||
class DynPipOptions : public PipelineOptions {
|
||||
public:
|
||||
DynPipOptions() {}
|
||||
~DynPipOptions() {}
|
||||
|
||||
PipelineShadingType shadingType;
|
||||
bool blendingEnabled;
|
||||
bool antiAliasingEnabled;
|
||||
|
||||
/** Optional */
|
||||
PipelineLightingOptions* lighting;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
# ______ ____ ___
|
||||
# | \/ ____| |___|
|
||||
# | | | \ | |
|
||||
#-----------------------------------------------------------------------
|
||||
# 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/pipeline_shading_type.hpp"
|
||||
#include "../shared/pipeline_lighting_options.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class PipelineOptions {
|
||||
public:
|
||||
PipelineOptions() {}
|
||||
~PipelineOptions() {}
|
||||
|
||||
PipelineShadingType shadingType;
|
||||
bool blendingEnabled;
|
||||
bool antiAliasingEnabled;
|
||||
|
||||
/** Optional */
|
||||
PipelineLightingOptions* lighting;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
@@ -10,20 +10,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "renderer/3d/pipeline/shared/pipeline_shading_type.hpp"
|
||||
#include "../shared/pipeline_lighting_options.hpp"
|
||||
#include "renderer/3d/pipeline/shared/pipeline_options.hpp"
|
||||
|
||||
namespace Tyra {
|
||||
|
||||
class StaPipOptions {
|
||||
class StaPipOptions : public PipelineOptions {
|
||||
public:
|
||||
StaPipOptions() {}
|
||||
~StaPipOptions() {}
|
||||
|
||||
PipelineShadingType shadingType;
|
||||
bool blendingEnabled;
|
||||
bool antiAliasingEnabled;
|
||||
|
||||
/**
|
||||
* @brief True -> disables "clip against each plane" algorithm.
|
||||
* Mandatory, default: false.
|
||||
@@ -33,9 +28,6 @@ class StaPipOptions {
|
||||
* for big 3D objects (or objects near camera eyes)
|
||||
*/
|
||||
bool noFullClipChecks;
|
||||
|
||||
/** Optional */
|
||||
PipelineLightingOptions* lighting;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
Reference in New Issue
Block a user