mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
WMO glass transparency for instances, disable interior shadows
- Add case-insensitive "glass" detection for WMO window materials - Make instance (WMO-only) glass highly transparent (12-35% alpha) so underwater scenes are visible through Deeprun Tram windows - Keep normal world windows at existing opacity (40-95% alpha) - Disable shadow mapping for interior WMO groups to fix dark indoor areas like Ironforge
This commit is contained in:
parent
f4c115ade9
commit
2c5b7cd368
4 changed files with 23 additions and 7 deletions
|
|
@ -593,16 +593,23 @@ bool WMORenderer::loadModel(const pipeline::WMOModel& model, uint32_t id) {
|
|||
|
||||
// Detect window/glass materials by texture name.
|
||||
// Flag 0x10 (F_SIDN) marks night-glow materials (windows AND lamps),
|
||||
// so we additionally check for "window" in the texture path to
|
||||
// so we additionally check for "window" or "glass" in the texture path to
|
||||
// distinguish actual glass from lamp post geometry.
|
||||
bool isWindow = false;
|
||||
if (batch.materialId < modelData.materialTextureIndices.size()) {
|
||||
uint32_t ti = modelData.materialTextureIndices[batch.materialId];
|
||||
if (ti < modelData.textureNames.size()) {
|
||||
isWindow = (modelData.textureNames[ti].find("window") != std::string::npos);
|
||||
const auto& texName = modelData.textureNames[ti];
|
||||
// Case-insensitive search for "window" or "glass"
|
||||
std::string texNameLower = texName;
|
||||
std::transform(texNameLower.begin(), texNameLower.end(), texNameLower.begin(), ::tolower);
|
||||
isWindow = (texNameLower.find("window") != std::string::npos ||
|
||||
texNameLower.find("glass") != std::string::npos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
BatchKey key{ reinterpret_cast<uintptr_t>(tex), alphaTest, unlit, isWindow };
|
||||
auto& mb = batchMap[key];
|
||||
if (mb.draws.empty()) {
|
||||
|
|
@ -651,7 +658,7 @@ bool WMORenderer::loadModel(const pipeline::WMOModel& model, uint32_t id) {
|
|||
matData.unlit = mb.unlit ? 1 : 0;
|
||||
matData.isInterior = isInterior ? 1 : 0;
|
||||
matData.specularIntensity = 0.5f;
|
||||
matData.isWindow = mb.isWindow ? 1 : 0;
|
||||
matData.isWindow = mb.isWindow ? (wmoOnlyMap_ ? 2 : 1) : 0;
|
||||
matData.enableNormalMap = normalMappingEnabled_ ? 1 : 0;
|
||||
matData.enablePOM = pomEnabled_ ? 1 : 0;
|
||||
matData.pomScale = 0.012f;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue