mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 16:03:52 +00:00
Narrow glow-card replacement to preserve lamp/sconce textures
- restrict glow sprite substitution to elven-like light models only - keep Stormwind lamps and generic torch sconces rendering authored glass/grate/flame cards - remove over-broad flame heuristic that turned many light fixtures into plain glow orbs
This commit is contained in:
parent
1d71720bcb
commit
dda68635c4
1 changed files with 9 additions and 24 deletions
|
|
@ -2070,17 +2070,6 @@ void M2Renderer::render(const Camera& camera, const glm::mat4& view, const glm::
|
||||||
std::string modelKeyLower = model.name;
|
std::string modelKeyLower = model.name;
|
||||||
std::transform(modelKeyLower.begin(), modelKeyLower.end(), modelKeyLower.begin(),
|
std::transform(modelKeyLower.begin(), modelKeyLower.end(), modelKeyLower.begin(),
|
||||||
[](unsigned char c) { return static_cast<char>(std::tolower(c)); });
|
[](unsigned char c) { return static_cast<char>(std::tolower(c)); });
|
||||||
const bool flameLikeModel =
|
|
||||||
(modelKeyLower.find("lantern") != std::string::npos) ||
|
|
||||||
(modelKeyLower.find("lamp") != std::string::npos) ||
|
|
||||||
(modelKeyLower.find("torch") != std::string::npos) ||
|
|
||||||
(modelKeyLower.find("candle") != std::string::npos) ||
|
|
||||||
(modelKeyLower.find("flame") != std::string::npos) ||
|
|
||||||
(modelKeyLower.find("fire") != std::string::npos) ||
|
|
||||||
(modelKeyLower.find("brazier") != std::string::npos) ||
|
|
||||||
(modelKeyLower.find("campfire") != std::string::npos) ||
|
|
||||||
(modelKeyLower.find("bonfire") != std::string::npos);
|
|
||||||
|
|
||||||
for (const auto& batch : model.batches) {
|
for (const auto& batch : model.batches) {
|
||||||
if (batch.indexCount == 0) continue;
|
if (batch.indexCount == 0) continue;
|
||||||
|
|
||||||
|
|
@ -2101,27 +2090,23 @@ void M2Renderer::render(const Camera& camera, const glm::mat4& view, const glm::
|
||||||
// (lantern housings, posts, etc.) authored so the prop itself remains visible.
|
// (lantern housings, posts, etc.) authored so the prop itself remains visible.
|
||||||
const bool smallCardLikeBatch = (batch.glowSize <= 1.35f);
|
const bool smallCardLikeBatch = (batch.glowSize <= 1.35f);
|
||||||
const bool batchUnlit = (batch.materialFlags & 0x01) != 0;
|
const bool batchUnlit = (batch.materialFlags & 0x01) != 0;
|
||||||
const bool lightEmitterLikeBatch =
|
const bool elvenLikeModel =
|
||||||
flameLikeModel &&
|
(modelKeyLower.find("elf") != std::string::npos) ||
|
||||||
!model.isSpellEffect &&
|
(modelKeyLower.find("elven") != std::string::npos) ||
|
||||||
smallCardLikeBatch &&
|
(modelKeyLower.find("quel") != std::string::npos);
|
||||||
(batch.blendMode >= 1 || batch.colorKeyBlack || batchUnlit);
|
|
||||||
const bool shouldUseGlowSprite =
|
const bool shouldUseGlowSprite =
|
||||||
!koboldFlameCard &&
|
!koboldFlameCard &&
|
||||||
|
elvenLikeModel &&
|
||||||
|
!model.isSpellEffect &&
|
||||||
|
smallCardLikeBatch &&
|
||||||
((batch.blendMode >= 3) ||
|
((batch.blendMode >= 3) ||
|
||||||
lightEmitterLikeBatch ||
|
(batch.colorKeyBlack && batchUnlit && batch.blendMode >= 1));
|
||||||
(flameLikeModel && batchUnlit) ||
|
|
||||||
(batch.colorKeyBlack && flameLikeModel && batchUnlit && batch.blendMode >= 1));
|
|
||||||
if (shouldUseGlowSprite) {
|
if (shouldUseGlowSprite) {
|
||||||
if (entry.distSq < 180.0f * 180.0f) {
|
if (entry.distSq < 180.0f * 180.0f) {
|
||||||
glm::vec3 worldPos = glm::vec3(instance.modelMatrix * glm::vec4(batch.center, 1.0f));
|
glm::vec3 worldPos = glm::vec3(instance.modelMatrix * glm::vec4(batch.center, 1.0f));
|
||||||
GlowSprite gs;
|
GlowSprite gs;
|
||||||
gs.worldPos = worldPos;
|
gs.worldPos = worldPos;
|
||||||
const bool elvenLike =
|
gs.color = elvenLikeModel
|
||||||
(modelKeyLower.find("elf") != std::string::npos) ||
|
|
||||||
(modelKeyLower.find("elven") != std::string::npos) ||
|
|
||||||
(modelKeyLower.find("quel") != std::string::npos);
|
|
||||||
gs.color = elvenLike
|
|
||||||
? glm::vec4(0.48f, 0.72f, 1.0f, 1.05f)
|
? glm::vec4(0.48f, 0.72f, 1.0f, 1.05f)
|
||||||
: glm::vec4(1.0f, 0.82f, 0.46f, 1.15f);
|
: glm::vec4(1.0f, 0.82f, 0.46f, 1.15f);
|
||||||
gs.size = batch.glowSize * instance.scale * 1.45f;
|
gs.size = batch.glowSize * instance.scale * 1.45f;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue