mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Add diagnostics for invisible creatures and update shadow signatures
- Log warning when WotLK M2 skin file is missing (causes invisible creatures) - Move skin loading inside version >= 264 check to skip unnecessary readFile - Update renderShadow header signatures to match implementation (shadow culling)
This commit is contained in:
parent
7dc9bf3766
commit
30e9998a86
6 changed files with 27 additions and 15 deletions
|
|
@ -63,7 +63,8 @@ public:
|
|||
void render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, const Camera& camera);
|
||||
void recreatePipelines();
|
||||
bool initializeShadow(VkRenderPass shadowRenderPass);
|
||||
void renderShadow(VkCommandBuffer cmd, const glm::mat4& lightSpaceMatrix);
|
||||
void renderShadow(VkCommandBuffer cmd, const glm::mat4& lightSpaceMatrix,
|
||||
const glm::vec3& shadowCenter = glm::vec3(0), float shadowRadius = 1e9f);
|
||||
|
||||
void setInstancePosition(uint32_t instanceId, const glm::vec3& position);
|
||||
void setInstanceRotation(uint32_t instanceId, const glm::vec3& rotation);
|
||||
|
|
|
|||
|
|
@ -251,7 +251,8 @@ public:
|
|||
/**
|
||||
* Render depth-only pass for shadow casting
|
||||
*/
|
||||
void renderShadow(VkCommandBuffer cmd, const glm::mat4& lightSpaceMatrix, float globalTime = 0.0f);
|
||||
void renderShadow(VkCommandBuffer cmd, const glm::mat4& lightSpaceMatrix, float globalTime = 0.0f,
|
||||
const glm::vec3& shadowCenter = glm::vec3(0), float shadowRadius = 1e9f);
|
||||
|
||||
/**
|
||||
* Render M2 particle emitters (point sprites)
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ private:
|
|||
std::unique_ptr<audio::MovementSoundManager> movementSoundManager;
|
||||
std::unique_ptr<game::ZoneManager> zoneManager;
|
||||
// Shadow mapping (Vulkan)
|
||||
static constexpr uint32_t SHADOW_MAP_SIZE = 2048;
|
||||
static constexpr uint32_t SHADOW_MAP_SIZE = 4096;
|
||||
VkImage shadowDepthImage = VK_NULL_HANDLE;
|
||||
VmaAllocation shadowDepthAlloc = VK_NULL_HANDLE;
|
||||
VkImageView shadowDepthView = VK_NULL_HANDLE;
|
||||
|
|
|
|||
|
|
@ -152,7 +152,8 @@ public:
|
|||
/**
|
||||
* Render depth-only for shadow casting
|
||||
*/
|
||||
void renderShadow(VkCommandBuffer cmd, const glm::mat4& lightSpaceMatrix);
|
||||
void renderShadow(VkCommandBuffer cmd, const glm::mat4& lightSpaceMatrix,
|
||||
const glm::vec3& shadowCenter = glm::vec3(0), float shadowRadius = 1e9f);
|
||||
|
||||
/**
|
||||
* Get number of loaded models
|
||||
|
|
|
|||
|
|
@ -3735,10 +3735,14 @@ void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x
|
|||
}
|
||||
|
||||
// Load skin file (only for WotLK M2s - vanilla has embedded skin)
|
||||
std::string skinPath = m2Path.substr(0, m2Path.size() - 3) + "00.skin";
|
||||
auto skinData = assetManager->readFile(skinPath);
|
||||
if (!skinData.empty() && model.version >= 264) {
|
||||
pipeline::M2Loader::loadSkin(skinData, model);
|
||||
if (model.version >= 264) {
|
||||
std::string skinPath = m2Path.substr(0, m2Path.size() - 3) + "00.skin";
|
||||
auto skinData = assetManager->readFile(skinPath);
|
||||
if (!skinData.empty()) {
|
||||
pipeline::M2Loader::loadSkin(skinData, model);
|
||||
} else {
|
||||
LOG_WARNING("Missing skin file for WotLK creature M2: ", skinPath);
|
||||
}
|
||||
}
|
||||
|
||||
// Load external .anim files for sequences without flag 0x20
|
||||
|
|
@ -5951,10 +5955,14 @@ void Application::processPendingMount() {
|
|||
}
|
||||
|
||||
// Load skin file (only for WotLK M2s - vanilla has embedded skin)
|
||||
std::string skinPath = m2Path.substr(0, m2Path.size() - 3) + "00.skin";
|
||||
auto skinData = assetManager->readFile(skinPath);
|
||||
if (!skinData.empty() && model.version >= 264) {
|
||||
pipeline::M2Loader::loadSkin(skinData, model);
|
||||
if (model.version >= 264) {
|
||||
std::string skinPath = m2Path.substr(0, m2Path.size() - 3) + "00.skin";
|
||||
auto skinData = assetManager->readFile(skinPath);
|
||||
if (!skinData.empty()) {
|
||||
pipeline::M2Loader::loadSkin(skinData, model);
|
||||
} else {
|
||||
LOG_WARNING("Missing skin file for WotLK mount M2: ", skinPath);
|
||||
}
|
||||
}
|
||||
|
||||
// Load external .anim files (only idle + run needed for mounts)
|
||||
|
|
|
|||
|
|
@ -3907,14 +3907,15 @@ void Renderer::renderShadowPass() {
|
|||
vkCmdSetScissor(currentCmd, 0, 1, &sc);
|
||||
|
||||
// Phase 7/8: render shadow casters
|
||||
constexpr float kShadowCullRadius = 180.0f; // match kShadowHalfExtent
|
||||
if (wmoRenderer) {
|
||||
wmoRenderer->renderShadow(currentCmd, lightSpaceMatrix);
|
||||
wmoRenderer->renderShadow(currentCmd, lightSpaceMatrix, shadowCenter, kShadowCullRadius);
|
||||
}
|
||||
if (m2Renderer) {
|
||||
m2Renderer->renderShadow(currentCmd, lightSpaceMatrix, globalTime);
|
||||
m2Renderer->renderShadow(currentCmd, lightSpaceMatrix, globalTime, shadowCenter, kShadowCullRadius);
|
||||
}
|
||||
if (characterRenderer) {
|
||||
characterRenderer->renderShadow(currentCmd, lightSpaceMatrix);
|
||||
characterRenderer->renderShadow(currentCmd, lightSpaceMatrix, shadowCenter, kShadowCullRadius);
|
||||
}
|
||||
|
||||
vkCmdEndRenderPass(currentCmd);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue