diff --git a/engine/inc/renderer/3d/pipeline/dynamic/core/dynpip_core.hpp b/engine/inc/renderer/3d/pipeline/dynamic/core/dynpip_core.hpp index 3159f54..4e60735 100644 --- a/engine/inc/renderer/3d/pipeline/dynamic/core/dynpip_core.hpp +++ b/engine/inc/renderer/3d/pipeline/dynamic/core/dynpip_core.hpp @@ -32,7 +32,7 @@ class DynPipCore { * - Sets double buffers exactly for "Tyra Renderer3D" * Should be called if VU1 was used by your non standard programs. */ - void reinitStandardVU1Programs(); + void reinitVU1Programs(); private: RendererCore* rendererCore; diff --git a/engine/inc/renderer/3d/pipeline/shared/bag/pipeline_info_bag.hpp b/engine/inc/renderer/3d/pipeline/shared/bag/pipeline_info_bag.hpp index a9a99bd..6a1f473 100644 --- a/engine/inc/renderer/3d/pipeline/shared/bag/pipeline_info_bag.hpp +++ b/engine/inc/renderer/3d/pipeline/shared/bag/pipeline_info_bag.hpp @@ -28,7 +28,16 @@ class PipelineInfoBag { PipelineShadingType shadingType; bool blendingEnabled; bool antiAliasingEnabled; - bool noClipChecks; + + /** + * @brief True -> disables "clip against each plane" algorithm. + * Mandatory, default: false. + * + * Full clip checks are slow, but they are + * preventing visual artifacts, which can happen + * for big 3D objects (or objects near camera eyes) + */ + bool noFullClipChecks; }; } // namespace Tyra diff --git a/engine/inc/renderer/3d/pipeline/static/core/stapip_core.hpp b/engine/inc/renderer/3d/pipeline/static/core/stapip_core.hpp index 02dea03..2a7e4e9 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/stapip_core.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/stapip_core.hpp @@ -43,7 +43,7 @@ class StaPipCore { * - Sets double buffers exactly for "Tyra Renderer3D" * Should be called if VU1 was used by your non standard programs. */ - void reinitStandardVU1Programs(); + void reinitVU1Programs(); private: u32 maxVertCount; diff --git a/engine/inc/renderer/3d/pipeline/static/stapip_options.hpp b/engine/inc/renderer/3d/pipeline/static/stapip_options.hpp index ccad0be..756389f 100644 --- a/engine/inc/renderer/3d/pipeline/static/stapip_options.hpp +++ b/engine/inc/renderer/3d/pipeline/static/stapip_options.hpp @@ -23,7 +23,16 @@ class StaPipOptions { PipelineShadingType shadingType; bool blendingEnabled; bool antiAliasingEnabled; - bool noClipChecks; + + /** + * @brief True -> disables "clip against each plane" algorithm. + * Mandatory, default: false. + * + * Full clip checks are slow, but they are + * preventing visual artifacts, which can happen + * for big 3D objects (or objects near camera eyes) + */ + bool noFullClipChecks; /** Optional */ StaPipLightingOptions* lighting; diff --git a/engine/src/renderer/3d/pipeline/dynamic/core/dynpip_core.cpp b/engine/src/renderer/3d/pipeline/dynamic/core/dynpip_core.cpp index 2ae3adc..c358534 100644 --- a/engine/src/renderer/3d/pipeline/dynamic/core/dynpip_core.cpp +++ b/engine/src/renderer/3d/pipeline/dynamic/core/dynpip_core.cpp @@ -20,7 +20,7 @@ DynPipCore::~DynPipCore() {} void DynPipCore::init(RendererCore* t_core) { rendererCore = t_core; } -void DynPipCore::reinitStandardVU1Programs() {} +void DynPipCore::reinitVU1Programs() {} void DynPipCore::render(DynPipBag* bag) {} diff --git a/engine/src/renderer/3d/pipeline/static/core/stapip_core.cpp b/engine/src/renderer/3d/pipeline/static/core/stapip_core.cpp index cd84602..9a3a19f 100644 --- a/engine/src/renderer/3d/pipeline/static/core/stapip_core.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/stapip_core.cpp @@ -32,7 +32,7 @@ void StaPipCore::init(RendererCore* t_core) { packager.init(&rendererCore->renderer3D.frustumPlanes); } -void StaPipCore::reinitStandardVU1Programs() { qbufferRenderer.reinitVU1(); } +void StaPipCore::reinitVU1Programs() { qbufferRenderer.reinitVU1(); } u32 StaPipCore::getMaxVertCountByBag(const StaPipBag* bag) { return qbufferRenderer.getCullProgramByBag(bag)->getMaxVertCount( @@ -106,7 +106,7 @@ void StaPipCore::render(StaPipBag* bag, StaPipBagPackagesBBox* bbox) { qbufferRenderer.setInfo(bag->info); if (frustumCheck == IN_FRUSTUM || - (frustumCheck == PARTIALLY_IN_FRUSTUM && bag->info->noClipChecks)) { + (frustumCheck == PARTIALLY_IN_FRUSTUM && bag->info->noFullClipChecks)) { u16 packagesCount = 0; auto biggerPkgs = packager.create(&packagesCount, bag, maxVertCount); Verbose("Material - in frustum. Pkgs: ", packagesCount, diff --git a/engine/src/renderer/3d/pipeline/static/static_pipeline.cpp b/engine/src/renderer/3d/pipeline/static/static_pipeline.cpp index 7f4bf1d..b568764 100644 --- a/engine/src/renderer/3d/pipeline/static/static_pipeline.cpp +++ b/engine/src/renderer/3d/pipeline/static/static_pipeline.cpp @@ -21,7 +21,7 @@ void StaticPipeline::init(RendererCore* t_core) { core.init(t_core); } -void StaticPipeline::onUse() { core.reinitStandardVU1Programs(); } +void StaticPipeline::onUse() { core.reinitVU1Programs(); } void StaticPipeline::render(DynamicMesh* mesh, const StaPipOptions* options) { auto model = mesh->getModelMatrix(); @@ -92,12 +92,12 @@ PipelineInfoBag* StaticPipeline::getInfoBag(DynamicMesh* mesh, result->antiAliasingEnabled = options->antiAliasingEnabled; result->blendingEnabled = options->blendingEnabled; result->shadingType = options->shadingType; - result->noClipChecks = options->noClipChecks; + result->noFullClipChecks = options->noFullClipChecks; } else { result->antiAliasingEnabled = false; result->blendingEnabled = true; result->shadingType = StaPipShadingFlat; - result->noClipChecks = true; + result->noFullClipChecks = false; } result->model = model;