Improve selected-NPC ring visuals, anchoring, and occlusion behavior

Selection ring rendering has been upgraded to better match WoW-like target feedback and remain readable across complex geometry.

Visual updates:
- Reworked ring mesh/shader from a simple two-band strip to a unit-disc + radial fragment shaping.
- Implemented a thinner outer ring profile.
- Added an inward color/alpha gradient that fades from the ring toward the center.

Placement/anchoring updates:
- Added CharacterRenderer::getInstanceFootZ() to query model foot plane from instance bounds.
- Added Application::getRenderFootZForGuid() to resolve per-GUID foot height via live instance mapping.
- Updated GameScreen target selection placement to anchor the effect at target foot Z.

Ground/surface stability:
- In renderSelectionCircle(), added floor clamping against terrain, WMO, and M2 floor probes at target XY.
- Raised final placement offset to reduce residual clipping on uneven surfaces.

Depth/visibility behavior:
- Added polygon offset during ring draw to reduce z-fighting.
- Disabled depth testing for the selection effect draw pass (with state restore) so the ring remains visible through terrain/WMO occluders, per requested behavior.

State safety:
- Restored modified GL state after selection pass (depth test / polygon offset / depth mask / cull).

Build validation:
- Verified with cmake build target "wowee" after each stage; final build succeeds.
This commit is contained in:
Kelsi 2026-02-20 16:02:34 -08:00
parent 1f7c220fdb
commit f7372a282d
6 changed files with 90 additions and 17 deletions

View file

@ -3288,6 +3288,26 @@ bool Application::getRenderBoundsForGuid(uint64_t guid, glm::vec3& outCenter, fl
return renderer->getCharacterRenderer()->getInstanceBounds(instanceId, outCenter, outRadius);
}
bool Application::getRenderFootZForGuid(uint64_t guid, float& outFootZ) const {
if (!renderer || !renderer->getCharacterRenderer()) return false;
uint32_t instanceId = 0;
if (gameHandler && guid == gameHandler->getPlayerGuid()) {
instanceId = renderer->getCharacterInstanceId();
}
if (instanceId == 0) {
auto pit = playerInstances_.find(guid);
if (pit != playerInstances_.end()) instanceId = pit->second;
}
if (instanceId == 0) {
auto it = creatureInstances_.find(guid);
if (it != creatureInstances_.end()) instanceId = it->second;
}
if (instanceId == 0) return false;
return renderer->getCharacterRenderer()->getInstanceFootZ(instanceId, outFootZ);
}
void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x, float y, float z, float orientation) {
if (!renderer || !renderer->getCharacterRenderer() || !assetManager) return;