mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-22 12:07:45 +00:00
Fix the material editor not working with the new renderer
This commit is contained in:
parent
2dff1230c2
commit
ebae9caece
2 changed files with 12 additions and 2 deletions
|
@ -33,7 +33,13 @@ void MaterialView::addSphere(physis_Material material)
|
||||||
{
|
{
|
||||||
mdlPart->clear();
|
mdlPart->clear();
|
||||||
|
|
||||||
mdlPart->addModel(m_mdl, false, glm::vec3(), QStringLiteral(""), {material}, 0);
|
const int raceCode = physis_get_race_code(Race::Hyur, Subrace::Midlander, Gender::Male);
|
||||||
|
|
||||||
|
QString skelName = QStringLiteral("chara/human/c%1/skeleton/base/b0001/skl_c%1b0001.sklb").arg(raceCode, 4, 10, QLatin1Char{'0'});
|
||||||
|
std::string skelNameStd = skelName.toStdString();
|
||||||
|
mdlPart->setSkeleton(physis_parse_skeleton(physis_gamedata_extract_file(data, skelNameStd.c_str())));
|
||||||
|
|
||||||
|
mdlPart->addModel(m_mdl, true, glm::vec3(), QStringLiteral(""), {material}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "moc_materialview.cpp"
|
#include "moc_materialview.cpp"
|
||||||
|
|
|
@ -205,7 +205,11 @@ void GameRenderer::render(VkCommandBuffer commandBuffer, uint32_t imageIndex, Ca
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &part : model.parts) {
|
for (const auto &part : model.parts) {
|
||||||
auto &renderMaterial = model.materials[part.materialIndex];
|
RenderMaterial renderMaterial = model.materials[part.materialIndex];
|
||||||
|
|
||||||
|
if (part.materialIndex + 1 > model.materials.size()) {
|
||||||
|
renderMaterial = model.materials[0]; // TODO: better fallback
|
||||||
|
}
|
||||||
|
|
||||||
if (renderMaterial.shaderPackage.p_ptr == nullptr) {
|
if (renderMaterial.shaderPackage.p_ptr == nullptr) {
|
||||||
qWarning() << "Invalid shader package!";
|
qWarning() << "Invalid shader package!";
|
||||||
|
|
Loading…
Add table
Reference in a new issue