Convert irrlicht mesh for addSphere

This commit is contained in:
Benau 2022-07-25 10:05:46 +08:00
parent 819b3ad27f
commit 61b87d3b31
2 changed files with 17 additions and 1 deletions

View File

@ -144,7 +144,13 @@ irr::scene::IMeshSceneNode* GEVulkanSceneManager::addMeshSceneNode(
video::S3DVertexSkinnedMesh sp;
sp.m_position = v_ptr[j].Pos;
sp.m_normal = MiniGLM::compressVector3(v_ptr[j].Normal);
sp.m_color = v_ptr[j].Color;
video::SColorf orig(v_ptr[j].Color);
video::SColorf diffuse(mb->getMaterial().DiffuseColor);
orig.r = orig.r * diffuse.r;
orig.g = orig.g * diffuse.g;
orig.b = orig.b * diffuse.b;
orig.a = orig.a * diffuse.a;
sp.m_color = orig.toSColor();
sp.m_all_uvs[0] = MiniGLM::toFloat16(v_ptr[j].TCoords.X);
sp.m_all_uvs[1] = MiniGLM::toFloat16(v_ptr[j].TCoords.Y);
spm_mb->m_vertices.push_back(sp);

View File

@ -1355,7 +1355,17 @@ scene::ISceneNode *IrrDriver::addSphere(float radius,
}
#endif
#ifndef SERVER_ONLY
bool vk = (GE::getVKDriver() != NULL);
if (vk)
GE::getGEConfig()->m_convert_irrlicht_mesh = true;
#endif
scene::IMeshSceneNode *node = m_scene_manager->addMeshSceneNode(mesh);
#ifndef SERVER_ONLY
if (vk)
GE::getGEConfig()->m_convert_irrlicht_mesh = false;
#endif
mesh->drop();
return node;
} // addSphere