ztest option
This commit is contained in:
@@ -73,7 +73,7 @@ u32 StaPipCore::getMaxVertCountByParams(const bool& isSingleColor,
|
||||
}
|
||||
|
||||
void StaPipCore::render(StaPipBag* bag, const bool& frustumCull,
|
||||
StaPipBagPackagesBBox* bbox) {
|
||||
const StaPipZTest& zTest, StaPipBagPackagesBBox* bbox) {
|
||||
if (bag->count <= 0) return;
|
||||
|
||||
TYRA_ASSERT(bag->vertices != nullptr,
|
||||
@@ -128,6 +128,10 @@ void StaPipCore::render(StaPipBag* bag, const bool& frustumCull,
|
||||
}
|
||||
}
|
||||
|
||||
if (zTest == StaPipZTest_AllPass) {
|
||||
rendererCore->gs.setAllPassZTest();
|
||||
}
|
||||
|
||||
packager.setRenderBBox(renderBbox);
|
||||
|
||||
M4x4 mvp;
|
||||
@@ -204,6 +208,10 @@ void StaPipCore::render(StaPipBag* bag, const bool& frustumCull,
|
||||
|
||||
qbufferRenderer.flushBuffers();
|
||||
|
||||
if (zTest == StaPipZTest_AllPass) {
|
||||
rendererCore->gs.setStandardZTest();
|
||||
}
|
||||
|
||||
Verbose("Render finished");
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ void StaticPipeline::render(StaticMesh* mesh, const StaPipOptions* options) {
|
||||
auto model = mesh->getModelMatrix();
|
||||
auto* infoBag = getInfoBag(mesh, options, &model);
|
||||
|
||||
auto zTesting = options ? options->zTestType : StaPipZTest_Standard;
|
||||
auto frustumCulling =
|
||||
options ? options->frustumCulling : PipelineFrustumCulling_Simple;
|
||||
|
||||
@@ -75,7 +76,8 @@ void StaticPipeline::render(StaticMesh* mesh, const StaPipOptions* options) {
|
||||
bag.texture = getTextureBag(material, materialFrame);
|
||||
bag.lighting = getLightingBag(materialFrame, &model, options);
|
||||
|
||||
core.render(&bag, frustumCulling == PipelineFrustumCulling_Precise);
|
||||
core.render(&bag, frustumCulling == PipelineFrustumCulling_Precise,
|
||||
zTesting);
|
||||
|
||||
deallocDrawBags(&bag, material);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user