1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-25 13:17:46 +00:00

Prepare for dyeable gear

This commit is contained in:
Joshua Goins 2024-04-30 19:05:55 -04:00
parent 5a227971c2
commit 1fef1e2acd
3 changed files with 8 additions and 1 deletions

View file

@ -253,6 +253,8 @@ RenderMaterial MDLPart::createMaterial(const physis_Material &material)
newMaterial.type = MaterialType::Skin;
}
newMaterial.tableTexture = renderer->device().createDummyTexture();
char type = t[t.length() - 5];
auto texture = physis_texture_parse(cache.lookupFile(QLatin1String(material.textures[i])));
if (texture.rgba != nullptr) {

View file

@ -25,6 +25,8 @@ struct RenderMaterial {
std::optional<Texture> specularTexture;
std::optional<Texture> multiTexture;
Texture tableTexture;
Buffer materialBuffer;
};

View file

@ -1213,7 +1213,7 @@ GameRenderer::createDescriptorFor(const DrawObject *object, const CachedPipeline
info->imageView = m_viewPositionBuffer.imageView;
} else if (strcmp(name, "g_SamplerDepth") == 0) {
info->imageView = m_depthBuffer.imageView;
} else if (strcmp(name, "g_SamplerNormal") == 0) {
} else if (strcmp(name, "g_SamplerNormal") == 0 || strcmp(name, "g_SamplerIndex") == 0) {
Q_ASSERT(material);
info->imageView = material->normalTexture->imageView;
} else if (strcmp(name, "g_SamplerLightDiffuse") == 0) {
@ -1232,6 +1232,9 @@ GameRenderer::createDescriptorFor(const DrawObject *object, const CachedPipeline
info->imageView = m_tileNormal.imageView;
} else if (strcmp(name, "g_SamplerTileDiffuse") == 0) {
info->imageView = m_tileDiffuse.imageView;
} else if (strcmp(name, "g_SamplerTable") == 0) {
Q_ASSERT(material);
info->imageView = material->tableTexture.imageView;
} else {
info->imageView = m_dummyTex.imageView;
qInfo() << "Unknown image" << name;