demo map and weapon
This commit is contained in:
@@ -41,8 +41,8 @@ void DynPipCore::setPrim() {
|
||||
void DynPipCore::setLod() {
|
||||
lod.calculation = LOD_USE_K;
|
||||
lod.max_level = 0;
|
||||
lod.mag_filter = LOD_MAG_NEAREST;
|
||||
lod.min_filter = LOD_MIN_NEAREST;
|
||||
lod.mag_filter = LOD_MAG_LINEAR;
|
||||
lod.min_filter = LOD_MIN_LINEAR;
|
||||
lod.mipmap_select = LOD_MIPMAP_REGISTER;
|
||||
lod.l = 0;
|
||||
lod.k = 0.0F;
|
||||
@@ -70,6 +70,20 @@ void DynPipCore::initParts(DynPipBag* bag) {
|
||||
delete texBuffers;
|
||||
}
|
||||
|
||||
void DynPipCore::updatePrimLod(PipelineInfoBag* bag) {
|
||||
prim.antialiasing = bag->antiAliasingEnabled;
|
||||
prim.blending = bag->blendingEnabled;
|
||||
prim.shading = bag->shadingType;
|
||||
|
||||
if (bag->textureMappingType == TyraLinear) {
|
||||
lod.mag_filter = LOD_MAG_LINEAR;
|
||||
lod.min_filter = LOD_MIN_LINEAR;
|
||||
} else {
|
||||
lod.mag_filter = LOD_MAG_NEAREST;
|
||||
lod.min_filter = LOD_MIN_NEAREST;
|
||||
}
|
||||
}
|
||||
|
||||
void DynPipCore::renderPart(DynPipBag** bags, const u32& count,
|
||||
const bool& frustumCull) {
|
||||
if (count <= 0) return;
|
||||
|
||||
@@ -75,6 +75,7 @@ void DynamicPipeline::render(DynamicMesh* mesh, const DynPipOptions* options) {
|
||||
|
||||
setBuffersDefaultVars(buffers, mesh, infoBag);
|
||||
core.clear();
|
||||
core.updatePrimLod(infoBag);
|
||||
|
||||
for (u32 i = 0; i < mesh->getMaterialsCount(); i++) {
|
||||
auto* material = mesh->getMaterial(i);
|
||||
@@ -210,10 +211,12 @@ PipelineInfoBag* DynamicPipeline::getInfoBag(DynamicMesh* mesh,
|
||||
result->antiAliasingEnabled = options->antiAliasingEnabled;
|
||||
result->blendingEnabled = options->blendingEnabled;
|
||||
result->shadingType = options->shadingType;
|
||||
result->textureMappingType = options->textureMappingType;
|
||||
} else {
|
||||
result->antiAliasingEnabled = false;
|
||||
result->blendingEnabled = true;
|
||||
result->shadingType = TyraShadingFlat;
|
||||
result->textureMappingType = TyraLinear;
|
||||
}
|
||||
|
||||
result->model = model;
|
||||
@@ -243,8 +246,9 @@ DynPipTextureBag* DynamicPipeline::getTextureBag(
|
||||
|
||||
result->texture =
|
||||
rendererCore->texture.repository.getBySpriteOrMesh(material->getId());
|
||||
TYRA_ASSERT(result->texture, "Texture for material id: ", material->getId(),
|
||||
"was not found in texture repository!");
|
||||
TYRA_ASSERT(
|
||||
result->texture, "Texture for material id: ", material->getId(),
|
||||
"was not found in texture repository! Did you forget to add texture?");
|
||||
|
||||
result->coordinatesFrom = &materialFrameFrom->getTextureCoords()[startIndex];
|
||||
result->coordinatesTo = &materialFrameTo->getTextureCoords()[startIndex];
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Tyra {
|
||||
|
||||
PipelineInfoBag::PipelineInfoBag() {
|
||||
shadingType = TyraShadingFlat;
|
||||
textureMappingType = TyraLinear;
|
||||
blendingEnabled = true;
|
||||
antiAliasingEnabled = false;
|
||||
model = nullptr;
|
||||
|
||||
@@ -50,8 +50,8 @@ void StaPipCore::setPrim() {
|
||||
void StaPipCore::setLod() {
|
||||
lod.calculation = LOD_USE_K;
|
||||
lod.max_level = 0;
|
||||
lod.mag_filter = LOD_MAG_NEAREST;
|
||||
lod.min_filter = LOD_MIN_NEAREST;
|
||||
lod.mag_filter = LOD_MAG_LINEAR;
|
||||
lod.min_filter = LOD_MIN_LINEAR;
|
||||
lod.mipmap_select = LOD_MIPMAP_REGISTER;
|
||||
lod.l = 0;
|
||||
lod.k = 0.0F;
|
||||
|
||||
@@ -159,6 +159,14 @@ void StaPipQBufferRenderer::setInfo(PipelineInfoBag* bag) {
|
||||
prim->antialiasing = bag->antiAliasingEnabled;
|
||||
prim->blending = bag->blendingEnabled;
|
||||
prim->shading = bag->shadingType;
|
||||
|
||||
if (bag->textureMappingType == TyraLinear) {
|
||||
lod->mag_filter = LOD_MAG_LINEAR;
|
||||
lod->min_filter = LOD_MIN_LINEAR;
|
||||
} else {
|
||||
lod->mag_filter = LOD_MAG_NEAREST;
|
||||
lod->min_filter = LOD_MIN_NEAREST;
|
||||
}
|
||||
}
|
||||
|
||||
void StaPipQBufferRenderer::sendStaticData() const {
|
||||
|
||||
@@ -94,10 +94,12 @@ PipelineInfoBag* StaticPipeline::getInfoBag(StaticMesh* mesh,
|
||||
result->blendingEnabled = options->blendingEnabled;
|
||||
result->shadingType = options->shadingType;
|
||||
result->fullClipChecks = options->fullClipChecks;
|
||||
result->textureMappingType = options->textureMappingType;
|
||||
} else {
|
||||
result->antiAliasingEnabled = false;
|
||||
result->blendingEnabled = true;
|
||||
result->shadingType = TyraShadingFlat;
|
||||
result->textureMappingType = TyraLinear;
|
||||
result->fullClipChecks = false;
|
||||
}
|
||||
|
||||
@@ -127,8 +129,9 @@ StaPipTextureBag* StaticPipeline::getTextureBag(
|
||||
|
||||
result->texture =
|
||||
rendererCore->texture.repository.getBySpriteOrMesh(material->getId());
|
||||
TYRA_ASSERT(result->texture, "Texture for material id: ", material->getId(),
|
||||
"was not found in texture repository!");
|
||||
TYRA_ASSERT(
|
||||
result->texture, "Texture for material id: ", material->getId(),
|
||||
"was not found in texture repository! Did you forget to add texture?");
|
||||
|
||||
result->coordinates = materialFrame->getTextureCoords();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user