small documentation

This commit is contained in:
h4570
2022-07-23 21:05:20 +02:00
parent 91ba265310
commit 91e425e0f8
5 changed files with 33 additions and 9 deletions
+2 -4
View File
@@ -1,18 +1,16 @@
------------ Tyra's v2.0 roadmap to publish on GitHub ------------ ------------ Tyra's v2.0 roadmap to publish on GitHub ------------
--- H4570 --- H4570
- [DynPip] TD VU1 program
- [DynPip] Info about: simple clip
- [StaPip] Remove animation - [StaPip] Remove animation
- [StaPip] Dbufferring during mesh unrolling - [StaPip] Dbufferring during mesh unrolling
- [StaPip] VU1 packets spamming - [StaPip] VU1 packets spamming
- [McPip] VU1 packets spamming - [McPip] VU1 packets spamming
- [StaPip] Info about: full plane clip - [Loaders] MD2 loader - choose between static/dynamic mesh
- [Renderer] Github: Allocate dynamic pipeline memory only in "onUse" (core,qbuffrenderer,pipeline..) - [Renderer] Github: Allocate dynamic pipeline memory only in "onUse" (core,qbuffrenderer,pipeline..)
- [Game] Update intellisense from docker
- [Renderer] Add possibility to on/off frustum check in all pipelines (renderOptions?) - [Renderer] Add possibility to on/off frustum check in all pipelines (renderOptions?)
- [Loaders] Think about ".tyrobj" format - implement it (add multicolor support) - [Loaders] Think about ".tyrobj" format - implement it (add multicolor support)
- [Loaders] DFF loader as static Mesh loader - [Loaders] DFF loader as static Mesh loader
- [Game] Update intellisense from docker
- [Texture] Test cache hits with large amount of textures (dolphin sample?) - [Texture] Test cache hits with large amount of textures (dolphin sample?)
- [Demo] Create cool demo which will show all features of Tyra (I will take this one) - [Demo] Create cool demo which will show all features of Tyra (I will take this one)
@@ -19,6 +19,12 @@
namespace Tyra { namespace Tyra {
/**
* Pipeline for animated models (DynamicMesh).
* Supports:
* - Simple PS2 clipping (culling)
* - Modes: color, texture+color, dir lights, texture + dir lights
*/
class DynamicPipeline : public Renderer3DPipeline { class DynamicPipeline : public Renderer3DPipeline {
public: public:
DynamicPipeline(); DynamicPipeline();
@@ -33,7 +39,7 @@ class DynamicPipeline : public Renderer3DPipeline {
void onUse(); void onUse();
/** /**
* Render 3D via "meshes". * Render dynamic model.
* This render() method is a bridge to core.render() method. * This render() method is a bridge to core.render() method.
*/ */
void render(DynamicMesh* mesh, const DynPipOptions* options = nullptr); void render(DynamicMesh* mesh, const DynPipOptions* options = nullptr);
@@ -18,6 +18,10 @@
namespace Tyra { namespace Tyra {
/**
* Pipeline specialized in fast rendering of voxels
* Supports full "against each plane" clipping
*/
class MinecraftPipeline : public Renderer3DPipeline { class MinecraftPipeline : public Renderer3DPipeline {
public: public:
MinecraftPipeline(); MinecraftPipeline();
@@ -27,8 +31,18 @@ class MinecraftPipeline : public Renderer3DPipeline {
void onUse(); void onUse();
/**
* @brief Render voxels
*
* @param blocks blocks to render
* @param count number of blocks to render
* @param t_tex texture to use
* @param isMulti is this a 6 texture voxel?
* @param noFullClipChecks true = faster, simple PS2 clipping. False = slower
* "against each plane" clipping.
*/
void render(McpipBlock* blocks, const u32& count, Texture* t_tex, void render(McpipBlock* blocks, const u32& count, Texture* t_tex,
const bool& isMulti = false, const bool& noClipChecks = true); const bool& isMulti = false, const bool& noFullClipChecks = true);
inline const float& getTextureOffset() const { inline const float& getTextureOffset() const {
return manager.getTextureOffset(); return manager.getTextureOffset();
@@ -20,6 +20,12 @@
namespace Tyra { namespace Tyra {
/**
* Pipeline for static models (StaticMesh).
* Supports:
* - Full "against each plane" clipping,
* - Modes: color(s), texture+color(s), dir lights, texture + dir lights
*/
class StaticPipeline : public Renderer3DPipeline { class StaticPipeline : public Renderer3DPipeline {
public: public:
StaticPipeline(); StaticPipeline();
@@ -32,7 +38,7 @@ class StaticPipeline : public Renderer3DPipeline {
void onUse(); void onUse();
/** /**
* Render 3D via "meshes". * Render static model
* This render() method is a bridge to core.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);
@@ -42,14 +42,14 @@ void MinecraftPipeline::initBBox() {
void MinecraftPipeline::render(McpipBlock* blocks, const u32& count, void MinecraftPipeline::render(McpipBlock* blocks, const u32& count,
Texture* t_tex, const bool& isMulti, Texture* t_tex, const bool& isMulti,
const bool& noClipChecks) { const bool& noFullClipChecks) {
auto texBuffers = rendererCore->texture.useTexture(t_tex); auto texBuffers = rendererCore->texture.useTexture(t_tex);
rendererCore->gs.prim.mapping = 1; rendererCore->gs.prim.mapping = 1;
manager.clearLastProgram(); manager.clearLastProgram();
std::vector<u32> cullIndexes; std::vector<u32> cullIndexes;
if (noClipChecks) { if (noFullClipChecks) {
for (u32 i = 0; i < count; i++) cullIndexes.push_back(i); for (u32 i = 0; i < count; i++) cullIndexes.push_back(i);
cull(blocks, cullIndexes, &texBuffers, isMulti); cull(blocks, cullIndexes, &texBuffers, isMulti);
} else { } else {