mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-26 05:37:46 +00:00
Prepare for dyeable gear
This commit is contained in:
parent
5a227971c2
commit
1fef1e2acd
3 changed files with 8 additions and 1 deletions
|
@ -253,6 +253,8 @@ RenderMaterial MDLPart::createMaterial(const physis_Material &material)
|
||||||
newMaterial.type = MaterialType::Skin;
|
newMaterial.type = MaterialType::Skin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newMaterial.tableTexture = renderer->device().createDummyTexture();
|
||||||
|
|
||||||
char type = t[t.length() - 5];
|
char type = t[t.length() - 5];
|
||||||
auto texture = physis_texture_parse(cache.lookupFile(QLatin1String(material.textures[i])));
|
auto texture = physis_texture_parse(cache.lookupFile(QLatin1String(material.textures[i])));
|
||||||
if (texture.rgba != nullptr) {
|
if (texture.rgba != nullptr) {
|
||||||
|
|
|
@ -25,6 +25,8 @@ struct RenderMaterial {
|
||||||
std::optional<Texture> specularTexture;
|
std::optional<Texture> specularTexture;
|
||||||
std::optional<Texture> multiTexture;
|
std::optional<Texture> multiTexture;
|
||||||
|
|
||||||
|
Texture tableTexture;
|
||||||
|
|
||||||
Buffer materialBuffer;
|
Buffer materialBuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1213,7 +1213,7 @@ GameRenderer::createDescriptorFor(const DrawObject *object, const CachedPipeline
|
||||||
info->imageView = m_viewPositionBuffer.imageView;
|
info->imageView = m_viewPositionBuffer.imageView;
|
||||||
} else if (strcmp(name, "g_SamplerDepth") == 0) {
|
} else if (strcmp(name, "g_SamplerDepth") == 0) {
|
||||||
info->imageView = m_depthBuffer.imageView;
|
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);
|
Q_ASSERT(material);
|
||||||
info->imageView = material->normalTexture->imageView;
|
info->imageView = material->normalTexture->imageView;
|
||||||
} else if (strcmp(name, "g_SamplerLightDiffuse") == 0) {
|
} else if (strcmp(name, "g_SamplerLightDiffuse") == 0) {
|
||||||
|
@ -1232,6 +1232,9 @@ GameRenderer::createDescriptorFor(const DrawObject *object, const CachedPipeline
|
||||||
info->imageView = m_tileNormal.imageView;
|
info->imageView = m_tileNormal.imageView;
|
||||||
} else if (strcmp(name, "g_SamplerTileDiffuse") == 0) {
|
} else if (strcmp(name, "g_SamplerTileDiffuse") == 0) {
|
||||||
info->imageView = m_tileDiffuse.imageView;
|
info->imageView = m_tileDiffuse.imageView;
|
||||||
|
} else if (strcmp(name, "g_SamplerTable") == 0) {
|
||||||
|
Q_ASSERT(material);
|
||||||
|
info->imageView = material->tableTexture.imageView;
|
||||||
} else {
|
} else {
|
||||||
info->imageView = m_dummyTex.imageView;
|
info->imageView = m_dummyTex.imageView;
|
||||||
qInfo() << "Unknown image" << name;
|
qInfo() << "Unknown image" << name;
|
||||||
|
|
Loading…
Add table
Reference in a new issue